Repository navigation
[precompile] Report a guard that rebuilds into a different check - #194393
Closed
bobrenjc93 wants to merge 3 commits into
Closed
bobrenjc93 wants to merge 3 commits into
bobrenjc93 wants to merge 3 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/194393
Note: Links to docs will display an error until the docs builds have been completed. ❌ 11 New Failures, 1 Unrelated Failure, 1 Unclassified FailureAs of commit bb3f0c5 with merge base 1b4e490 ( 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 21, 2026
Closed
Closed
This was referenced Aug 22, 2026
Closed
Contributor
Author
|
@bobrenjc93 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1 similar comment
Contributor
Author
|
@bobrenjc93 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
A guard whose source cannot be re-evaluated against the reconstructed values
raises, and the commit that added the rebuild pass drops it. The quieter half of
the same failure has no symptom at all: a guard that rebuilds SUCCESSFULLY into
a different check, because reconstruction lost a value the guard reads rather
than a value its source traverses. That artifact serializes, loads, and then
never matches -- which looks like a cold cache, not like a bug.
Both fixes in this stack are of that shape. A dropped dimension marking turns
getattr(x, '_dynamo_unbacked_indices', set()).issubset({0})intohasattr(x, '_dynamo_unbacked_indices') == False; a dropped tensor attributeleaves a HASATTR that comes back as its own inverse. Neither raises.
Record the leaf guards every LIVE build produces during a capture, and compare
the rebuild against them. A leaf the live build never made means reconstruction
lost something. Recorded only from live builds -- the flag is off for a state
loaded from a pickle -- or a reconstruction bug would whitelist itself.
One-directional, on purpose: the invariant-guard policy legitimately drops
guards, so a leaf present live and absent at load is expected and must not fire.
Four things are excluded from the comparison, each because it differs on a
CORRECT artifact. Node lines, which carry the guarded value's type (Tensor live,
FakeTensor rebuilt). Depth, since the same guard at a different depth means
nothing different. Relational guards, installed by compile_check_fn for the
runtime builder only. And LAMBDA_GUARD, whose identity is a generated name: a
tensor subclass installs a metadata lambda on one side and not the other, which
this cannot tell from real drift. Raw id()s are masked for the same reason.
A warning, not a refusal. The exclusion list was arrived at empirically and a
false positive would refuse a working artifact, which is worse than the drift it
would catch. Enough evidence to warn, not enough to fail closed.
Test Plan:
test_aot_compile.py has 3 pre-existing failures in this environment
(test_aot_compile_with_aoti*,
fatal error: cuda.h).Swept for false positives across all three precompile suites: zero, against
three TRUE positives -- the artifacts the drop-not-refuse tests deliberately
break, each caught as the inverted NO_HASATTR. The new test asserts both
directions on one model: no drift reported normally, and the attribute named
when the carrier is disabled.
Authored with an AI assistant.
Differential Revision: D116962609