Repository navigation
Fix stale TorchScript and Windows references in trim compilers - #7
Merged
Merged
Conversation
TorchScript's ScriptFunction was removed from trim, but tracing a wrapped callable still accessed the missing type. Remove that unreachable branch while preserving fullgraph handling for nested torch.compile calls. Test Plan ```sh lintrunner -a ``` Real CUDA TP2 Llama serving fails at the obsolete type lookup without the fix and generates matching text and logprobs for two 8-token prompts with the isolated fix. Tested through the Rust/OpenAI server; no full rebuild or broad Dynamo suite was run. Co-authored-by: Codex <[email protected]> Signed-off-by: Yuanyuan Chen <[email protected]>
The trim build no longer defines _IS_WINDOWS. CPU Inductor bindings still referenced it while preparing precompiled headers, raising NameError before a kernel could execute. Remove the stale guard for supported non-Windows builds. Test Plan: lintrunner -a passed. With isolated fixed PyTorch modules, the 10 vLLM compilation-policy regressions passed, including a real CPU Inductor kernel and the expected recompilation-limit exception. Co-authored-by: Codex <[email protected]> Signed-off-by: Yuanyuan Chen <[email protected]>
cyyever
marked this pull request as ready for review
October 30, 2026 00:00
cyyever
added a commit
that referenced
this pull request
Oct 31, 2026
* Remove stale ScriptFunction dispatch from Dynamo TorchScript's ScriptFunction was removed from trim, but tracing a wrapped callable still accessed the missing type. Remove that unreachable branch while preserving fullgraph handling for nested torch.compile calls. Test Plan ```sh lintrunner -a ``` Real CUDA TP2 Llama serving fails at the obsolete type lookup without the fix and generates matching text and logprobs for two 8-token prompts with the isolated fix. Tested through the Rust/OpenAI server; no full rebuild or broad Dynamo suite was run. Co-authored-by: Codex <[email protected]> Signed-off-by: Yuanyuan Chen <[email protected]> * Remove stale Windows guard from Inductor header preparation The trim build no longer defines _IS_WINDOWS. CPU Inductor bindings still referenced it while preparing precompiled headers, raising NameError before a kernel could execute. Remove the stale guard for supported non-Windows builds. Test Plan: lintrunner -a passed. With isolated fixed PyTorch modules, the 10 vLLM compilation-policy regressions passed, including a real CPU Inductor kernel and the expected recompilation-limit exception. Co-authored-by: Codex <[email protected]> Signed-off-by: Yuanyuan Chen <[email protected]> --------- Signed-off-by: Yuanyuan Chen <[email protected]> Co-authored-by: Codex <[email protected]>
cyyever
added a commit
that referenced
this pull request
Oct 31, 2026
* Remove stale ScriptFunction dispatch from Dynamo TorchScript's ScriptFunction was removed from trim, but tracing a wrapped callable still accessed the missing type. Remove that unreachable branch while preserving fullgraph handling for nested torch.compile calls. Test Plan ```sh lintrunner -a ``` Real CUDA TP2 Llama serving fails at the obsolete type lookup without the fix and generates matching text and logprobs for two 8-token prompts with the isolated fix. Tested through the Rust/OpenAI server; no full rebuild or broad Dynamo suite was run. Co-authored-by: Codex <[email protected]> Signed-off-by: Yuanyuan Chen <[email protected]> * Remove stale Windows guard from Inductor header preparation The trim build no longer defines _IS_WINDOWS. CPU Inductor bindings still referenced it while preparing precompiled headers, raising NameError before a kernel could execute. Remove the stale guard for supported non-Windows builds. Test Plan: lintrunner -a passed. With isolated fixed PyTorch modules, the 10 vLLM compilation-policy regressions passed, including a real CPU Inductor kernel and the expected recompilation-limit exception. Co-authored-by: Codex <[email protected]> Signed-off-by: Yuanyuan Chen <[email protected]> --------- Signed-off-by: Yuanyuan Chen <[email protected]> Co-authored-by: Codex <[email protected]>
cyyever
added a commit
that referenced
this pull request
Oct 31, 2026
* Remove stale ScriptFunction dispatch from Dynamo TorchScript's ScriptFunction was removed from trim, but tracing a wrapped callable still accessed the missing type. Remove that unreachable branch while preserving fullgraph handling for nested torch.compile calls. Test Plan ```sh lintrunner -a ``` Real CUDA TP2 Llama serving fails at the obsolete type lookup without the fix and generates matching text and logprobs for two 8-token prompts with the isolated fix. Tested through the Rust/OpenAI server; no full rebuild or broad Dynamo suite was run. Co-authored-by: Codex <[email protected]> Signed-off-by: Yuanyuan Chen <[email protected]> * Remove stale Windows guard from Inductor header preparation The trim build no longer defines _IS_WINDOWS. CPU Inductor bindings still referenced it while preparing precompiled headers, raising NameError before a kernel could execute. Remove the stale guard for supported non-Windows builds. Test Plan: lintrunner -a passed. With isolated fixed PyTorch modules, the 10 vLLM compilation-policy regressions passed, including a real CPU Inductor kernel and the expected recompilation-limit exception. Co-authored-by: Codex <[email protected]> Signed-off-by: Yuanyuan Chen <[email protected]> --------- Signed-off-by: Yuanyuan Chen <[email protected]> Co-authored-by: Codex <[email protected]>
cyyever
added a commit
that referenced
this pull request
Oct 31, 2026
* Remove stale ScriptFunction dispatch from Dynamo TorchScript's ScriptFunction was removed from trim, but tracing a wrapped callable still accessed the missing type. Remove that unreachable branch while preserving fullgraph handling for nested torch.compile calls. Test Plan ```sh lintrunner -a ``` Real CUDA TP2 Llama serving fails at the obsolete type lookup without the fix and generates matching text and logprobs for two 8-token prompts with the isolated fix. Tested through the Rust/OpenAI server; no full rebuild or broad Dynamo suite was run. Co-authored-by: Codex <[email protected]> Signed-off-by: Yuanyuan Chen <[email protected]> * Remove stale Windows guard from Inductor header preparation The trim build no longer defines _IS_WINDOWS. CPU Inductor bindings still referenced it while preparing precompiled headers, raising NameError before a kernel could execute. Remove the stale guard for supported non-Windows builds. Test Plan: lintrunner -a passed. With isolated fixed PyTorch modules, the 10 vLLM compilation-policy regressions passed, including a real CPU Inductor kernel and the expected recompilation-limit exception. Co-authored-by: Codex <[email protected]> Signed-off-by: Yuanyuan Chen <[email protected]> --------- Signed-off-by: Yuanyuan Chen <[email protected]> Co-authored-by: Codex <[email protected]>
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
BC-breaking?
Summary (human written only)
Agent details (AI-generated)
Dynamo's wrapper-call path still checks
torch.jit.ScriptFunction, which no longer exists in trim. Calling a cached helper from a compiled Llama forward raisesInternalTorchDynamoError: AttributeErrorbefore execution.Remove the obsolete type check while preserving the special handling of nested torch.compile calls and their fullgraph semantics. Inductor's CPU binding path also still references the deleted
_IS_WINDOWSconstant when preparing precompiled headers; remove that stale guard for the supported non-Windows builds. This does not restore TorchScript or suppress compiler failures.Validation: the unmodified package fails during real TP2 Llama server compilation at this lookup. With this isolated Python-only fix, the same CUDA server starts and two prompts produce 16 greedy tokens, with matching text and logprobs across the vLLM loader and compilation-policy comparisons. This uses actual RTX PRO 5000 hardware and the Rust/OpenAI entry point; no mock engine or GPU.
Using isolated copies of both fixed Python modules, all 10 vLLM compilation-policy regressions pass, including real CPU Inductor kernel compilation followed by the expected recompilation-limit exception. The unfixed package fails at
_IS_WINDOWSbefore the initial CPU kernel can run.lintrunner -aruns using the existing PyTorch virtual environment. No full PyTorch rebuild or broad Dynamo suite was run. AI assistance was used. This is a fork compatibility fix, not an upstream TorchScript deprecation proposal.