8000 [invoke_subgraph] Run missing graph passes recursively by anijain2305 · Pull Request #152675 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[invoke_subgraph] Run missing graph passes recursively #152675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
57f8556
[invoke_subgraph] Run missing graph passes recursively
anijain2305 May 2, 2025
d786c21
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 2, 2025
e7fa1e3
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 3, 2025
3639e98
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 4, 2025
1ef794a
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 4, 2025
3c8fe85
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 4, 2025
f046bd8
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 4, 2025
c495166
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 4, 2025
19bbfc4
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 4, 2025
5f878b2
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 4, 2025
b4ae64d
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 4, 2025
df2583f
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 5, 2025
29555ce
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 5, 2025
0aa67bc
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 5, 2025
36d6535
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 5, 2025 8000
bde719c
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 5, 2025
814e68f
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 5, 2025
cbf8ffc
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 5, 2025
fcdf745
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 5, 2025
239dd4e
Update on "[invoke_subgraph] Run missing graph passes recursively"
anijain2305 May 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update on "[invoke_subgraph] Run missing graph passes recursively"
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov

[ghstack-poisoned]
  • Loading branch information
anijain2305 committed May 4, 2025
commit c495166a19f23492d622bb28f04d26037223f464
14 changes: 0 additions & 14 deletions torch/_functorch/_aot_autograd/dispatch_and_compile_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from torch import Tensor
from torch._dispatch.python import enable_python_dispatcher
from torch._dynamo.utils import detect_fake_mode, lazy_format_graph_code
from torch._inductor.utils import OrderedSet
from torch._logging import getArtifactLogger, trace_structured
from torch._subclasses.functional_tensor import FunctionalTensorMode
from torch.fx.experimental.proxy_tensor import make_fx
Expand Down Expand Up @@ -184,19 +183,6 @@ def aot_dispatch_base_graph(
# there should be *NO* mutating ops in the graph at this point.
copy_count = assert_functional_graph(fw_module.graph)
fw_module.graph.eliminate_dead_code()

# Call DCE on the subgraphs
# TODO - Consider updating the eliminate_dead_code to work recursively.
seen_subgraphs: OrderedSet[str] = OrderedSet()
for nd in fw_module.graph.find_nodes(
op="call_function", target=torch.ops.higher_order.invoke_subgraph
):
subgraph_name = nd.args[0].target
if subgraph_name not in seen_subgraphs:
seen_subgraphs.add(subgraph_name)
subgraph = getattr(fw_module, nd.args[0].target)
subgraph.graph.eliminate_dead_code()
subgraph.recompile()
fw_module.recompile()

copy_count2 = assert_functional_graph(fw_module.graph)
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.
0