Skip to content

[precompile] Name the real reason a capture recorded no backends - #194428

Closed
bobrenjc93 wants to merge 2 commits into
gh/bobrenjc93/1035/basefrom
gh/bobrenjc93/1035/head
Closed

bobrenjc93 wants to merge 2 commits into
gh/bobrenjc93/1035/basefrom
gh/bobrenjc93/1035/head

Conversation

@bobrenjc93

@bobrenjc93 bobrenjc93 commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

"Precompilation captured graphs but their compiled backends were never
recorded" blamed a forward-only capture and told the reader to pass
training=True. A user hit it with training=True already set, and lost a
35-minute run working out that the message was wrong.

There are two causes, not one. The message described the second and asserted it.
The first -- AOTAutogradCache declining the graph, which records nothing whether
or not the backward compiles -- is the more likely one on a large model, and the
counter that distinguishes them is already being kept. Report it, and point at
the log that names the offending graph.

Two smaller things found alongside, both comments:

_capture_config sets allow_empty_graphs so an empty graph still reaches
the artifact with its guards. It also extends the lifetime of whatever that
frame holds -- with the flag on, a weakref callback on a value the frame
captured does not fire when the caller drops its reference, which
test/dynamo/test_repros.py ReproTests.test_weakref_callback demonstrates.
Worth knowing before capturing something large; noted where the flag is set.

And a reference to "Note [precompile dynamo training grad accumulation]", which
was never written. The sentence pointing at it already says what it needed to,
so the dangling pointer goes rather than the note arriving.

Test Plan:

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

No new test: the changed text is an error message whose two arms are a
counter read and prose, and the existing coverage of the error itself
(test_precompile.py's forward-only-capture cases) still passes.

Authored with an AI assistant.

Differential Revision: D117030055

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

pytorch-bot Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 14 New Failures, 2 Unrelated Failures

As of commit 9745bef 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.

This was referenced Aug 22, 2026
This was referenced Aug 22, 2026
[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/1035/head branch November 11, 2026 01:45
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