Support spec v2 for Frozen-KV MTP; remove v1 worker - #27607
Conversation
Co-Authored-By: Khoa Pham <khoa.pham@radixark.ai> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Co-Authored-By: Khoa Pham <khoa.pham@radixark.ai> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Khoa Pham <khoa.pham@radixark.ai> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
/rerun-test test_frozen_kv_mtp.py test_gemma4_mtp_26b_a4b_extra.py test_gemma4_mtp_31b_extra.py |
|
Results for 🚀 🚀 |
|
/rerun-test registered/spec/test_gemma4_mtp_31b_extra.py |
|
Results for 🚀 |
# Conflicts: # python/sglang/srt/speculative/frozen_kv_mtp_worker.py
|
/rerun-test test_frozen_kv_mtp.py test_gemma4_mtp_31b_extra.py test_gemma4_mtp_26b_a4b_extra.py |
|
Results for 🚀 🚀 |
|
Results for 🚀 🚀 |
|
/rerun-test test_frozen_kv_mtp.py test_gemma4_mtp_26b_a4b_extra.py test_gemma4_mtp_31b_extra.py test/registered/attention/unittests/dense/test_triton.py |
|
Results for 🚀 🚀 🚀 |
Three conflicts resolved + four-site API-migration port: 1. piecewise_cuda_graph_runner.py (deleted in HEAD, modified in main). Accept the deletion (cg-refactor's unified runner/prefill_cuda_graph_runner.py replaces it). Port main's sgl-project#27468 dflash-aux-hidden-states change to the new runner: capture_hidden_mode = FULL when spec_algorithm.is_dflash(), and use self.capture_hidden_mode (not NULL) in capture_prepare so dflash spec captures with the right variant. 2. frozen_kv_mtp_worker.py (deleted in main, modified in HEAD). Accept main's deletion (V1 -> V2 worker migration, sgl-project#27607). Apply the four cuda_graph_config API migration sites that cg-refactor had in V1 to V2 (frozen_kv_mtp_worker_v2.py): - backup_disable_cuda_graph -> backup_decode_mode (using new cuda_graph_config.decode.backend field) - server_args.disable_cuda_graph = True -> server_args.cuda_graph_config.decode.backend = Backend.DISABLED - matching restoration on draft_model_runner.server_args - init_cuda_graphs early-exit: self.server_args.disable_cuda_graph -> check_cuda_graph_backend(Phase.DECODE, Backend.DISABLED) 3. test/registered/cuda_graph/piecewise/ test_pcg_with_speculative_decoding_dflash.py (file location). Accept at the cg-refactor-renamed location (new test/registered/ cuda_graph/piecewise/ tree, not the legacy test/registered/piecewise_cuda_graph/). Audited the auto-merged code-side files (scheduler.py, schedule_batch.py, memory_pool.py, cuda_graph_buffer_registry.py, arg_groups/speculative_hook.py, spec_info.py, speculative_draft_runner.py) for unused-arg artifacts introduced by the merge. None found — added kwargs (e.g. mamba_indices on DSATokenToKVPool.get_cpu_copy/load_cpu_copy, padding_policy on positions/mrope_positions GraphSlots) are all referenced at the call sites and in the function bodies. Sanity-checked imports on touched files (frozen_kv_mtp_worker_v2, prefill_cuda_graph_runner) and AST-parsed cleanly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolve conflicts from spec v2 refactor: - frozen_kv_mtp_worker.py: removed (replaced by frozen_kv_mtp_worker_v2.py in #27607); ported trtllm_mha draft-attn-backend branch into the v2 worker. - frozen_kv_mtp_cuda_graph_runner.py: adopt shared DecodeCudaGraphRunner surface (_replay_graph + _make_graph_key) from #28081 / #28384. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Khoa Pham <khoa.pham@radixark.ai> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Khoa Pham <khoa.pham@radixark.ai> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
FrozenKVMTPWorkerV2(orchestrator, subclassesEAGLEWorkerV2) +FrozenKVMTPDraftWorker(draft layer) — supporting both overlap and non-overlap schedulingFrozenKVMTPWorkerspec_stage_spannvtx markers on the orchestrator (parity with the v1 worker /EAGLEWorkerV2)Mechanical verification
The draft layer is a byte-faithful move of the v1
FrozenKVMTPWorkermethods intoFrozenKVMTPDraftWorker. AST move-equivalence (reproducible script + results): https://gist.github.com/hnyls2002/08fb69f9857f011750ba2455816701addraft_forwardand every frozen-KV metadata/view helper)__init__: onlysuper().__init__->TpModelWorker.__init__, twoNoneinits, and assert-message textdraft: only the penalty-cumulate block removed (now handled by the inheritedEagleDraftInputV2Mixin.prepare_for_decode, matching EAGLE v2)Validation
gemma-4-E4B-it+ assistant: v10.725vs v2 overlap0.730vs v2 sync0.730; overall accept length~2.83across all three pathstopk=1): v2 recovers to v1's0.445. This relies on the spec-v2 stop-string finish fix (fix: stop-string check misses early matches during speculative decoding #23802, Fix spec v2 stop output boundary #25980, now on main): under v2 a step commits multiple tokens, so a stop string landing mid-chunk was missed and the model over-generated past it — the few-shot eval then extracted the wrong final number (~0.365). With those merged, v2 matches v1.topk=1;topk>1tree path still to validateTest plan
/rerun-test test_frozen_kv_mtp.py test_gemma4_mtp_26b_a4b_extra.py test_gemma4_mtp_31b_extra.pytest_gemma4_mtp_26b_a4b_extra.pyis currently disabled in CI; with the stop-string fix on main it can be re-enabled in a follow-upCI States
Latest PR Test (Base): ❌ Run #27235719910
Latest PR Test (Extra): ❌ Run #27235719724