Skip to content

[Bugfix][CI] Fix depyf compatibility with PyTorch 2.14 - #64803

Closed
yzong-rh wants to merge 1 commit into
vllm-project:mainfrom
yzong-rh:yzong-rh/patched_load_by_key_path
Closed

yzong-rh wants to merge 1 commit into
vllm-project:mainfrom
yzong-rh:yzong-rh/patched_load_by_key_path

Conversation

@yzong-rh

@yzong-rh yzong-rh commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Fix compile/fullgraph/test_full_graph.py::test_custom_compile_config[compilation_config3-facebook/opt-125m-model_kwargs3] in CI. E.g. main-branch Buildkite run #98732.

Failure was exposed by the automatic fullgraph sharding PR #64635.

Before sharding, the test shared a cache with another test that created an AOT artifact. After sharding, it could run alone with a cold cache and expose a pre-existing depyf/PyTorch 2.14 incompatibility.

Claims

  • The cold-cache test no longer fails with patched_load_by_key_path() got an unexpected keyword argument 'set_sys_modules'.
  • The long-term fix belongs upstream in depyf; this is a vLLM compatibility shim until that fix is released.

Validation

aot_cache=$(mktemp -d /tmp/vllm-aot-repro.XXXXXX)
VLLM_CACHE_ROOT="$aot_cache" \
VLLM_USE_AOT_COMPILE=1 \
VLLM_DISABLE_COMPILE_CACHE=0 \
pytest -s -v \
  'compile/fullgraph/test_full_graph.py::test_full_graph[facebook/opt-125m-model_kwargs0-3]' \
  'compile/fullgraph/test_full_graph.py::test_custom_compile_config[compilation_config3-facebook/opt-125m-model_kwargs3]'

Pass on both main and this PR because test_full_graph[facebook/opt-125m-model_kwargs0-3] created an AOT artifact in the shared cache before test_custom_compile_config[compilation_config3-facebook/opt-125m-model_kwargs3] ran.

repro_cache=$(mktemp -d /tmp/vllm-repro.XXXXXX)
VLLM_CACHE_ROOT="$repro_cache" \
VLLM_USE_AOT_COMPILE=1 \
VLLM_DISABLE_COMPILE_CACHE=0 \
pytest -s -v \
  'compile/fullgraph/test_full_graph.py::test_custom_compile_config[compilation_config3-facebook/opt-125m-model_kwargs3]'

Fails on main with torch._inductor.exc.InductorError: RuntimeError: Failed to run autotuning code block: patched_load_by_key_path() got an unexpected keyword argument 'set_sys_modules'. Passes on this branch.

Details

depyf==0.20.0 patches Torch Inductor's PyCodeCache.load_by_key_path but does not accept PyTorch 2.14's new set_sys_modules keyword. The compatibility shim adds the keyword to the patched wrapper and forwards it to Torch's original loader while preserving depyf's source dumping.

The cleanest permanent fix is to update depyf's wrapper and then bump vLLM's depyf dependency and remove the shim.


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

Signed-off-by: Yifan Zong <yzong@redhat.com>
@mergify mergify Bot added bug Something isn't working torch.compile labels Oct 30, 2026
@yzong-rh
yzong-rh marked this pull request as ready for review October 30, 2026 19:42

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@yzong-rh

Copy link
Copy Markdown
Contributor Author

Duplicate of #60873. Agent somehow didn't find it, sorry!

@yzong-rh yzong-rh closed this Oct 30, 2026
@github-project-automation github-project-automation Bot moved this from To triage to Done in torch.compile integration Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working torch.compile

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant