-
Notifications
You must be signed in to change notification settings - Fork 637
[BugFix][main] Adapted Qwen3-Next-MTP to chunked prefill #4770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: drslark <[email protected]>
There was a problem hiding this 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 adapts the Qwen3-Next-MTP model for chunked prefill, primarily by adding a fallback implementation for causal convolution and enabling the corresponding tests. The changes also include patches to work around limitations in torch_npu and vLLM's utility functions.
My review focuses on the maintainability and risks associated with these workarounds. While the changes appear to be functional for the immediate goal, they introduce significant technical debt:
- A large block of code for causal convolution has been duplicated from upstream, which will be difficult to maintain.
- Two separate monkey patches are introduced for
bind_kv_cacheandtorch.argsort. These are risky and can lead to future breakages.
I've added comments with high severity for these issues, recommending the creation of tracking issues to address the underlying problems and eventually remove these temporary solutions. These measures are crucial for the long-term health of the codebase.
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. |
| from vllm.v1.worker.utils import defaultdict, extract_layer_index | ||
|
|
||
|
|
||
| # Discussed with @MengqingCao, we can patch just for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove Discussed with @MengqingCao
| ACL_FORMAT = ACL_FORMAT_FRACTAL_ND | ||
|
|
||
|
|
||
| # Discussed with @zzzzwwjj, we can patch argsort just for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to patch module
| @@ -0,0 +1,52 @@ | |||
| import torch | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to patch_qwen3_next
What this PR does / why we need it?
The pad
-1modification is from vllm-project/vllm#25743.It still has bugs for batched chunked prefill.
So, we just let e2e to be right.
Outputs:
Does this PR introduce any user-facing change?
N/A
How was this patch tested?