Repository navigation
[precompile] Check a standalone artifact's inlined source before trusting it - #194389
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/194389
Note: Links to docs will display an error until the docs builds have been completed. ❌ 199 New Failures, 2 Unrelated FailuresAs of commit 45883dd with merge base 1b4e490 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
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):
An installed artifact rebuilds a CompilePackage at load, and that constructor
verifies that every function Dynamo inlined into a captured graph still has the
source it had at capture. A standalone artifact builds no package, so it never
ran that check -- and the failure mode is not a missing warning, it is a wrong
answer:
after changing a constant in an inlined helper between capture and load.
Emit the records the check needs -- module, line range, checksum, no content --
and check them in the driver rather than in
load(). The artifact's ownstated invariant is that it is self-contained, and its header documents
exec(open(...).read(), ns); ns["forward"](model, x)as a supported way touse it; a check in
load()is bypassed by exactly that path. The logic staysin torch and only the call is frozen into the emitted source, matching how the
driver already reaches
load_guard_manager.__main__records are skipped. They name the LOADER's script on anothermachine, so checking them would refuse a portable artifact with a false
diagnosis -- and capture-in-a-script, serve-elsewhere is what a standalone
artifact is for. Verified: an artifact captured from a script still serves
correctly when loaded by a different script whose
__main__defines aconflicting function of the same name.
Test Plan:
The new test captures against an importable helper, serves it, rewrites the
helper's arithmetic, and asserts the reload refuses -- and asserts the artifact
is in the standalone mode first, so it cannot silently start testing the
installed path.
Authored with an AI assistant.
Differential Revision: D116962605