Repository navigation
[precompile] Resolve code defined under a property or cached_property - #194619
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/194619
Note: Links to docs will display an error until the docs builds have been completed. ❌ 13 New Failures, 1 Unrelated FailureAs of commit 1ac85b4 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 24, 2026
Closed
Closed
This was referenced Aug 24, 2026
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 26, 2026
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 28, 2026
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):
A frame whose code object lives inside a descriptor has no resolvable name, so
capture drops it:
convert_framecatches that and runs the frame eager, so the capture reportssuccess while quietly covering less. On a large production model one property
cost four frames this way.
getattron a CLASS returns the descriptor, never the function inside it, andevery place that walks a code object to a name filters for
function/method/class. A
propertypasses none of those tests, so the walkeither stops on an object it cannot descend into (3.11+, where the qualname is
walked directly) or skips the attribute entirely (3.10 and below, where the
class dict is scanned). Both arms needed the same unwrapping, which is now one
helper naming the attribute --
fget,fset,fdel, orfunc-- rather thanthe function, because that is what makes the path round-trip: the loader
replays it with plain
getattr, andproperty.fgetis an ordinary attribute.C.propresolves to("C.prop", "fget.__code__").The name check in the class scan needed the same treatment: a descriptor has no
__name__, so it compares the wrapped function's, which carries theattribute's name.
Not fixed here, from the same report: two other resolution failures on that
model are code objects built by
execof generated source -- a dataclass-style__init__and adynamic_func, both at<string>-- which have no module toresolve by construction. Whether those should be resolvable at all or a quiet
documented skip is a different question from this one, which is a plain miss.
Test Plan:
One new test covers a getter, a nested function inside a getter, a
cached_propertyand a setter, and for each replays exactly what the loaderdoes -- including the
co_consts[i]index step -- so the assertion is that thepath round-trips rather than merely that a name was produced. All four raise
without this change.
Authored with an AI assistant.
Differential Revision: D117283890