Skip to content

Enable GLM-5.2 DSpark on ROCm - #31260

Draft
tanth47 wants to merge 8 commits into
sgl-project:mainfrom
tanth47:codex/glm52-dspark-rocm-dsa-stability-clean
Draft

tanth47 wants to merge 8 commits into
sgl-project:mainfrom
tanth47:codex/glm52-dspark-rocm-dsa-stability-clean

Conversation

@tanth47

@tanth47 tanth47 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Stacked on #31047.

What this adds

  • Register the generic DSparkDraftModel entry point.
  • Honor explicit target-layer IDs from the draft checkpoint instead of treating them as draft-layer indices.
  • Keep the CUDA-only DSA top-k v2 path disabled on HIP.
  • Route GLM DSpark target verification through the HIP ragged top-k path.
  • Build target-verify DSA metadata from extended KV lengths, with one page-table row per request.
  • Fall back to PyTorch top-k/top-p renormalization when the ROCm sgl-kernel wheel does not provide those ops.

The DSA changes are needed because one request contributes multiple verify tokens. Its Q/K ranges must advance through the extended KV region rather than reuse prefix-only offsets.

Scope

This PR is the ROCm functionality/correctness slice. CUDA graph coverage, SPS/STS, overlap scheduling, and performance tuning stay out of scope.

MI350 validation

End-to-end TP4 validation head: 5108141f3

  • Focused ROCm suite on final head 5229d7d0d: 27 passed, plus 22 kernel-parity subtests.
  • TP4 compact verify, fixed-seed UltraChat: 256/256 requests, OSL 128 with ignore_eos, AR 59.62%, AL 5.174.
  • TP4 non-greedy verify: 16/16 requests at temperature=0.8, top_p=0.95, all returned 128 tokens.
  • TP4 static verify: 16/16 requests, all returned 128 tokens.

Target: zai-org/GLM-5.2-FP8 (ba978f7d...)
Draft: RedHatAI/GLM-5.2-speculator.dspark (a278cc09...)
Image: lmsysorg/sglang:v0.5.15.post1-rocm720-mi35x

The current checkpoint is distribution-sensitive, so this is not a workload-independent speedup claim. The goal here is to make the runtime contract correct and let future GLM speculators plug into the same path.


CI States

Latest PR Test (Base): ❌ Run #30155865578
Latest PR Test (Extra): ❌ Run #30155865593

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@tanth47
tanth47 force-pushed the codex/glm52-dspark-rocm-dsa-stability-clean branch from 732323b to 5108141 Compare July 25, 2026 11:02
@tanth47 tanth47 changed the title Stabilize GLM DSA config on ROCm Enable GLM-5.2 DSpark on ROCm Jul 25, 2026
@tanth47
tanth47 force-pushed the codex/glm52-dspark-rocm-dsa-stability-clean branch from 5108141 to 5229d7d Compare July 25, 2026 11:13
tanguofu pushed a commit to tanguofu/sglang that referenced this pull request Jul 31, 2026
…on HIP

PR sgl-project#31260 routes HIP target-verify through _get_topk_ragged, but the
assert at line 1147 still required extend_seq_lens_cpu != None.
target-verify batches don't populate extend_seq_lens_cpu, so the assert
fired on every DSpark target-verify forward. Relax the assert to only
require seq_lens_cpu (which target-verify does populate); the downstream
code uses indexer_seq_lens_cpu from metadata, not extend_seq_lens_cpu.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant