Skip to content

[dynamo] Stop shipping every inlined module's whole source in the package - #194384

Closed
bobrenjc93 wants to merge 3 commits into
gh/bobrenjc93/1021/basefrom
gh/bobrenjc93/1021/head
Closed

bobrenjc93 wants to merge 3 commits into
gh/bobrenjc93/1021/basefrom
gh/bobrenjc93/1021/head

Conversation

@bobrenjc93

@bobrenjc93 bobrenjc93 commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

InlinedSource records the module, line range and checksum of each function
Dynamo inlined, so a load can tell whether the source has drifted. It also
carried content: the entire source text of the defining module, for every
module involved.

Nothing reads it. grep over torch and test finds one writer and no reader --
the drift check uses checksum and re-reads the live module. It is
deadweight, and it scales with the size of the modules the model happens to
touch rather than with the model.

Measured on an installed artifact for a graph-breaking TransformerEncoderLayer:
796,497 bytes to 91,105, an 88.6% reduction. The field stays on the dataclass
with a default so an artifact pickled before this still loads; it is simply
never populated, and _get_module_content goes with it.

Test Plan:

python test/dynamo/test_package.py
python test/test_precompile.py
python test/dynamo/test_precompile_context.py

No new test: there is nothing to assert beyond the absence of a field nothing
reads, and the drift check that DOES use these records is covered by
test_package.py's existing test_file_change.

Authored with an AI assistant.

Differential Revision: D116962602

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/194384

Note: Links to docs will display an error until the docs builds have been completed.

❌ 24 New Failures, 2 Unrelated Failures

As of commit 92f824b with merge base 1b4e490 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot Bot added ciflow/inductor ciflow/torchtitan Run TorchTitan integration tests module: dynamo labels Aug 21, 2026
This was referenced Aug 21, 2026
This was referenced Aug 22, 2026
[ghstack-poisoned]
[ghstack-poisoned]
@bobrenjc93

Copy link
Copy Markdown
Contributor Author

@bobrenjc93 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@bobrenjc93

Copy link
Copy Markdown
Contributor Author

@bobrenjc93 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@bobrenjc93

Copy link
Copy Markdown
Contributor Author

Superseded by the canonical precompile stack #195353-#195362; this change lives in #195362 (with the guard-drop policy half in #195360). Closing to consolidate review there. The branch is kept on GitHub.

@bobrenjc93 bobrenjc93 closed this Sep 3, 2026
@github-actions
github-actions Bot deleted the gh/bobrenjc93/1021/head branch November 12, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/torchtitan Run TorchTitan integration tests ciflow/trunk Trigger trunk jobs on your pull request module: dynamo topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant