Repository navigation
[Rebase] Add Qwen3.8 & Qwen3.5 support and evaluation guide on qwen4_v0.5.21 - #54
Conversation
The transport resolution moved from ServerArgs._handle_multimodal_feature_transport to arg_groups/serving_hook.handle_multimodal_feature_transport. Accept cuda_ipc on CUDA or HIP there. Tests use override_platform instead of patching server_args. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01KVPUFiK2bhzjErEnCMv26w (cherry picked from commit 7453337)
PR sgl-project#33747 opens the multimodal IPC gate on HIP, but the pool lifecycle introduced by sgl-project#33949 still calls the NVIDIA CUDA driver. Dispatch the ROCm ready/wait/ack words through small Triton kernels with system-scope acquire/release atomics. Keep the NVIDIA path unchanged. Native HIP stream wait crashed on peer IPC mappings in the tested ROCm build; the GPU kernel path preserves copy ordering and lease safety. Correct the inherited gate comment to describe this additional backend requirement and register IPC coverage for AMD.
Signed-off-by: Xiake Sun <[email protected]>
Signed-off-by: Xiake Sun <[email protected]>
Signed-off-by: Xiake Sun <[email protected]>
qwen4_v0.5.21qwen4_v0.5.21
Signed-off-by: Xiake Sun <[email protected]>
4cb9630 to
722dfb7
Compare
Signed-off-by: Xiake Sun <[email protected]>
Signed-off-by: Xiake Sun <[email protected]>
…processing The self-referencing PLE shard loader forms a closure cycle that retains params_dict after weight loading. When FP8 postprocessing (fp8e4m3->fp8e4m3nuz) replaces the parameters, the dictionary keeps their original GPU storage alive until cyclic GC runs, causing Qwen3.8 BF16-PLE TP2 launches OOM. Clear params_dict before returning so obsolete weight storage can be released during postprocessing. Preserve PLE GPU residency, weight precision, and existing quantization behavior. Signed-off-by: Xiake Sun <[email protected]>
Signed-off-by: Xiake Sun <[email protected]>
| absmax = torch.clamp(absmax, min=eps) | ||
| scale_val = absmax / fp8_max | ||
| scale.copy_(scale_val) | ||
| scale[:M].copy_(scale_val) |
There was a problem hiding this comment.
Where did changes in this file python/sglang/kernels/ops/quantization/fp8_kernel.pycome from?
There was a problem hiding this comment.
This padding fix from 8ead45e does not backport from upstream or previous fork repo.
It added as initial support Qwen3.5 model to allow padded FP8 linear operations to work when SGLANG_USE_AITER=0 on ROCm.
Qwen3.5 GatedDeltaNet input projection: in_proj_qkvz
→ compressed-tensors FP8 linear
→ apply_fp8_linear()
→ scaled_fp8_quant(num_token_padding=17) -> fix padding issue here
→ native PyTorch per-token quantization
→ FP8 matrix multiplication
apply_fp8_linear() (python/sglang/srt/layers/quantization/fp8_utils.py:2078) pads small input batches to 17 rows because the existing code expects better torch._scaled_mm performance above 16 rows. This padding is independent of CUDA graph capture.
With SGLANG_USE_AITER=0, the quantization helper receives, for example, 2 live input rows and a 17-row output buffer. This fix makes that copy valid and initializes the remaining rows.
This code path in python/sglang/kernels/ops/quantization/fp8_kernel.py with _native prefix will not invoke if ``SGLANG_USE_AITER=1`, We can preserve it as a debug fallback if needed.
Motivation
This PR aim to address #50 to enable Qwen3.5 & Qwen3.8 functional support on
qwen4_v0.5.21Modifications
Accuracy Tests
Speed Tests and Profiling
1. Qwen3.8-next-flash target model only, TP2, disable radix cache
./launch_qwen38_flash_next_fp8_mi308x_pure_tp_4_or_8_or_2.sh
./run_qwen38_pure_text_bench.sh
./run_gsm8k.sh
2. Qwen3.8-next-flash + MTP, TP=2, disable radix cache
./launch_qwen38_flash_next_fp8_mi308x_pure_tp_4_or_8_or_2.sh
./run_qwen38_pure_text_bench.sh
./run_gsm8k.sh
3. Qwen3.5 397B target model only TP8, disable radix cache
./launch_qwen3.5-397B-fp8_tp8_disable_prefix_cache.sh
./run_qwen35_pure_text_bench.sh
./run_gsm8k.sh
4. Qwen3.5 397B target +dflash TP8, enable radix cache
./launch_qwen3.5-397B-fp8_tp8_dflash_with_prefix_cache.sh
./run_qwen35_pure_text_bench.sh
./run_gsm8k.sh
5. Qwen3.5 35B target model only TP4, disable radix cache
./launch_qwen3.5-35B-fp8_tp4_disable_prefix_cache.sh
./run_qwen35_pure_text_bench.sh
./run_gsm8k.sh
6. Qwen3.5 35B target +dflash TP1, enable radix cache
./launch_qwen3.5-35B-fp8_tp1_dflash_with_prefix_cache_mfs0.7_bs32.sh
./run_qwen35_pure_text_bench.sh
./run_gsm8k.sh
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci