Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 18, 2024
1 parent 2bd6416 commit eb43de8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion thunder/core/rematerialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ def apply_rematerialization_for_consumer(
_, leaves = bsym_list_to_dag(list(new_subsymbols))
new_subsymbols = toposort_bsym_dag(leaves, TOPOSORT_ORDER.BOTTOM_UP)
proxy_order = order_proxies(new_subsymbols)
new_consumer_args = tuple(sorted((a for a in new_consumer_args if a.name in proxy_order), key=lambda x: proxy_order[x.name]))
new_consumer_args = tuple(
sorted((a for a in new_consumer_args if a.name in proxy_order), key=lambda x: proxy_order[x.name])
)
new_consumer = replace(consumer, args=new_consumer_args, subsymbols=new_subsymbols)
return new_consumer

Expand Down
1 change: 1 addition & 0 deletions thunder/core/transform_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ def order_proxies(bsyms: Sequence[BoundSymbol]) -> dict[str, int]:
"""
counter = 0
proxy_order: dict[str, int] = {} # names to order

def process_bound_symbols(bound_symbols):
nonlocal counter
for bsym in bound_symbols:
Expand Down

0 comments on commit eb43de8

Please sign in to comment.