Repository navigation
[Feat] [NVIDIA] muse_spark: Add the Muse Spark Open kernel half as opt-in hooks on SGLang's forward - #39
[Feat] [NVIDIA] muse_spark: Add the Muse Spark Open kernel half as opt-in hooks on SGLang's forward#39wenscarl wants to merge 8 commits into
Conversation
Results: Muse Spark TEP8 c1 megakernel (TRT-LLM port) on Rubin
Summary
Setup
GSM8K accuracyProtocol:
Per-layer numerics
Known gaps
🤖 Generated with Claude Code |
|
Added Kernel off vs on, same server arguments: SGLang 306ccf6, Muse Spark Open 816B-A42B NVFP4 with the DFlash2 draft (8 draft tokens), TP8 = EP8 over two nodes of sm_107 GPUs, FP8 KV with pages of 128,
Speed: Compare mode (each layer against the stock layer on the same inputs, 4 verify forwards, 8 ranks, layers 1-60): worst residual-stream relative error 8.8 %; the KV-cache rows the kernel writes match stock's except for at most 2 bytes per layer; no non-finite values. |
verify_mk (sgl-project#39) runs TensorRT-LLM's Muse Spark decode megakernel on the one-request verify step on Rubin (sm_107). This adds its GB300 (sm_103a) port as a plug-in on top of sgl-project#39, in the per-hardware layout: sgl_nvidia_mega/muse_spark/sm103. Rubin's files (components/verify_mk, components/vendor/trtllm_ab93b78) are unchanged, and every device other than compute capability 10.3 loads what it loads today. - sm103/trtllm_ab93b78: a copy of components/vendor/trtllm_ab93b78 (NVIDIA/TensorRT-LLM ab93b785a476f01d2f1e1907c930780fc6d7832e) with sm_103a as the build target: one CTA per SM of GB300's 152 (MSO_MK_CTAS=152), TensorRT-LLM's 212 QKV runs kept (MSO_MK_QKV_RUNS=212), and every launch planned for 212 CTAs and folded onto 152 by fold.py (added; MUSE_VR_VERIFY_MK_FOLD_SPREAD=1 moves the second o_proj unit of a sliding-window host CTA to an attention CTA, so no CTA runs two). Dev-only builds (MUSE_VR_VERIFY_MK_BUILD): single-lever variations of the served build and their combinations, an expert-weight L2 prefetch prototype (MSO_MK_XPF) and the stamped twin (per-unit timelines, MUSE_VR_VERIFY_MK_STAMPS). Changed TensorRT-LLM blocks are marked verify_mk; pre-commit skips the directory, as it skips the vendored original. - sm103/verify_mk: a copy of components/verify_mk that imports that kernel, plus MUSE_VR_VERIFY_MK_TAPS (the kernel writes the DFlash taps of layers 1-60). - components/__init__.py: on compute capability 10.3 (read through NVML, so CUDA is not initialized) the loader imports sm103.verify_mk in place of components.verify_mk (ARCH_MODULES). - pyproject.toml ships the copy's license and stage headers. - Tests: test_muse_spark_sm103_verify_mk.py (the verify_mk contracts on the sm103 copy, and the loader's choice) and test_muse_spark_sm103_verify_mk_fold.py (the 212-to-152 fold of the served build's plans). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
verify_mk (sgl-project#39) runs TensorRT-LLM's Muse Spark decode megakernel on the one-request verify step on Rubin (sm_107). This adds its GB300 (sm_103a) port as a plug-in on top of sgl-project#39, in the per-hardware layout: sgl_nvidia_mega/muse_spark/sm103. Rubin's files (components/verify_mk, components/vendor/trtllm_ab93b78) are unchanged, and every device other than compute capability 10.3 loads what it loads today. - sm103/trtllm_ab93b78: a copy of components/vendor/trtllm_ab93b78 (NVIDIA/TensorRT-LLM ab93b785a476f01d2f1e1907c930780fc6d7832e) with sm_103a as the build target: one CTA per SM of GB300's 152 (MSO_MK_CTAS=152), TensorRT-LLM's 212 QKV runs kept (MSO_MK_QKV_RUNS=212), and every launch planned for 212 CTAs and folded onto 152 by fold.py (added; MUSE_VR_VERIFY_MK_FOLD_SPREAD=1 moves the second o_proj unit of a sliding-window host CTA to an attention CTA, so no CTA runs two). Dev-only builds (MUSE_VR_VERIFY_MK_BUILD): single-lever variations of the served build and their combinations, an expert-weight L2 prefetch prototype (MSO_MK_XPF) and the stamped twin (per-unit timelines, MUSE_VR_VERIFY_MK_STAMPS). Changed TensorRT-LLM blocks are marked verify_mk; pre-commit skips the directory, as it skips the vendored original. - sm103/verify_mk: a copy of components/verify_mk that imports that kernel, plus MUSE_VR_VERIFY_MK_TAPS (the kernel writes the DFlash taps of layers 1-60). - components/__init__.py: on compute capability 10.3 (read through NVML, so CUDA is not initialized) the loader imports sm103.verify_mk in place of components.verify_mk (ARCH_MODULES). - pyproject.toml ships the copy's license and stage headers. - Tests: test_muse_spark_sm103_verify_mk.py (the verify_mk contracts on the sm103 copy, and the loader's choice) and test_muse_spark_sm103_verify_mk_fold.py (the 212-to-152 fold of the served build's plans). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t-in hooks on SGLang's forward Adds NVIDIA's fused kernels for Muse Spark Open (MuseSparkForConditionalGeneration) under sgl_nvidia_mega/muse_spark/: - the spec, plan and runtime skeleton for the target-verify step, registered through the same interface as deepseek_v41; - the components, as hooks on SGLang's own forward: each is opt-in (MUSE_VR_* switches, off by default), pins the SGLang sources it hooks by sha256 and steps aside if they moved, and declares the SGLang names it reads (SGLANG_READS) for test/unit/test_contract.py; - verify_mk (MUSE_VR_VERIFY_MK=1, off by default): TensorRT-LLM's sm_107 decode megakernel on the one-request target-verify step, vendored from NVIDIA/TensorRT-LLM ab93b785a476f01d2f1e1907c930780fc6d7832e; - the vendored SGLang pull-request files the components bind, the license texts, NOTICE paragraphs, SPDX and copyright headers, and the code owners. The host-side runtime half stays out of this repository. Co-authored-by: Rohan Varma <rohanv@nvidia.com> Co-authored-by: Rohith Rachala <rrachala@nvidia.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5c0a9e0 to
a45f2f3
Compare
verify_mk (sgl-project#39) runs TensorRT-LLM's Muse Spark decode megakernel on the one-request verify step on Rubin (sm_107). This adds its GB300 (sm_103a) port as a plug-in on top of sgl-project#39, in the per-hardware layout: sgl_nvidia_mega/muse_spark/sm103. Rubin's files (components/verify_mk, components/vendor/trtllm_ab93b78) are unchanged, and every device other than compute capability 10.3 loads what it loads today. - sm103/trtllm_ab93b78: a copy of components/vendor/trtllm_ab93b78 (NVIDIA/TensorRT-LLM ab93b785a476f01d2f1e1907c930780fc6d7832e) with sm_103a as the build target: one CTA per SM of GB300's 152 (MSO_MK_CTAS=152), TensorRT-LLM's 212 QKV runs kept (MSO_MK_QKV_RUNS=212), and every launch planned for 212 CTAs and folded onto 152 by fold.py (added; MUSE_VR_VERIFY_MK_FOLD_SPREAD=1 moves the second o_proj unit of a sliding-window host CTA to an attention CTA, so no CTA runs two). Dev-only builds (MUSE_VR_VERIFY_MK_BUILD): single-lever variations of the served build and their combinations, an expert-weight L2 prefetch prototype (MSO_MK_XPF) and the stamped twin (per-unit timelines, MUSE_VR_VERIFY_MK_STAMPS). Changed TensorRT-LLM blocks are marked verify_mk; pre-commit skips the directory, as it skips the vendored original. - sm103/verify_mk: a copy of components/verify_mk that imports that kernel, plus MUSE_VR_VERIFY_MK_TAPS (the kernel writes the DFlash taps of layers 1-60). - components/__init__.py: on compute capability 10.3 (read through NVML, so CUDA is not initialized) the loader imports sm103.verify_mk in place of components.verify_mk (ARCH_MODULES). - pyproject.toml ships the copy's license and stage headers. - Tests: test_muse_spark_sm103_verify_mk.py (the verify_mk contracts on the sm103 copy, and the loader's choice) and test_muse_spark_sm103_verify_mk_fold.py (the 212-to-152 fold of the served build's plans). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NOTICE: keep both new paragraphs (the Kimi K3.1 DCP top-k merge adapted from SGLang, and the TensorRT-LLM copy verify_mk runs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_binding_limit made a new positions buffer for each of its five bindings and dropped the previous one. Bindings are keyed by buffer address, so on the CI runner a freed buffer's address came back for a later binding, matched an earlier one, and the fifth binding was taken instead of refused. The test now holds every buffer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rubin's (sm_107) verify_mk code moves to its architecture's folder, as the other models keep their GB300 code in <model>/sm103: components/verify_mk -> sm107/verify_mk and components/vendor/trtllm_ab93b78 -> sm107/trtllm_ab93b78 (git mv; the files change only in their imports and paths). The component loader imports verify_mk from sm107 (components.MODULES). The TensorRT-LLM part of components/vendor/README.md moves to sm107/README.md, and NOTICE, pyproject.toml's package data and the pre-commit exclude follow the new paths. The test moves to test_muse_spark_sm107_verify_mk.py, imports the real sm107 package before its stand-ins (so it also passes on its own), and checks the loader's choice. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
verify_mk (sgl-project#39) runs TensorRT-LLM's Muse Spark decode megakernel on the one-request verify step on Rubin (sm_107), from sgl_nvidia_mega/muse_spark/sm107. This adds its GB300 (sm_103a) port as a plug-in on top of sgl-project#39, in the same per-hardware layout: sgl_nvidia_mega/muse_spark/sm103. Rubin's files are unchanged, and every device other than compute capability 10.3 loads what it loads today. - sm103/trtllm_ab93b78: a copy of sm107/trtllm_ab93b78 (NVIDIA/TensorRT-LLM ab93b785a476f01d2f1e1907c930780fc6d7832e) with sm_103a as the build target: one CTA per SM of GB300's 152 (MSO_MK_CTAS=152), TensorRT-LLM's 212 QKV runs kept (MSO_MK_QKV_RUNS=212), and every launch planned for 212 CTAs and folded onto 152 by fold.py (added; MUSE_VR_VERIFY_MK_FOLD_SPREAD=1 moves the second o_proj unit of a sliding-window host CTA to an attention CTA, so no CTA runs two). Dev-only builds (MUSE_VR_VERIFY_MK_BUILD): single-lever variations of the served build and their combinations, an expert-weight L2 prefetch prototype (MSO_MK_XPF) and the stamped twin (per-unit timelines, MUSE_VR_VERIFY_MK_STAMPS). Changed TensorRT-LLM blocks are marked verify_mk; pre-commit skips the directory, as it skips the vendored original. - sm103/verify_mk: a copy of sm107/verify_mk that imports that kernel, plus MUSE_VR_VERIFY_MK_TAPS (the kernel writes the DFlash taps of layers 1-60). - components/__init__.py: on compute capability 10.3 (read through NVML, so CUDA is not initialized) the loader imports sm103.verify_mk in place of sm107.verify_mk (ARCH_MODULES). - pyproject.toml ships the copy's license and stage headers; NOTICE names the copy. - Tests: test_muse_spark_sm103_verify_mk.py (the verify_mk contracts on the sm103 copy, and the loader's choice) and test_muse_spark_sm103_verify_mk_fold.py (the 212-to-152 fold of the served build's plans). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pushed three commits on top of b9bc352: merged main (NOTICE keeps both new paragraphs), fixed the failing unit test ( |
verify_mk (TensorRT-LLM's Rubin decode megakernel on the one-request verify step: its host runner and the copied TensorRT-LLM tree in muse_spark/sm107, 35.4k lines, 33.4k of them the TensorRT-LLM copy) moves to its own pull request on main; it needs nothing of the components here. This pull request keeps every component. - Removed: muse_spark/sm107/ and test/unit/test_muse_spark_sm107_verify_mk.py, the registry's verify_mk entry and its module path, sgl_compat's alias of SGLang's megakernel runtime module, and the NOTICE paragraph, package data and pre-commit exclusion of the TensorRT-LLM copy (those four files match the branch's base on main again). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-scope operations The plugin's later fix to the two MoE-LD-W kernels, ported as is. The CTA abort flag (g_abort) was set with a C++ volatile store in fail(), polled with a C++ volatile load in aborted() and reset by thread 0 with a plain store at kernel start. Every access is now an explicit strong operation at CTA scope on the shared state space, in both files: - aborted(): ld.relaxed.cta.shared.u32 (one load, as before); - fail(): atom.relaxed.cta.shared.exch.b32 after the error-word atomicOr (failure path only); - the kernel-start reset by thread 0: st.relaxed.cta.shared.u32 (abort_reset()). The setter and the pollers are then morally strong and do not form a data race under the PTX ISA memory consistency model. Every other use of the flag goes through aborted() and fail(), and the flag's values and the points where it is read or written are unchanged, so outputs are unchanged on every path. Co-authored-by: Rohan Varma <rohanv@nvidia.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Updated description for this pull request at 890d0b6: the review changes (last commit) and the absolute speed numbers: MotivationMuse Spark Open ( It takes the kernel half only. SGLang splits a megakernel in two: It is deliberately not shaped like Authorship and creditThe kernels and hook components are the work of Rohan Varma (@nvrohanv), developed in ModificationsAll changes are under
SGLang pull requests these components bind
Tested against: SGLang Accuracy TestsGSM8K, all 1,319 test questions (zero-shot chat: "Please reason step by step, and put your final answer within \boxed{}.", temperature 0, up to 4,096 generated tokens, real draft acceptance), at 96 concurrent requests on Rubin with the 96 settings of the speed table and this branch at e6bbe20; both arms on the same node pair, the baseline with the speed table's baseline settings at 96. Comparison rule: an exact two-sided McNemar test on per-question correctness; p < 0.05 is a difference.
Most of the difference is answers that reach the 4,096-token limit while repeating themselves (45 in the candidate, 14 in the baseline). The candidate's NVFP4 KV cache accounts for most of it: the same settings on an FP8 KV cache ( Speed Tests and ProfilingMeasured on Rubin (sm_107): each server on one node of 4 GPUs, TP4 = EP4, with the benchmark client on a second node; Muse-Spark-Open-816B-A42B-NVFP4 with the DFlash2 draft; SGLang 306ccf6f57bcd6efc9edc626e39a9673e22cb9d6 with sgl-project/sglang#48950, #48947, #48948 and #48949 ported onto it; this pull request's tree at 859fee2 (for that SGLang build the components' pinned SGLang file digests were extended by the build's own, nothing else changed). Workload: an agentic multi-turn benchmark (coding-agent conversations; prompts of 73k-90k tokens at the median and 247k-301k at p90). For each arm and concurrency, on the same node pair: a warm-up server that runs the workload for 10 minutes, then a fresh server and a 1-hour run; synthetic draft acceptance (accept length 4.05) in both arms. Baseline: SGLang without the plugin, at its best stock settings for each concurrency. Candidate: this pull request with each concurrency's settings. Relative change, candidate over baseline (in brackets: the 10-minute warm-up runs):
Absolute values of the 1-hour runs, baseline → candidate:
The arms differ in more than the plugin, so these are recipe-to-recipe numbers: besides the components, the candidate runs an NVFP4 KV cache (baseline FP8), prefill-decode interval 3 (baseline 0), HiCache 220 GB per rank (baseline 205), the FlashInfer all-to-all, the fa4 draft attention backend, the context-projection overlap, SWA host ratio 0.2 and SWA full-token ratio 0.06 (baseline 0.1), sequence parallelism from 1,536 tokens, SGLang's DFLASH eager commit ( Every component the candidate's settings switch on engaged, as in the plugin's own records of these settings (checked at boot and after each 1-hour run). At 80 the baseline ran about 7 % slower per user than our earlier stock measurement at that concurrency on other nodes (at 96 it matched it, at 112 it ran 5 % faster); against that earlier baseline the 80 row reads ×2.77 / ×1.68 / ×6.17. At 80 and 112 the candidate is within 1.1 % of earlier measurements of the same settings on all three metrics; at 96 it ran 4.5 % lower on per-user speed, 1.4 % on throughput and 5.6 % on latency, where an earlier run of the same engaged components on other nodes was 1.9 % lower on per-user speed. Being faster, the candidate gets further into the conversations within the hour, so its prompts run longer (median 84k-90k tokens against the baseline's 73k-77k). Speed check of the abort-flag fix. The 96 settings at e6bbe20, one 1-hour run on another node pair, against the same settings at 859fee2 in the table above: per-user output speed +1.8 %, total token throughput per GPU +0.6 %, 1 / p90 end-to-end latency per output token +1.6 %, with every component engaged as recorded (run-to-run spread across node pairs is a few percent), so the fix costs nothing measurable. Checklist
Review and Merge Process
🤖 Generated with Claude Code |
YAMY1234
left a comment
There was a problem hiding this comment.
Thanks Rohith for splitting verify_mk out (now #76). Three things from my side:
-
Debug code. #42 removed the
*_SHADOWchecks (ar_attn_boundary, ctx_proj_overlap, nvfp4_kv_verify, spec_sample_split, verify_topk_sample) and xattn_b's dump mode on purpose, and this PR brings them back. Could you drop them and keep main's versions of these six files? -
prefill_moe_x / moe_x_kernels (~9.5k lines). They only turn on when
MUSE_VR_MOE_X_MMA_HELPERSnames an MMA helper module that isn't in this repo, and #42 notes they can't run on sm_103 (they issue K=128 block-scaled MMAs with operand collectors). So nobody using this repo can turn them on. Could you leave them out of this PR, as #42 did, and bring them back once the helper module can ship here? -
Tests. Not a blocker for this PR. Once it lands, an SGLang integration test for muse_spark would be a good follow-up.
…hecks, no xattn_b dump mode) Review: sgl-project#42 removed the debug shadow checks (MUSE_VR_<NAME>_SHADOW in ar_attn_boundary, ctx_proj_overlap, nvfp4_kv_verify, spec_sample_split and verify_topk_sample) and xattn_b's dump mode (MUSE_VR_XATTN_B_MODE=dump) on purpose; this pull request had brought them back. The six files are main's again. Both were debug only and off by default, so the served paths do not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review.
The description now also gives the absolute speed numbers, baseline → this pull request (the same 1-hour runs as the relative table):
|
…d the one-request components Stacked on sgl-project#39: it extends sgl-project#39's draft_attn, verify_logits_gather and softmax_split and uses its registry. Everything is opt-in and off by default; the one-request pieces refuse, or step aside on, every other batch. - verify_mk (MUSE_VR_VERIFY_MK=1): TensorRT-LLM's Muse Spark decode megakernel (target layers 1-60 as one persistent kernel) on SGLang's one-request target-verify step at TP8 = EP8. muse_spark/sm107/verify_mk is the host runner: it hooks SGLang's install_megakernel, binds the kernel to SGLang's KV cache, TP group and weights (layer facades, workspaces), refuses the forwards it does not cover (they run stock) and has a compare mode that checks forwards layer by layer against the stock layers. The kernel also writes the DFlash taps of layers 1-60, and when every capture is a kernel tap the text model returns the taps' buffer itself (their concatenation), so no tap copies run. muse_spark/sm107/trtllm_ab93b78 is TensorRT-LLM's kernel and host code at ab93b785a476f01d2f1e1907c930780fc6d7832e, unchanged apart from four files marked "Modified by NVIDIA" (SGLang's paged KV cache as a build option, SM-stable CTA roles as a build option); sm107/README.md lists what is copied. - The plugin's one-request components, ported from its one-request TP8 line: new host_ingest, req_bcast, token_count_fill, embed_gather, step_graphs, eager_commit, selector_fused, selector_proj_overlap, rust_treecore and graph_meta_par, with the kernels batch_copy, dflash_commit, draft_gemv_push, pull_gather_rows, selector_fused, sparse_final, verify_topk_fast and final_norm_split; the plugin's later versions 3-way merged into ar_norm_residual, ctx_proj_overlap, draft_attn, draft_boundary, final_norm, pull_bounded, verify_attn, verify_topk_sample and the ops draft_ar_norm, draft_attn, draft_gemv, draft_qk, full_verify_attn and swa_verify_attn (new paths behind new switches; the existing defaults are unchanged). - One-request step optimizations, each behind its own switch: multimem logits gather with a fused argmax (verify_logits_gather), the split softmax captured in the step graphs, the step graphs' simulated-acceptance fold, Triton accept and late launch, the layer-0 input-norm table (and its stream), the drafter's layer-0 table, token-count reuse, parallel graph metadata and the final-norm split. - components/__init__.py registers them in the plugin's order; the loader takes verify_mk from muse_spark/sm107 (and on GB300 from muse_spark/sm103, which a separate pull request adds with the same loader lines); sgl_compat maps SGLang's megakernel runtime module; NOTICE, the pyproject package data and the pre-commit exclusion cover the copied tree. - test/unit/test_muse_spark_sm107_verify_mk.py: install, refusals, binding, launches, the taps and the packed capture, the compare mode and the loader on CPU stand-ins; test_muse_spark_sm107_verify_mk_i2b.py: the SM-stable claim protocol. Co-authored-by: Rohan Varma <rohanv@nvidia.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Motivation
Muse Spark Open (
MuseSparkForConditionalGeneration) runs on SGLang today with stock kernels. This PR carries NVIDIA's fusedkernels for the model, developed and measured as an out-of-tree plugin (
muse_vr_plugin), into this repository so that they shipwith the other megakernels and follow its license, notice and CI rules.
It takes the kernel half only. SGLang splits a megakernel in two:
--enable-nvidia-megakernelloads the plugin, and where theplugin's spec covers a step its kernels replace SGLang's operations;
SGLANG_ENABLE_NV_MEGA_RUNTIME_OPTIMIZATIONswitches SGLang's ownhost-side optimizations (CPU work between GPU launches) and never switches the kernels. This PR is the first half. The host-side
runtime modules the plugin also carries stay out of this repository; they belong in SGLang, one optimization per pull request (see
"Not included").
It is deliberately not shaped like
deepseek_v41. That spec replaces a whole decode step with a rewritten forward. The Muse Sparkkernels are separate optimizations at separate points inside SGLang's own forward (a norm, an attention call, a MoE finalize, a
boundary reduction, a sampler), so there is no single step function to hand over, and writing one would be a rewrite of the model
rather than a port of the kernels.
Authorship and credit
The kernels and hook components are the work of Rohan Varma (@nvrohanv), developed in
muse_vr_plugin. Shu Wang (@wenscarl)ported them into this repository: the spec/plan/runtime skeleton, the registry and entry points, the SGLang-source pin handling, the
license, NOTICE and header work, and the import fixes. Every commit carries
Co-authored-by: Rohan Varma <rohanv@nvidia.com>; somealso carry an AI-assistant trailer. Both authors' contributions are NVIDIA's; source headers carry the NVIDIA copyright line.
Modifications
All new code is under
sgl_nvidia_mega/muse_spark/; outside it the PR touchesplugin.py(registration),NOTICE,.codespellrcand.github/CODEOWNERS.MuseSparkForConditionalGenerationthrough the same interface asdeepseek_v41(
MEGAKERNEL_API_VERSION = 2), scoped to the target-verify step. The requirements are the configuration the kernels were measuredon (NVFP4 KV with
modelopt_fp4weights, DFLASH speculative decoding, FlashInfer TRT-LLM MoE runner with the FlashInferall-to-all,
trtllm_mha, sm_107, TP4); a different setup is refused.build()offers no step width yet, so with--enable-nvidia-megakernelthe server keeps running SGLang's own forward and says the spec covers no step.NUMERICSstill hasempty tolerances.
sglang.srt.plugins.hook_registry:nvfp4_kv,kv4_dec,kv_draftwin,ctx_kv_countermoe_ld,bf16_ldw,moe_tail,proj_publish,unorm_boundary,fin2,fin_2shot,hb0_rr,mid_rs,moe_tactic,prefill_moe_tactic,prefill_moe_x,sp_combine_inplace,pfin,sp_fp4_dispatchgemm_pick,gemm_lt,draft_head_lt,fp8_prefill(MXFP8 prefill projections),o_rowshard,rs_samemverify_attn,small_extend_attn,xattn_b,prefill_attn,prefill_qkn,ar_attn_boundary,input_norm,final_norm,car_table,pull_boundeddraft_candidates,draft_boundary,draft_attn,draft_kv_append,draft_topk,verify_topk_sample,verify_logits_gather,spec_sample_split,softmax_split,ctx_proj_overlap,ctx_proj_prefill,sp_gatecomponents/csrc(61.cuh, 1.cu), Python entry points incomponents/ops.sglang.*declares what it reads inSGLANG_READS, astest/unit/test_contract.pyrequires, so a rename in SGLang fails that test instead of a GPU server's startup. Two import formsthe test cannot express were rewritten without changing what they bind (
from P import subtoimport P.sub as sub, andfrom M import a as bto a module import plusb = module.a). Reads the code guards (hasattr,getattrwith a default, or"branch layout only") are not declared; one real rename,
MuseSpark1xForCausalLMtoMuseSparkTextForCausalLM, is declared aseither name, and
sp_gatestill uses the old one and steps aside by its source pin on the new layout.MUSE_VR_*environment switches) and off by default, so a server that sets none ofthem runs stock SGLang. A registration failure is recorded and leaves SGLang stock instead of taking the server down. Each component
pins the SGLang source files it hooks by sha256 and steps aside if they have moved. The order of
COMPONENTSis load-bearing(several hook the same call and must wrap each other in a fixed order; the comments give it).
components/vendor/. Two components bind SGLang pull requests that the SGLang revision this package pins does not contain:#47174 (fused all-reduce + norm, used by
ar_attn_boundary) and #46724 (fused finalize + two-shot push, used byfin_2shot). Theirfiles are carried as Apache-2.0 copies with their provenance in
vendor/README.md; two are unchanged, the others carry a"Modified by NVIDIA" header (a bounded slot poll that traps instead of hanging). They can be dropped once SGLang has the pull requests.
SPDX-License-Identifierand a copyright line. Files adapted from SGLang also carryPortions Copyright 2023-2024 SGLang Team (Apache-2.0)plus an origin and "Modified by NVIDIA" note.NOTICEgains the SGLang- andFlashInfer-derived paragraphs, and the four license texts FlashInfer's NOTICE points to are included under
components/include/licenses/. Threemoe_x_kernelsfiles keep their BSD-3-Clause header.SGLANG_ENABLE_NV_MEGA_RUNTIME_OPTIMIZATION:sampling_graph,eager_commit,dflash_prefill_async,sb_lite,kv_hostbook,swa_hostsplit,kv_accounting, andrust_treecore.softmax_splitandspec_sample_splitconsultedsampling_graphonly to allow a CUDA-graph capture inside its own capture;without it a capture is always refused, which is what they did whenever it was not engaged.
graph_audit,teacher_force,draft_probe,kv_evict_probe,kv_tap); they are never served.Depends on SGLang changes that are not merged
Tested against: no GPU run of this branch has been made. The kernels were
developed and measured, as the out-of-tree plugin, on SGLang
306ccf6(the 2026-10-20 nightly image). The unit-test workflow pins SGLangaa3e34aa; thecomponents' sha256 pins name
306ccf6-era sources, so onaa3e34aathey step aside rather than engage. Run statically against theaa3e34aasources,test/unit/test_contract.pypasses for everymuse_sparkmodule (threeqwen3_5cases fail there on unmodifiedmaintoo). No GPU run of this branch has been made.
Accuracy Tests
None from this branch yet. Accuracy with each component group on and off, on the same server, still has to be run and
attached; the template asks for it because this PR changes kernel and forward code.
Speed Tests and Profiling
None from this branch yet. The kernels were measured in the out-of-tree plugin, but those numbers were not produced from
this branch, and the plugin runs include the host-side runtime modules left out here, so the kernel half alone should not be expected
to reproduce the plugin's numbers.
Checklist
pre-commit run --all-filespasses (isort, ruff, ruff-format, codespell;pres,ot,optin,nown,kOwnare on the codespell ignore list).test/cover the change. [No new tests; the existing contract test now covers themuse_sparkmodules' SGLang reads.].github/CODEOWNERSthat names its owner (**/*muse_spark* @wenscarl @nvrohanv).Review and Merge Process
lintandCheck PR titlechecks must pass..github/CODEOWNERSto review.main.