[ROCm] Add DeepSeek-V4 DSpark speculative decoding support for AMD GPU(MI350X / MI355X, gfx950) - #31026
[ROCm] Add DeepSeek-V4 DSpark speculative decoding support for AMD GPU(MI350X / MI355X, gfx950)#31026haic0 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces 'DSpark', a new speculative decoding implementation for DeepSeek-V4 models, including support for ragged verification, online SPS profiling, and various performance-optimized kernels. My review identified two critical performance and safety issues: a synchronous device-to-host transfer bottleneck in the attention backend and an out-of-bounds memory access risk in the Triton kernel for ROCm/AMD environments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
113b85d to
5ea03b2
Compare
Use the active DSpark draft token count when building DeepSeek V4 HIP target-verify metadata and prepare KV injection inputs before the target prefill forward.
Stage prefill length tensors in pinned CPU memory before non-blocking device transfer to avoid extra synchronization in the DSpark prefill path.
5ffa401 to
1484632
Compare
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Summary
This PR is now a small follow-up on top of the DSpark implementation that already landed in
mainvia #30261. It keeps the ROCm/AMD DeepSeek V4 DSpark fixes that were still missing after rebasing the branch onto currentmain.extend_lens/prefix_lensthrough pinned CPU tensors before non-blocking transfer to the AMD GPU device, avoiding extra synchronization in the prefill path.The earlier large DSpark implementation commit was dropped from this PR because the equivalent newer implementation is already present on
main.Test plan
python3 -m compileall -q python/sglang/srt/layers/attention/deepseek_v4_backend_hip_radix.py python/sglang/srt/speculative/dspark_components/dspark_worker_v2.pysglang-rocm-v0514with AMD MI350X/ROCm./healthreadiness.Reproduce
DSpark Enabled
Baseline
Benchmark Command
DSpark Results
Baseline Results
CI States
Latest PR Test (Base): ❌ Run #29302344043
Latest PR Test (Extra): ❌ Run #29302343884