Repository navigation
[guards] Register the dimension markings where they are read, and delete the allowlist - #194387
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/194387
Note: Links to docs will display an error until the docs builds have been completed. ❌ 24 New Failures, 1 Unrelated FailureAs of commit 47ec943 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 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):
The dimension-marking guard reads five attributes off the example tensor -- plus
two more that are gated on
_dynamo_unbacked_indices-- with hasattr/getattrrather than through a Source. Nothing else registers those values in the guard
tree, and value pruning drops whatever the tree does not reach, so the
serialized state lost them and the rebuilt guard compared against nothing: a
mark_unbackedartifact refused the very tensor it was captured on.That was papered over with
_TENSOR_ATTRIBUTES_TENSOR_MATCH_READS, afrozenset naming the attributes so the tensor carrier would keep them anyway.
It was a second list that had to stay in sync with the first, and it was
ALREADY out of sync when it landed -- five names where the builder reads seven,
which is worse than none: carrying the gate without its dependents activates a
guard whose expected value is now None.
Register at the read site instead. One local
read_markingroutes both loops,so a sixth or eighth name cannot be added to
dim_marking_attrswithoutbecoming carriable, and the allowlist is deleted. It is also more precise than
the list was: it carries exactly the markings this guard will consume, rather
than every name on a list whether the guard reads it or not.
Registration is conditional on the value being present.
mark_unbackedsetsthe gate but leaves at least one dependent as None on every path, and
registering None would put
id(None)in the tree, which value pruning matchesby identity.
Test Plan:
The existing test is parametrized over the five marking shapes --
mark_unbackedbare, with bounds, and with a shape_id;mark_static;mark_dynamic-- and all five fail without the registration. Each one servesthe SAME marked tensor it captured, which is the only thing that tests this:
every other marking test in these suites marks one tensor and then serves a
fresh unmarked one, and passes with the bug fully present.
Authored with an AI assistant.
Differential Revision: D116962607