AX Engine for SGLang
ax-engine-sglang is the SGLang add-on for AX Engine's Linux CUDA edition.
Deploy it on Linux amd64 (x86_64) or arm64 (aarch64) with a CUDA-enabled
SGLang environment and NVIDIA GPU. SGLang 0.5.23 is the reference release.
Platform and model support · Side-by-side throughput
The Python distribution is ax-engine-sglang, the import is
ax_engine_sglang, and the SGLang plugin name is ax-engine. The plugin
integrates with the installed SGLang worker for DFlash-family speculative
verification. Its tree worker is generated at startup from installed
SGLang code and validates the expected upstream integration points.
DForkTree attribution
Install and run
Use Python 3.11 or 3.12 and a CUDA 13-compatible NVIDIA driver on Linux. In a
fresh virtual environment, install the v0.6.1 release wheel
to install the add-on and SGLang 0.5.23.
python -m pip install https://github.com/defai-digital/ax-engine-sglang/releases/download/v0.6.1/ax_engine_sglang-0.6.1-py3-none-any.whl
Use python -m pip install ./ax-engine-sglang from a source checkout. Add
--no-deps when you already have the pinned SGLang environment. An earlier
installed-wheel check on Jetson Thor used the 0.2.1 wheel in
lmsysorg/sglang:v0.5.23-cu130. The current package is 0.6.1.
ax-engine-sglang serve RadixArk/Qwen3.8-27B-NVFP4 \
--speculative-algorithm FC1_DFLASH_TREE \
--speculative-draft-model-path incoai/Qwen3.8-27B-DFlash2 \
--speculative-num-draft-tokens 16
The command enables the plugin, passes the server flags to SGLang and stops
startup if AX fails to load. An existing SGLANG_PLUGINS allowlist retains
its entries. To use the upstream launcher directly, set SGLANG_PLUGINS=ax-engine.
On Jetson Thor, the 0.2.1 wheel served a 32-token request with six tree
rounds and rejected a checkpoint setting mismatch before loading weights.
That check is a startup record for the installed wheel, not a 0.6.1
throughput result.
Smoke test and exact launch flags
Experimental AX Draft checkpoint
SGLang 0.5.23 can run a seven-token AX Draft checkpoint with the native
chain verifier and accepted-prefix GDN replay. In this mode the
proposal model uses the target's last committed normalized hidden row. It
loads AX Draft weights and keeps one feature row per request without a
separate draft KV cache.
AX_DRAFT_MODEL="$draft_dir" AX_GDN_CHAIN_REPLAY=1 ax-engine-sglang serve "$target_dir" \
--speculative-algorithm DFLASH --speculative-draft-model-path "$draft_dir" \
--speculative-num-draft-tokens 8 --disable-radix-cache \
--max-running-requests 8 --cuda-graph-max-bs-decode 8
Use a version 1 AX Draft checkpoint with model_type: ax_draft and
depth: 7. The experimental verifier accepts 2, 4 or 8 rows, including
the anchor. The DFLASH flag selects the native verifier and scheduler.
The experimental route uses a single GPU, standard prefill and the
dense Qwen 3.8 27B target.
Experimental GDN replay for DFlash2 chains
On SGLang 0.5.23, AX can keep the recurrent GDN verifier and replay just the
accepted prefix into the FP32 state. The width-eight DFlash2 worker allocates
compact replay buffers in place of full speculative SSM snapshots. Use a
single CUDA GPU and disable the radix cache.
AX_GDN_CHAIN_REPLAY=1 ax-engine-sglang serve RadixArk/Qwen3.8-27B-NVFP4 \
--speculative-algorithm DFLASH \
--speculative-draft-model-path incoai/Qwen3.8-27B-DFlash2 \
--speculative-num-draft-tokens 8 --disable-radix-cache \
--max-running-requests 8 --cuda-graph-max-bs-decode 8
AX selects FP32 GDN state, Triton verify, and fold-after-accept replay for
this standalone chain. The option is experimental and currently covers
the dense Qwen3.8-27B target with static, width-eight verification.
RTX 5090 validation
On RTX PRO 6000, replay raised warmed NVFP4 chat throughput by 16–18%
at C8 and 26–27% at C16 across both launch orders. Timed replay batches
recorded zero fallbacks. A 96-request stress run confirmed 12 cancellations,
zero errors, and identical reference outputs before and after. Use
AX_QUALITY_PROFILE=verified with the width-eight chain for the measured
exact-output configuration. RTX PRO 6000 hot-path validation
Add AX_NVFP4_B12X_DOWN128=1 to this launch to try FlashInfer's b12x kernel
only for the 27B NVFP4 down projection at 128 rows. It requires an SM12x GPU,
a dense ModelOpt NVFP4 target, SGLang 0.5.23 and
--fp4-gemm-backend flashinfer_cutedsl (derived by the launcher), and is not
available with the parity or verified profiles. Other projections and row
counts stay on cute-dsl, so C1 is unchanged. Early RTX PRO 6000 A/B runs
at 512 tokens per request measured +2.3–3.9% at C16; later runs remained
workload-dependent, and C16 outputs can diverge on near-ties.
Add AX_DFLASH_KV_GRAPH=1 to this launch to try CUDA graph replay for
the draft-context KV commit after verify. It captures per live batch size
through 16 when the draft uses the standard unquantized KV layout. Prefill
and incompatible rounds use the native eager writer. The CUDA cache check
matched eager exactly. On an RTX PRO 6000 at eight clients, the graph
raised streamed chat throughput by 0.8% and lowered frozen-prompt
throughput by 3.8%.
RTX PRO 6000 measurements
Use AX_DFLASH_KV_DIRECT=1 with the GDN replay launch to test direct
BF16 draft KV writes. A single kernel handles the accepted rows across
all draft layers. Prefill and other KV layouts use the native writer.
The RTX PRO 6000 test measured a 0.25% gain on eight-client streamed chat.
Direct writer measurements
AX_DFLASH_PLAN_REUSE=1 tests fixed-offset reuse and in-place page-ID
packing on the native FA2 verify CUDA graph. It requires the GDN replay
launch. Eight-client streamed chat was 1.45% slower on the RTX PRO 6000.
Replay planning measurements
Add AX_DFLASH_DRAFT_VOCAB=1 to this launch to try Splash-style draft
vocabulary reduction. Use --attention-backend flashinfer and
--fp4-gemm-backend flashinfer_cutlass for the NVFP4 checkpoint.
On eligible greedy batches, the draft graph projects
148,736 of 248,320 Qwen vocabulary rows and returns full-vocabulary token
IDs for verification. Batches with sampling, grammar constraints, or an
excluded token in any request's last 64 scheduler-visible tokens use the
full draft head. The packed head is for a static checkpoint. Keep the option
off for hot weight replacement.
Thor validation and benchmark commands
Humming on Hopper
On SM90 SGLang serves ModelOpt NVFP4 weights with Marlin W4A16; vLLM serves the same checkpoints with
humming-kernels. With AX_NVFP4_HUMMING=1 the plugin
converts each Marlin NVFP4 linear (MLP and lm_head) to Humming's layout at load time, keeping the
per-shard global scales that Marlin collapses to their maximum. Install it into the SGLang environment
with uv pip install --no-deps humming-kernels==0.1.20; the launcher then enables it for dense NVFP4
DFlash and tree launches. It also sets SGLANG_DISABLE_SILU_FP4_QUANT_FUSION=1, because Humming consumes
16-bit activations rather than SGLang's prequantized FP4 tuples; explicitly setting that flag to 0 is rejected.
On an H200 at eight clients it took replay 8 from 2-14% behind same-pod vLLM
to 3-10% ahead on code and math, and with --min-free-slots-delay 1 (five servers each) replay 8 to
+5.6 / +7.2 / +1.1% and tree 32 to +9.2 / +9.3 / +1.1% (code / math / chat); one client moved within ±3%. Humming's split-K reduces
through locks, so its outputs are not run-to-run deterministic and differ from Marlin's; the parity and
verified profiles refuse it. H200 report
Launch defaults
On SGLang 0.5.23 the plugin fills in the settings below while SGLang resolves the server arguments,
so the command above runs the measured configuration. The launcher prints every value with its
origin (auto or env). Explicit values take priority. A mismatch with the
checkpoint stops the launch and reports the reason. AX_AUTO_DEFAULTS=0 turns
off these defaults. For an existing SGLang 0.5.22 environment, use --no-deps
and supply the settings in the table below explicitly.