Fix Qwen3.5 GDN multi-item scoring - #33922
Conversation
| delimiter_indices = forward_batch.multi_item_delimiter_indices | ||
| if delimiter_indices is None or len(delimiter_indices) != len(seq_lens): | ||
| raise ValueError("GDN MIS requires delimiter indices for every request") | ||
| if sum(seq_lens) != forward_batch.input_ids.numel(): |
There was a problem hiding this comment.
Please account for token padding here.
In DP-attention / attention-TP padding case may fail. DP-attention / attention-TP may pad forward_batch.input_ids via _pad_inputs_to_size() without extending extend_seq_lens_cpu, input_ids.numel() can legitimately exceed sum(seq_lens), causing valid MIS requests to fail with this ValueError.
There was a problem hiding this comment.
Thanks for catching this. Fixed in 29af803.
The metadata validation now allows trailing DP-attention / attention-TP padding while still rejecting logical sequence lengths that exceed the input tensor. I also zero-initialize the output so padded positions cannot contain uninitialized values.
Added CPU regression coverage for both boundaries and verified the full Triton GDN backend suite on H20 (11/11 passed).
|
/tag-and-rerun-ci |
|
/rerun-failed-ci |
|
/rerun-failed-ci |
|
/rerun-failed-ci |
|
@nvpohanh The GDN/CPU tests are now passing after the latest fix. The remaining failures appear platform-specific: NPU performance baseline, invalid B300 model path, AMD HIPBLAS/IPC timeouts, and missing CPU kernel ops on Arm/Xeon. Could the corresponding platform owners help confirm whether these are infrastructure/baseline issues? |
|
/rerun-failed-ci |
# Conflicts: # python/sglang/srt/server_args.py
|
@daii-0818 please fix the lint issue. thanks |
|
/rerun-failed-ci |
|
Hi @yuan-luo, your token-padding feedback has been addressed, and the relevant NVIDIA CI suites are passing. The remaining failures appear to be infrastructure-related. Could you please review the latest changes and merge the PR if everything looks good? Thanks! |
|
All NV pipelines have passed. |
|
@yuan-luo could you review this? Thanks! |
# Conflicts: # python/sglang/kernels/ops/attention/fla/chunk_delta_h.py
|
/rerun-tests test/registered/e2e/gdn/test_qwen35_gdn_multi_item_scoring.py |
|
Results for 🚀 |
|
/rerun-failed-ci |
Motivation
Qwen3.5 hybrid models use recurrent GDN layers alongside full-attention layers. Multi-item scoring already gives the full-attention layers an item-branching mask, but the GDN prefill path previously processed the packed suffix as one continuous recurrent sequence. As a result, later items could inherit convolution and SSM state from earlier items.
Fixes #31969.
Modifications
Reproduction
Accuracy Tests
Tested on one NVIDIA H20 with
Qwen/Qwen3.5-4Bin BF16, FlashInfer full attention, and Triton linear-attention prefill.atol=2e-2, rtol=2e-2.Speed Tests and Profiling
Single H20,
Qwen/Qwen3.5-4B, query length 120, item length 180, 10 items per request, 10 warmup requests, followed by three 60-second runs. CUDA graph, radix cache, and chunked prefill were disabled in both modes.This is an 18.84% throughput increase, with P50 latency reduced by 16.04% and P99 latency reduced by 14.36%.
Checklist
Review and Merge Process
CI States
Latest PR Test (Base): ⏳ Run #34441014344
Latest PR Test (Extra): ❌ Run #34441014096
Latest PR Test (AMD ROCm 10): ⏳ Run #34441014287