Repository navigation
[dynamo] Preserve wrapper dispatch for bound classmethods - #12
Merged
Merged
Conversation
Classmethod binding can wrap a WrapperUserFunctionVariable in UserMethodVariable. Inlining that method as a plain function invokes has_self on the wrapper, which has no ordinary inlining implementation. Delegate wrapped calls with the bound class prepended so cache tracing and nested fullgraph policy remain intact. Test Plan: Four Dynamo function tests passed using the installed CUDA wheel with an isolated Python overlay; the new cached-classmethod regression fails before the patch. The real vLLM CUDA platform query compiles successfully. lintrunner -a was run; a pre-existing B911 advisory remains at line 809 of test_functions.py. git diff --check passes.
cyyever
marked this pull request as ready for review
October 30, 2026 09:56
cyyever
added a commit
that referenced
this pull request
Oct 31, 2026
Classmethod binding can wrap a WrapperUserFunctionVariable in UserMethodVariable. Inlining that method as a plain function invokes has_self on the wrapper, which has no ordinary inlining implementation. Delegate wrapped calls with the bound class prepended so cache tracing and nested fullgraph policy remain intact. Test Plan: Four Dynamo function tests passed using the installed CUDA wheel with an isolated Python overlay; the new cached-classmethod regression fails before the patch. The real vLLM CUDA platform query compiles successfully. lintrunner -a was run; a pre-existing B911 advisory remains at line 809 of test_functions.py. git diff --check passes.
cyyever
added a commit
that referenced
this pull request
Oct 31, 2026
Classmethod binding can wrap a WrapperUserFunctionVariable in UserMethodVariable. Inlining that method as a plain function invokes has_self on the wrapper, which has no ordinary inlining implementation. Delegate wrapped calls with the bound class prepended so cache tracing and nested fullgraph policy remain intact. Test Plan: Four Dynamo function tests passed using the installed CUDA wheel with an isolated Python overlay; the new cached-classmethod regression fails before the patch. The real vLLM CUDA platform query compiles successfully. lintrunner -a was run; a pre-existing B911 advisory remains at line 809 of test_functions.py. git diff --check passes.
cyyever
added a commit
that referenced
this pull request
Oct 31, 2026
Classmethod binding can wrap a WrapperUserFunctionVariable in UserMethodVariable. Inlining that method as a plain function invokes has_self on the wrapper, which has no ordinary inlining implementation. Delegate wrapped calls with the bound class prepended so cache tracing and nested fullgraph policy remain intact. Test Plan: Four Dynamo function tests passed using the installed CUDA wheel with an isolated Python overlay; the new cached-classmethod regression fails before the patch. The real vLLM CUDA platform query compiles successfully. lintrunner -a was run; a pre-existing B911 advisory remains at line 809 of test_functions.py. git diff --check passes.
cyyever
added a commit
that referenced
this pull request
Oct 31, 2026
Classmethod binding can wrap a WrapperUserFunctionVariable in UserMethodVariable. Inlining that method as a plain function invokes has_self on the wrapper, which has no ordinary inlining implementation. Delegate wrapped calls with the bound class prepended so cache tracing and nested fullgraph policy remain intact. Test Plan: Four Dynamo function tests passed using the installed CUDA wheel with an isolated Python overlay; the new cached-classmethod regression fails before the patch. The real vLLM CUDA platform query compiles successfully. lintrunner -a was run; a pre-existing B911 advisory remains at line 809 of test_functions.py. git diff --check passes.
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.
Linked issue or supporting maintainer
Requested by the fork owner for
trim.BC-breaking?
No.
Summary (human written only)
User request:
Agent details (AI-generated)
Compiling an inherited
@classmethodwrapped infunctools.cacheraisesInternalTorchDynamoError: NotImplementedErrorinWrapperUserFunctionVariable.has_self. This blocks vLLM's CUDA platform capability query during DeepSeek-V4 compilation.UserMethodVariablenow delegates wrapped calls to the wrapper's owncall_function, prepending the bound class. This preserves cache tracing and nestedtorch.compile(fullgraph=True)policy. The change adds regressions for inherited cached classmethods and nested fullgraph enforcement.Validation:
git diff --checkpasses.lintrunner -aran; targeted checking reports only the existing B911 advisory attest/dynamo/test_functions.py:809. The initial broad invocation also lacked actionlint; the existing tool directory was linked for the targeted rerun. Its unrelated automatic workflow edit was discarded.The DeepSeek dummy-weight probe passes the original failure and then fails later in the Triton warmup helper. Full DeepSeek inference with mandatory compilation has not passed yet.