Skip to content

Commit

Permalink
skip epilogue if trivial
Browse files Browse the repository at this point in the history
  • Loading branch information
t-vi committed Jun 24, 2024
1 parent f12e20f commit aeebb1b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions thunder/core/jit_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,16 @@ def thunder_general_jit(

bind_inputs("computation", computation_trace, pro_to_comp_proxies)
if epilogue_trace:
l = len(epilogue_trace.bound_symbols)
if l == 0:
epilogue_trace = None
elif l == 1:
(r,) = epilogue_trace.bound_symbols
assert r.sym == prims.python_return
epilogue_trace = None

if epilogue_trace:
print(epilogue_trace)
bind_inputs("epilogue", epilogue_trace, pro_to_epi_proxies + comp_to_epi_proxies)

# Returns a new swapmap dictionary which has the keys (ctx._proxy_swapmap.key() & variableify(proxies))
Expand Down

0 comments on commit aeebb1b

Please sign in to comment.