Skip to content

Global patch for t.compile high warmup time on MoE models - #1452

Open
tvoas wants to merge 3 commits into
vllm-project:mainfrom
tvoas:universal_warmup_fix
Open

Global patch for t.compile high warmup time on MoE models#1452
tvoas wants to merge 3 commits into
vllm-project:mainfrom
tvoas:universal_warmup_fix

Conversation

@tvoas

@tvoas tvoas commented May 17, 2026

Copy link
Copy Markdown
Contributor

Removes model specific override forward() to initialize residual as zeros instead of None which eliminating torch._dynamo type guards. This is now applied Globally for all applicable MoE models.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Introduces a global “zero residual” forward patch intended to avoid Dynamo recompilations for certain MoE models, and removes model-specific residual overrides/registrations in favor of this centralized approach.

Changes:

  • Install a global model forward patch from HpuModelAdapter to initialize residual tensors as zeros for eligible decoder stacks.
  • Remove Qwen3 MoE and Llama4 per-model “residual=zeros” wrapper classes and associated registration.
  • Simplify Qwen3 MoE module to only keep in-place block upgrade logic.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
vllm_gaudi/v1/worker/hpu_model_runner.py Adds global patch discovery/installation logic and a patched forward implementation with residual=zeros.
vllm_gaudi/models/qwen3_moe.py Removes HPU wrapper model classes; keeps only MoE block upgrade logic and adjusts imports.
vllm_gaudi/models/llama4.py Removes HpuLlama4Model residual override and updates init patch docs accordingly.
vllm_gaudi/models/init.py Removes Qwen3 MoE HPU model registration.

Comment thread vllm_gaudi/models/llama4.py
Comment thread vllm_gaudi/v1/worker/hpu_model_runner.py
Comment thread vllm_gaudi/v1/worker/hpu_model_runner.py
Comment thread vllm_gaudi/v1/worker/hpu_model_runner.py
Comment thread vllm_gaudi/v1/worker/hpu_model_runner.py
Comment thread vllm_gaudi/models/qwen3_moe.py Outdated
Comment thread vllm_gaudi/models/__init__.py
Your Name and others added 2 commits May 26, 2026 15:58
Signed-off-by: Tanner Voas <tanner.voas@intel.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tanner Voas <tanner.voas@intel.com>
@tvoas
tvoas force-pushed the universal_warmup_fix branch from e07d9da to 0f31932 Compare May 26, 2026 07:58
@tvoas
tvoas had a problem deploying to pre-merge-approval May 26, 2026 07:58 — with GitHub Actions Error
@tvoas
tvoas requested a review from Copilot May 26, 2026 08:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Comment thread vllm_gaudi/v1/worker/hpu_model_runner.py Outdated
Comment thread vllm_gaudi/v1/worker/hpu_model_runner.py
Comment thread vllm_gaudi/v1/worker/hpu_model_runner.py
Comment thread vllm_gaudi/models/__init__.py
Comment thread vllm_gaudi/models/llama4.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tanner Voas <tanner.voas@intel.com>
@tvoas
tvoas had a problem deploying to pre-merge-approval May 26, 2026 08:16 — with GitHub Actions Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants