[Model] Support Qwen3.8-Flash-Next - #53896
Conversation
Co-authored-by: zjy0516 <riverclouds.zhu@qq.com> Co-authored-by: KungYork <firelikest@163.com> Co-authored-by: Thien Tran <gau.nernst@yahoo.com.sg> Co-authored-by: Jiangyun Zhu <riverclouds.zhu@qq.com> Co-authored-by: Yifan Qiao <yifanqiao@inferact.ai> Co-authored-by: andyluo7 <43718156+andyluo7@users.noreply.github.com> Co-authored-by: Isotr0py <mozf@inferact.ai> Assisted-by: OpenAI Codex Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
|
/ci run |
|
✅ Triggered Buildkite CI #85734 for commit |
|
While bringing this up on gfx942 we hit an out-of-bounds read that traces back to
Suggestion: let the spec declare its own mode (e.g. a One caveat if you take this: |
|
Two things, both aimed at the "which configurations work" table @vadiklyutiy asked for. 1. The AMD
|
| Hardware | 8× MI325X (gfx942), ROCm 7.2.3 |
| Parallelism | TP8 with --enable-expert-parallel |
| Context | --max-model-len 262144 |
| Speculative | MTP, num_speculative_tokens=3, acceptance length 3.32 |
| Throughput | 152 tok/s single stream; 676 tok/s aggregate at 8-way concurrency |
| Correctness | needle-in-haystack to 250k 3/3; zh-TW output, reasoning_content, qwen3_coder tool parsing all correct |
One constraint worth putting in the table because it is arithmetic, not a bug:
pure tensor parallelism is not valid for this checkpoint. moe_intermediate_size = 640 = 5×128
and the FP8 weight_block_size is [128, 128], so TP2/4/8 give 320/160/80 per rank, none of which
is a multiple of 128. Expert parallelism is required. (The shared expert is in
modules_to_not_convert, i.e. BF16, so it is not subject to this.)
Getting there needed three ROCm-side fixes beyond the PLE one — the spec-decode metadata allowlist,
an aiter JIT race, and a slot-mapping out-of-bounds read (#53982; the model-side half of that one
is in a separate comment on this PR). Filed separately so they don't clutter this thread.
Reproduction
Serve Qwen/Qwen3.8-Flash-Next-FP8 on an AMD GPU (so the amd/ module tree is selected).
Startup fails on ngram_embedding.weight_scale having no corresponding parameter. (We have not
run the nvidia/ tree; it is the one that defines the FP8 embedding method.)
What we verified / did not verify
- Verified: the symbol asymmetry between the two
ple_layer.pyfiles in this PR; the load
failure and that both remedies clear it; all numbers in the table. - Not verified: the native-FP8 port under long-running production load — we validated it
structurally (anchors, dry-run line count, idempotency, AST) but are currently serving the
dequantize-at-load variant. - Not verified: any non-FP8 checkpoint on gfx942.
| csa_config = _get_kv_cache_config_csa_linear( | ||
| vllm_config, | ||
| kv_cache_groups, | ||
| available_memory, | ||
| kv_layout, | ||
| ) | ||
| if csa_config is not None: | ||
| num_blocks, kv_cache_tensors = csa_config | ||
| else: |
There was a problem hiding this comment.
we should try to avoid such model specific code here if possible; we spent alot of effort flushing out the DSv4 model specific code
There was a problem hiding this comment.
nit: i think we can just make this an MRV2 only model so we dont need to thrash MRV1 so much
|
@jhsmith409 Thanks for your feedback. We will add PLE-offload support for NVFP4 quantization as soon as possible. Once available, you can retry using the NVFP4 checkpoint provided by Inferact. We will also investigate your reported issue and work on a fix. |
|
@vadiklyutiy Thank you for the review. We have updated the PR description with the configurations we tested and validated. We will also address your code suggestions shortly. |
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
|
Following up on #53896 (comment) made a proposal here: peakcrosser7#6 on how we can bring this closer inline with current main. I havent had a change to iterate on |
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
|
@LucasWilkinson Thanks for the review and the PR. I’ll refer to your changes and consider how best to refine the implementation. |
|
/ci run |
|
✅ Triggered Buildkite CI #85763 for commit |
|
/ci run |
|
✅ Triggered Buildkite CI #85764 for commit |
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
|
On the ROCm path ( That kernel is not batch-invariant, and the reason is concrete — the split-K reduction depth is a base_programs = q.shape[0] * k_cache.shape[2] # q.shape[0] = query rows in this batch
small_profile_limit = 8 if block_m <= 8 else 4
if base_programs <= small_profile_limit: block_n, target_splits, partial_warps = 16, 64, 4
elif base_programs < 32: block_n, target_splits, partial_warps = 16, 32, 4
elif base_programs <= 256: block_n, target_splits, partial_warps = 64, 8, 2
elif base_programs <= 512: block_n, target_splits, partial_warps = 64, 4, 2
else: block_n, target_splits, partial_warps = 64, 1, 2
...
num_splits = min(max_useful_splits, target_splits)
Why this is currently latent, and why it will not stay that wayOn this model the flag cannot be reached today: if envs.VLLM_BATCH_INVARIANT and not mamba_attn_backend.supports_batch_invariance():
raise RuntimeError(
f"VLLM batch_invariant mode is not supported for {mamba_attn_backend.get_name()}.")So the incorrect claim is masked by an unrelated guard. The moment mamba/GDN gains batch-invariance Suggestions
Option 1 is the correct default: declaring |
|
@zzw09773 Thank you very much for your review and suggestions. ROCm support in the current PR is not yet complete, and we will address the remaining gaps as soon as possible. |
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
|
Build break on sm_80, one hunk. In csrc/libtorch_stable/ops.h, fused_gdn_decode_post_conv_mtp is declared under VLLM_ENABLE_FUSED_KDA_DECODE but used under VLLM_ENABLE_FUSED_GDN_DECODE. On sm_90+ both macros are set so nothing shows. On sm_80 only the GDN macro is set and the build fails with "not declared in this scope". Giving the function its own VLLM_ENABLE_FUSED_GDN_DECODE guard fixes it. Tested on 5x CMP 170HX (sm_80), pipeline parallel 5, with PR #53899 at f561eca. Three more small patches were needed for PP5, all in model code:
With those, plain PP5 serving works. MTP with PP does not: boot dies with a CUDA illegal memory access in the target model once speculative decoding makes decode query_len 3, on an intermediate pipeline rank, in both the V2 generic speculator and the V1 dedicated proposer paths. This is consistent with the recipe supporting only single-node TP or TEP, but worth knowing PP+MTP fails at runtime rather than at config time. |
|
/ci run |
|
✅ Triggered Buildkite CI #85787 for commit |
Purpose
support https://huggingface.co/Qwen/Qwen3.8-Flash-Next
How to run
Enable PLE offload(note PLE offload support is in #53899)
Validation
Without offload:
With N-gram embedding offload:
The validation results were provided by Inferact. See the vLLM recipe for details.
Note: This PR is being updated with the latest changes from
mainand may be unstable during review. Please use PR #53899 for builds in the meantime.Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.BEFORE SUBMITTING, PLEASE READ https://docs.vllm.ai/en/latest/contributing (anything written below this line will be removed by GitHub Actions)