Skip to content

Commit

Permalink
initial bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Alshaarawy committed Dec 12, 2024
1 parent f89ceca commit e2aacb9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions thunder/executors/torch_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,22 @@ def make_compiled(
region_trace = TraceCtx(None)
region_trace.args = sorted_unique_inputs
region_trace.kwargs = {}
with tracectx(region_trace):
for a in sorted_unique_inputs:
prims.unpack_trivial(a, name=a.name)
for a in sorted_unique_inputs:
region_trace.bound_symbols.append(prims.unpack_trivial.bind(a, name=a.name, output=a))

region_trace.bound_symbols += list(bsyms)
region_trace.bound_symbols.append(prims.python_return.bind(sorted_unique_outputs, output=None))
for bsym in region_trace.bound_symbols:
for o in bsym.flat_outs:
if o is not None:
region_trace.add_name(o.name)
for sbsym in bsym.subsymbols:
for o in sbsym.flat_outs:
if o is not None and o.name not in region_trace.names:
region_trace.add_name(o.name)
for arg in region_trace.args:
if arg.name not in region_trace.names:
region_trace.add_name(arg.name)

# maybe make this the default if no sig info is present?
region_trace._siginfo = SigInfo("to_be_compiled")
Expand Down

0 comments on commit e2aacb9

Please sign in to comment.