Repository navigation
[Qwen3.8] Cherry pick qsa mtp optimization - #99
Conversation
fe9c8cc to
cfb1002
Compare
* use pyhip qsa prefill kerenl for draft extend * support pyhip indexer for draft_extend_v2 * support cudagraph for draft extend * perf(qsa): reduce MTP draft replay metadata preparation Refresh shared-index proposal metadata for all draft steps in one GPU launch and skip unused compressed-key and ring metadata. Fuse draft-extend layout with full metadata preparation and avoid scalar readbacks in eager metadata builders. Keep the PyHIP decode page-table width within its ABI limit. Add coverage for shared metadata, graph replay, padding, bucket changes, paged attention output, and eager readback removal. * perf(mtp): optimize draft processing and target verification Reuse target prompt embeddings for draft prefill and accelerate the MTP input broadcast add. Use ROCm max selection for topk=1 draft proposals without computing full-vocabulary softmax. Use q/k/v views for ROCm GDN target verification when ReplaySSM buffers are absent. This verification optimization also serves other speculative models; it is grouped with the MTP execution-path changes. Split the MTP and speculative execution changes from fe69548 (add c8 opt). * replace number with qsa graph mode * update zero mm_input_embeds; update tests * update condition of extend_seq_lens_cpu * revert(qsa): restore full MTP replay metadata preparation (cherry picked from commit d0a5b96)
Keep the current 1M bounds, capability-based GDN routing, and fused topk1 paths. Reuse the per-request Eagle embedding shift once and initialize each tail before the draft repairs it. Update draft PyHIP dispatch tests for the new contract, migrate the prefill-anchor case to the current QSA test file, and cover embedding alignment and broadcast-add graph replay.
| and not use_rejection_sampling | ||
| and is_qwen_qsa(self.draft_runner.model_config.hf_config) | ||
| ): | ||
| # ROCm keeps max()'s tie-break (#26358) without the vocab softmax. |
There was a problem hiding this comment.
sgl-project#26235 merge but revert by sgl-project#26358, and alternative implementation exist in current base branch: sgl-project#35872, do you think we still need this adjustment?
There was a problem hiding this comment.
In commit c84ad87, I've removed
unreachable paths. but here is in _draft_extend_for_prefill which is not covered by sgl-project#35872.
cfb1002 to
c84ad87
Compare
|
This PR backports Qwen3.8-Flash-Next QSA/MTP optimizations from #40 to
MI308X CI: PR #94 baseline → PR #99 Both runs passed 6/6 serving cases. Each case completed 128 performance requests at concurrency 1 and scored 200 GSM8K examples. Performance thresholds are advisory; the recorded GSM8K gate allows a 3% relative drop from each case's reference. The after summary reports coverage of 6/7 defined cases because the daily-only R-Fork startup case is excluded from standard PR runs.
Changes are
Additional CI summary metrics:
The targeted Qwen3.8-Flash-TP2-MTP case records TTFT -4.2%, TPOT -37.8%, and output throughput +40.8%. Its acceptance length changes by only -0.4%, while GSM8K increases from 98.50% to 99.00%. Qwen3.8 Base (w/o MTP) and Qwen3.5 model performance is keep flat within run-to-run variance. |
Motivation
This PR is to cherry pick #51
Modifications
Accuracy Tests
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci