Repository navigation
[Model][Spec Decode] Migrate HY V3 to the Flat Model layout - #61987
Open
AlejandroParedesLT wants to merge 1 commit into
Open
AlejandroParedesLT wants to merge 1 commit into
AlejandroParedesLT wants to merge 1 commit into
Conversation
Moves vllm/model_executor/models/hy_v3.py and hy_v3_mtp.py to
vllm/models/hy_v3/common/{model,mtp}.py per RFC vllm-project#44219, repointing the
HYV3ForCausalLM and HYV3MTPModel registry entries.
Medusa was the first candidate for this migration (vllm-project#61357) but Medusa was
removed from vLLM entirely in vllm-project#61701 while that PR was in flight. HY V3 is
the next clean candidate: like Medusa, it has no custom kernels and no
dependency on any other model file (confirmed by grep: hy_v3.py and
hy_v3_mtp.py are the only two files in the codebase that reference each
other), so it needs only a common/ directory. HY V4, by contrast, needed a
real nvidia/amd split (flashmla_sparse, triton_ihc) -- HY V3 predates that
and has zero platform-conditional code.
No logic change. The only diff inside the moved files is fixing imports that
crossed the old package boundary (.utils, .interfaces, and the mtp file's
`from .hy_v3 import HYV3DecoderLayer` -> `from .model import
HYV3DecoderLayer`), verified by diffing old vs. new file content.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S7agbtPNuVe9pxACkqbitP
Signed-off-by: AlejandroParedesLT <alejandroparedeslatorre@gmail.com>
56 tasks
Contributor
Author
|
Hey @WoosukKwon, could you please take a look when you get a chance? Thanks! |
This branch has not been deployed
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.
Overview
Next slice of #61024's "Migrate speculative model code to Flat Model" bullet (RFC #44219). Moves the HY V3 model and its MTP drafter from the legacy
vllm/model_executor/models/layout into the newvllm/models/<name>/<hw>/layout.Claims
vllm/model_executor/models/hy_v3.pyandhy_v3_mtp.pytovllm/models/hy_v3/common/{model,mtp}.py, repointing theHYV3ForCausalLMandHYV3MTPModelregistry entries tovllm.models.hy_v3..utils,.interfaces→vllm.model_executor.models.{utils,interfaces}, and the MTP file'sfrom .hy_v3 import HYV3DecoderLayer→from .model import HYV3DecoderLayer), verified by diffing old vs. new file content.common/directory, nonvidia/amd/cpu/xpusplit: zero custom kernels, and zero platform-conditional code (grep -c "is_rocm\|is_cuda\|sm90\|sm100"→ 0). HY V4 (vllm.models.hy_v4), by contrast, needed a realnvidia/amdsplit forflashmla_sparse/triton_ihc-- V3 predates those optimizations.hy_v3.py/hy_v3_mtp.pyhave zero dependency on any other model file -- confirmed by grep across the whole tree, they're the only two files that reference each other. That made this pair the next candidate after Medusa.Validation
No e2e acceptance-rate test exists for HY V3 under
tests/v1/e2e/spec_decode/acceptance_rates/(unlike Medusa, which had one) and I don't have a validated local checkpoint-loading path for it on this change, so the above is the available coverage.tests/models/registry.pyliststencent/Hy3-previewas the example checkpoint if a reviewer wants to validate a real weight load.Details
Why HY V3 and not another drafter: every remaining legacy drafter (EAGLE/EAGLE3 variants, the other MTP variants, DFlash) imports its base model's decoder-layer class directly from a still-legacy file (
llama,qwen2,qwen3,deepseek_v2, etc.), so migrating any of them means migrating a shared, heavily-reused base model too -- a much bigger, higher-blast-radius change. HY V3 is the one pair with zero such entanglement.Previous attempt: #61357 targeted Medusa as the first migration in this series, but Medusa was removed from vLLM entirely in #61701 while that PR was in flight ("Medusa is not supported by Model Runner V2, and EAGLE/MTP/DFlash/DSpark cover its use case"). Closed #61357 as superseded by that removal rather than resurrect deleted code.
Duplicate-work check: searched open issues/PRs for existing HY V3 Flat Model migration work; found none.
Scope: this PR only moves HY V3 + its MTP drafter. The remaining legacy drafters are out of scope here and need their base model migrated alongside them, which is a larger, separate decision per model family.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (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.
🤖 Generated with Claude Code
https://claude.ai/code/session_01S7agbtPNuVe9pxACkqbitP