Repository navigation
[precompile] Give an installed entry back the defaults its code object lost - #194949
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/194949
Note: Links to docs will display an error until the docs builds have been completed. ❌ 15 New Failures, 1 Unclassified FailureAs of commit b4eae51 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:
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):
An installed artifact rebuilds its entry from that entry's code object, and a
code object carries neither default arguments nor closure cell values. The
standalone driver takes both back from _ENTRY_BINDING, which capture records for
exactly this reason; the installing driver built a bare FunctionType and dropped
them. A defaulted parameter is then simply absent at the served call, so the
guard written against it has nothing to bind and every variant misses.
The defaults fill in the standalone driver's own dispatch was anchored at
len(args), but defaults aligns with the LAST len(defaults) parameters. For
def f(a, b=1, c=2) called as f(x, y), that bound c to b's default. Anchored at
the tail instead.
_rebuild_cell goes with it: the sibling call site already uses types.CellType,
which is public, so the throwaway-closure trick and its "Python exposes no
public cell constructor" comment were both stale and unreached.
Test Plan:
test_precompile_installed_entry_keeps_its_defaults asserts the capture lands in
the installed serving mode and then calls the artifact without the defaulted
argument. It fails on the unfixed driver with "no captured variant matches this
call".
Authored with the assistance of an AI coding agent.