Skip to content

[Model] Add Qwen3.5 hybrid model support#34131

Closed
liuchenbing2026 wants to merge 1 commit intovllm-project:mainfrom
liuchenbing2026:vllm_qwen3.5_add
Closed

[Model] Add Qwen3.5 hybrid model support#34131
liuchenbing2026 wants to merge 1 commit intovllm-project:mainfrom
liuchenbing2026:vllm_qwen3.5_add

Conversation

@liuchenbing2026
Copy link

@liuchenbing2026 liuchenbing2026 commented Feb 9, 2026

Add inference support for the Qwen3.5 hybrid architecture model, which interleaves full attention (transformer) and linear attention (Gated Delta Net) layers with dense MLP.

New files:

  • vllm/transformers_utils/configs/qwen3_5.py: Qwen3_5TextConfig with head_dim=256, partial_rotary_factor=0.25, and hybrid layer_types
  • vllm/model_executor/models/qwen3_5.py: Full model implementation including Qwen3_5GatedDeltaNet with separate input projections (in_proj_qkv, in_proj_z, in_proj_b, in_proj_a), dense MLP (no MoE), hybrid decoder layer, custom op registration, and weight loading with multimodal (language_model prefix) support

Modified files:

  • Register Qwen3_5TextConfig in config registry (model_type: qwen3_5_text)
  • Register Qwen3_5ForCausalLM in model registry

Purpose

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@mergify mergify bot added new-model Requests to new models qwen Related to Qwen models labels Feb 9, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for the Qwen3.5 hybrid model architecture. The implementation is well-structured, reusing components from Qwen3-Next where appropriate and adding new modules like Qwen3_5GatedDeltaNet for the model's specific characteristics. The changes include the model definition, its configuration, and registration within the vLLM framework. The code largely follows existing patterns, but I've identified one issue with an incorrect type hint that should be addressed for correctness and consistency.

Comment on lines +972 to +974
def get_mamba_state_shape_from_config(
cls, vllm_config: "VllmConfig"
) -> tuple[tuple[int, int], tuple[int, int]]:
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The return type hint for get_mamba_state_shape_from_config is incorrect. It is specified as tuple[tuple[int, int], tuple[int, int]], but the MambaStateShapeCalculator.gated_delta_net_state_shape function it calls returns a tuple where the second element is a 3-tuple (num_heads, head_v_dim, head_k_dim). The correct return type should be tuple[tuple[int, int], tuple[int, int, int]] to match the actual returned value and the base class IsHybrid.

Suggested change
def get_mamba_state_shape_from_config(
cls, vllm_config: "VllmConfig"
) -> tuple[tuple[int, int], tuple[int, int]]:
def get_mamba_state_shape_from_config(
cls, vllm_config: "VllmConfig"
) -> tuple[tuple[int, int], tuple[int, int, int]]:

@DarkLight1337
Copy link
Member

We already have another open PR for this: #34110

Add inference support for the Qwen3.5 hybrid architecture model.

New files:
- vllm/transformers_utils/configs/qwen3_5.py
- vllm/model_executor/models/qwen3_5.py

Modified files:
- Register Qwen3_5TextConfig in config registry
- Register Qwen3_5ForCausalLM in model registry
@mergify
Copy link

mergify bot commented Feb 9, 2026

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @liuchen2026fly.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Feb 9, 2026
@DarkLight1337
Copy link
Member

Closing as superseded by #34110

yzh119 pushed a commit to flashinfer-ai/flashinfer that referenced this pull request Feb 16, 2026
<!-- .github/pull_request_template.md -->

## 📌 Description
Add test case for Qwen3N, and Qwen3.5 according to
vllm-project/vllm#34131
<!-- What does this PR do? Briefly describe the changes and why they’re
needed. -->

## 🔍 Related Issues

<!-- Link any related issues here -->

## 🚀 Pull Request Checklist

Thank you for contributing to FlashInfer! Before we review your pull
request, please make sure the following items are complete.

### ✅ Pre-commit Checks

- [x] I have installed `pre-commit` by running `pip install pre-commit`
(or used your preferred method).
- [x] I have installed the hooks with `pre-commit install`.
- [x] I have run the hooks manually with `pre-commit run --all-files`
and fixed any reported issues.

> If you are unsure about how to set up `pre-commit`, see [the
pre-commit documentation](https://pre-commit.com/).

## 🧪 Tests

- [x] Tests have been added or updated as needed.
- [ ] All tests are passing (`unittest`, etc.).

## Reviewer Notes

<!-- Optional: anything you'd like reviewers to focus on, concerns, etc.
-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Expanded test coverage by adding additional head-configuration cases
across multiple test scenarios to improve reliability and catch more
edge cases.
* No changes to test logic or public interfaces; only parameterized
inputs were extended.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase new-model Requests to new models qwen Related to Qwen models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants