Repository navigation
[precompile] Let a served frame's user globals win over the artifact's own - #194950
Closed
bobrenjc93 wants to merge 2 commits into
Closed
bobrenjc93 wants to merge 2 commits into
bobrenjc93 wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/194950
Note: Links to docs will display an error until the docs builds have been completed. ❌ 22 New FailuresAs of commit 0809c95 with merge base 1b4e490 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Aug 25, 2026
Closed
Closed
This was referenced Aug 26, 2026
Closed
This was referenced Aug 28, 2026
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 multi-graph driver bound every frame to globals() -- the artifact module's
live dict -- and seeded the user's module globals into it with setdefault. The
rendered backend source is exec'd into that same module and brings its own
module-level names with it, so any collision resolved in the artifact's favour.
A frame reading a user global of that name got the artifact's value, while its
guards had been written against the user's, and every variant missed.
Seeding a copy instead separates the two. The rendered kernels keep resolving
through the real module dict via their own globals, so nothing moves out
from under them, and the artifact's own bindings -- backend ids, import aliases,
resume dispatchers -- are applied after the seed and still win. Among several
user modules the first frame's still wins, which is the flattening this one
namespace has always done.
Test Plan:
test_precompile_user_global_wins_over_the_artifacts_own captures an entry
reading a module-level global whose name the artifact also binds. It fails on
the unfixed driver with "no captured variant matches this call".
Authored with the assistance of an AI coding agent.