[Model Runner V2] support qwen35 / mamba hybrid model - #35520
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for Qwen3.5/Mamba hybrid models to the Model Runner V2. The changes are extensive, touching configuration, KV cache management, attention utilities, and model state handling to accommodate the hybrid nature of these models. The implementation correctly introduces new logic for Mamba's state caching and integrates it with the existing attention mechanism. One area for improvement is a potential performance bottleneck in the metadata preparation for hybrid models, which I've commented on.
|
This pull request has merge conflicts that must be resolved before it can be |
079277d to
bb1f347
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
bb1f347 to
4a916eb
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
4a916eb to
f39b583
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
|
Hi @izhuhaoran, sorry for the delay in the review. Can you please rebase your PR given that we had major updates? |
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: zhuhaoran <zhuhaoran.zhr@alibaba-inc.com>
Head branch was pushed to by a user without write access
|
@WoosukKwon The current CI failures appear unrelated to this PR. I reproduced the two failing tests on top of main, and they fail there as well. Could you please help manually merge this PR? |
…5520) Signed-off-by: zhuhaoran <zhuhaoran.zhr@alibaba-inc.com> Signed-off-by: alexagriffith <agriffith96@gmail.com>
…5520) Signed-off-by: zhuhaoran <zhuhaoran.zhr@alibaba-inc.com> Signed-off-by: Libin Tang <libin.tang@intel.com>
…5520) Signed-off-by: zhuhaoran <zhuhaoran.zhr@alibaba-inc.com>
### What this PR does / why we need it? 1. fix vllm-project/vllm#33322 overwrite `gpu_modelrunner.sync_and_gather_intermediate_tensors`, for the sceniro `pp+sp+tp`, skip scatter the residual for ascend 2. vllm-project/vllm#35520 Adapted to the modifications of `ModelRunner v2` for hybrid attn in interface level, . Todo: Added support for Mamba in ModelRunner in Ascend. any pull_request is welcome 3. vllm-project/vllm#40711 4. vllm-project/vllm#42121 5. vllm-project/vllm#41706 6. vllm-project/vllm#39917 Disable `async_schedule` when `enable_return_routed_experts=True` 7. vllm-project/vllm#41046 8. vllm-project/vllm#41055 9. vllm-project/vllm#41035 10. vllm-project/vllm#42434 ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? - vLLM version: v0.20.1 - vLLM main: vllm-project/vllm@c7aa186 --------- Signed-off-by: wangli <wangli858794774@gmail.com>
### What this PR does / why we need it? 1. fix vllm-project/vllm#33322 overwrite `gpu_modelrunner.sync_and_gather_intermediate_tensors`, for the sceniro `pp+sp+tp`, skip scatter the residual for ascend 2. vllm-project/vllm#35520 Adapted to the modifications of `ModelRunner v2` for hybrid attn in interface level, . Todo: Added support for Mamba in ModelRunner in Ascend. any pull_request is welcome 3. vllm-project/vllm#40711 4. vllm-project/vllm#42121 5. vllm-project/vllm#41706 6. vllm-project/vllm#39917 Disable `async_schedule` when `enable_return_routed_experts=True` 7. vllm-project/vllm#41046 8. vllm-project/vllm#41055 9. vllm-project/vllm#41035 10. vllm-project/vllm#42434 ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? - vLLM version: v0.20.1 - vLLM main: vllm-project/vllm@c7aa186 --------- Signed-off-by: wangli <wangli858794774@gmail.com>
### What this PR does / why we need it? 1. fix vllm-project/vllm#33322 overwrite `gpu_modelrunner.sync_and_gather_intermediate_tensors`, for the sceniro `pp+sp+tp`, skip scatter the residual for ascend 2. vllm-project/vllm#35520 Adapted to the modifications of `ModelRunner v2` for hybrid attn in interface level, . Todo: Added support for Mamba in ModelRunner in Ascend. any pull_request is welcome 3. vllm-project/vllm#40711 4. vllm-project/vllm#42121 5. vllm-project/vllm#41706 6. vllm-project/vllm#39917 Disable `async_schedule` when `enable_return_routed_experts=True` 7. vllm-project/vllm#41046 8. vllm-project/vllm#41055 9. vllm-project/vllm#41035 10. vllm-project/vllm#42434 ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? - vLLM version: v0.20.1 - vLLM main: vllm-project/vllm@c7aa186 --------- Signed-off-by: wangli <wangli858794774@gmail.com> Signed-off-by: 李少鹏 <lishaopeng21@huawei.com>
…5520) Signed-off-by: zhuhaoran <zhuhaoran.zhr@alibaba-inc.com>
…5520) Signed-off-by: zhuhaoran <zhuhaoran.zhr@alibaba-inc.com>
…5520) Signed-off-by: zhuhaoran <zhuhaoran.zhr@alibaba-inc.com> Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
…5520) Signed-off-by: zhuhaoran <zhuhaoran.zhr@alibaba-inc.com>
### What this PR does / why we need it? 1. fix vllm-project/vllm#33322 overwrite `gpu_modelrunner.sync_and_gather_intermediate_tensors`, for the sceniro `pp+sp+tp`, skip scatter the residual for ascend 2. vllm-project/vllm#35520 Adapted to the modifications of `ModelRunner v2` for hybrid attn in interface level, . Todo: Added support for Mamba in ModelRunner in Ascend. any pull_request is welcome 3. vllm-project/vllm#40711 4. vllm-project/vllm#42121 5. vllm-project/vllm#41706 6. vllm-project/vllm#39917 Disable `async_schedule` when `enable_return_routed_experts=True` 7. vllm-project/vllm#41046 8. vllm-project/vllm#41055 9. vllm-project/vllm#41035 10. vllm-project/vllm#42434 ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? - vLLM version: v0.20.1 - vLLM main: vllm-project/vllm@c7aa186 --------- Signed-off-by: wangli <wangli858794774@gmail.com>
Purpose
As titled, this pr support qwen3.5 model for model runner v2.
Test
Qwen3.5-35B-A3B-FP8, mtp with num_speculative_tokens = 2
NVIDIA H20 GPUs, TP=2
bence serve
bench args: --dataset-name spec_bench --spec-bench-output-len 1024 --max-concurrency 32 --num-prompts 512
lm_eval
lm_eval --model local-completions --tasks gsm8k --batch_size 128 --model_args model=Qwen/Qwen3.5-35B-A3B-FP8,base_url=http://localhost:8000/v1/completions,max_retries=3