Skip to content

[precompile] Report the recorded/total split when a compiled backend is missing - #194454

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

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

Conversation

@bobrenjc93

@bobrenjc93 bobrenjc93 commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Backend recording is all-or-nothing: _collect_backends fails the whole
artifact if any one backend id has nothing behind it. The message it failed
with said "Precompilation captured graphs but their compiled backends were
never recorded, so there is nothing to serialize", which describes a total
failure. A capture of a large sharded model that recorded 41 of its 56 backends
and missed 15 got that same sentence, and it was read -- reasonably -- as
having recorded nothing, which sends the reader looking for a cause big enough
to explain losing everything.

Report the split instead, and name the ids that are missing. The counts are
what tell a reader whether they are looking at one bad graph or a broken
capture, and they were the one thing the message did not have.

The rest of the message had also gone stale. It attributed the gap to
AOTAutogradCache declining to key the graph, which stopped being possible two
commits down: capture now pins bypass_autograd_cache_key, so every graph
gets a key and is recorded whether or not the cache could have addressed it.
The remaining cause is the other one it already named, a backward that never
compiled, so that is now the headline rather than the afterthought. The bypass
count stays, demoted to a diagnostic and only when nonzero, because rendering
re-enters AOTAutograd outside the capture config and bypasses there routinely
-- a nonzero count on a healthy capture is expected and does not explain a gap.

save() had its own copy of the paragraph, reached by string-matching the
store's RuntimeError, and the two had already drifted. They now share one
builder.

Test Plan:

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

Two new tests. The first pins the reason the split cannot currently be
nonzero: a capture whose graphs are unkeyable on only some sides of its graph
breaks records all four of its backends and bypasses zero times. Forcing
bypass_autograd_cache_key back off makes that same capture report "recorded 2
of 4", which is both how the new message was checked against a real partial
state and confirmation that the 41-of-56 reading was right. The second covers
the message itself, including the truncation and the absence of the old
"never recorded" claim.

Authored with an AI assistant.

Differential Revision: D117073080

[ghstack-poisoned]
@bobrenjc93 bobrenjc93 added ciflow/trunk Trigger trunk jobs on your pull request topic: not user facing topic category labels Aug 22, 2026
@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/194454

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

❌ 14 New Failures, 1 Unrelated Failure, 1 Unclassified Failure

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

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:

BROKEN TRUNK - The following job failed but were 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
[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.

This was referenced Aug 23, 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/1041/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