Repository navigation
[precompile] Never drop a guard that pins a Python value - #194286
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/194286
Note: Links to docs will display an error until the docs builds have been completed. ❌ 22 New Failures, 1 Unrelated FailureAs of commit 9709e44 with merge base 1b4e490 ( NEW FAILURES - The following jobs have failed:
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 20, 2026
Closed
Closed
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 20, 2026
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. |
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):
Invariant-guard dropping already exempts guards that pin a SHAPE, on the grounds
that with one example nothing can discriminate and what silently disappears is
the check that the runtime input looks like the captured one at all. Value
guards are the same argument and the worse half.
CONSTANT_MATCH, EQUALS_MATCH and DUPLICATE_INPUT pin a Python value the graph
specialized on: an int or bool argument that selects a branch,
module.training,an
.item()result,mask=None, the same tensor passed twice. Dropped, theartifact answers every other value from the captured branch. Measured before
this change, all with correct-LOOKING numerics and no error:
captured k=5, served k=1 -> the k=5 graph
captured eval, served train -> dropout stays off
Shapes at least crash inside a kernel on the inductor backend. These do not,
which is why they are the more dangerous half and why the exemption should have
covered them from the start.
Also stops the artifact reporting zero drops while dropping. Policy drops were
recorded in a set that was written and never read, so DROPPED_GUARDS printed []
and require_no_dropped_guards=True passed on captures that had silently
discarded a precondition -- the one place a reviewer would look was empty by
construction. They are now a field on PrecompileSummary and a POLICY_DROPPED_GUARDS
literal in the header, kept apart from DROPPED_GUARDS because "could not be
serialized" and "could, and was judged redundant" have different remedies.
Cost is small: +2.6% on a two-variant artifact (27,010 -> 27,709 chars).
Test Plan:
Two existing tests documented the old trade and now assert its inverse: an
uncovered value is refused rather than answered, on the standalone path, and
recompiled on the installed one.
Authored with an AI assistant.
Differential Revision: D116840945