Skip to content

Skip installing large aliased constant-folded weights - #4528

Closed
micwill755 wants to merge 2 commits into
pytorch:mainfrom
micwill755:skip-aliased-fold-install
Closed

Skip installing large aliased constant-folded weights#4528
micwill755 wants to merge 2 commits into
pytorch:mainfrom
micwill755:skip-aliased-fold-install

Conversation

@micwill755

Copy link
Copy Markdown
Collaborator

Summary

  • Skip installing large constant-folded tensors that only alias existing module weights, avoiding expensive cpu().contiguous() copies under offload_module_to_cpu.

This is PR 2/3 in a stack. It includes the partition short-circuit PR plus this commit. Review only the latest commit, or this compare:
micwill755/TensorRT@partition-short-circuit...skip-aliased-fold-install

Test plan

  • Flux NVFP4 cold compile still succeeds with offload_module_to_cpu=True
  • Large weight permutes remain in-graph (not installed as frozen params)
  • VLA still folds materialized embedding constants and compiles (int32 indices)

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.
@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
@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