Skip to content

Batch cheap FX cleanups and defer post_lowering recompile - #4529

Closed
micwill755 wants to merge 3 commits into
pytorch:mainfrom
micwill755:batch-defer-fx-cleanup
Closed

Batch cheap FX cleanups and defer post_lowering recompile#4529
micwill755 wants to merge 3 commits into
pytorch:mainfrom
micwill755:batch-defer-fx-cleanup

Conversation

@micwill755

Copy link
Copy Markdown
Collaborator

Summary

  • Batch non-conflicting FX cleanups and defer DCE/lint/recompile to one flush at the end of post_lowering.
  • Keeps fuse_pad_into_convolution in the pass list.

This is PR 3/3 in a stack. It includes the first two PRs plus this commit. Review only the latest commit, or this compare:
micwill755/TensorRT@skip-aliased-fold-install...batch-defer-fx-cleanup

Test plan

  • Flux / VLA compile still succeeds
  • post_lowering still applies assert removal, dead-user removal, and related cleanups
  • Pad-into-convolution fusion still runs on graphs that need it

When require_full_compilation already has full converter coverage, wrap the graph as one TRT block instead of repeating AccNodesFinder, fusion, and adjacency split.
Avoid cpu().contiguous() copies of folded tensors that already share storage with module weights under offload_module_to_cpu, while still installing materialized folds.
…g flush.

Run non-conflicting node repairs together and skip repeated DCE/lint/recompile so post_lowering pays for cleanup once.
@meta-cla meta-cla Bot added the cla signed label Aug 19, 2026
@github-actions github-actions Bot added component: lowering Issues re: The lowering / preprocessing passes component: core Issues re: The core compiler component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Aug 19, 2026
@github-actions
github-actions Bot requested a review from cehongwang August 19, 2026 21:50
@micwill755

Copy link
Copy Markdown
Collaborator Author

Superseded by the real GitHub stack (stack #4533): #4530 -> #4531 -> #4532. These fork branches could not be stacked because GitHub stacked PRs do not support pull requests from forks.

@micwill755 micwill755 closed this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: api [Python] Issues re: Python API component: core Issues re: The core compiler component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: lowering Issues re: The lowering / preprocessing passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant