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.3 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.3/ax_engine_sglang-0.6.3-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.3.
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.3
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. On one B200 the recorded serving checks stayed
below DFlash2. A fitted 49,152-row head was timed as a readout only
(0.110 ms against 0.374–0.375 ms for the full projection) and has no
end-to-end throughput number.
B200 AX Draft report
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. The measured lanes below disable the radix cache. On one
GPU the replay fold writes that cache's state checkpoints, so
--disable-radix-cache is no longer required for this route.
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
Tree server with replay chain rounds
AX_GDN_CHAIN_REPLAY=1 also works with FC1_DFLASH_TREE. A tree server
runs a tree round for one eligible greedy request and chain rounds for
grouped requests. With replay, the chain rounds write SGLang's ReplaySSM
ring and fold the accepted prefix, as the standalone replay route does,
and the pool holds no per-position state snapshots (10.1 GB at eight
slots on Qwen3.8-27B). Tree rounds are unchanged: the fused tree verify
writes the accepted state itself.
AX_TREE=1 AX_CHAIN_WIDTH=8 AX_CHAIN_GRAPH_WIDTHS=8 AX_CHAIN_DRAFT_WIDTHS=8 AX_SSM_POSITIONS=8 \
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 \
--max-running-requests 8 --cuda-graph-max-bs-decode 8
The command above is the measured launch with the radix cache off. Leaving
the cache on is accepted on one GPU: the fused tree, the batched trees and
the replay fold write the state checkpoint a round crosses. Every expected
checkpoint was served on an RTX PRO 6000, RTX 5090, B200 and H200, and on
the RTX PRO 6000 and the B200 two servers of one launch restored identical
states (radix_multiturn.py --reference). With the cache on, SGLang sizes the state cache larger (28.0
GB against 1.3 GB at eight slots on the RTX PRO 6000) and NVFP4 greedy
outputs are no longer repeatable, on stock SGLang as well, so keep
--disable-radix-cache where repeatable outputs or memory matter.
Radix cache checks
On SM100 and SM120 this launch gets AX_GDN_CHAIN_REPLAY=1 and the three
AX_GDN_VERIFY_* kernels from the launch defaults,
including a fused AX_BTREE launch. Set AX_GDN_CHAIN_REPLAY=0 to keep
the snapshots. AX_BTREE_NATIVE=1 keeps SGLang's kernels and does not
take the replay default. On other GPUs set AX_GDN_CHAIN_REPLAY=1
yourself. It needs the fused tree (FC1_FUSED=1, AX_TREE=1) with
AX_SSM_POSITIONS and chain width 8, plus every rule of the standalone
replay launch, and is refused with AX_CHAIN_SCHEDULE,
AX_POLICY_MODE=adaptive and the parity profiles. AX_CHAIN_ATTN is
accepted: the chain rounds then verify and fold on the private runners'
attention backend (measured with trtllm_mha on a B200 and fa3 on an
H200; on SM120 the default applies only without it). A batched tree round writes the
accepted state itself, the same way a one-request tree round does, and on
SM120 the launch defaults turn batched trees on (AX_BTREE, up to eight
requests).
On an RTX PRO 6000 (27B NVFP4) the tree server with replay chain rounds ran 436.1 / 366.6 / 211.5 output tok/s at one client and 1,403.7 / 1,340.6 / 826.2 at eight (eight servers). Mean request time at eight clients was 33.2 / 35.3 / 15.3% below six stock vLLM servers on the same pod, and 13.2 / 11.5 / 14.8% below the same tree server with state snapshots. One-client throughput rose 0.9%, peak GPU memory fell from 41.1 to 31.2 GB, and one-client greedy outputs were identical on 24 of 24 prompts. A 600-request stress run (53 cancellations) returned every slot and left the reference outputs unchanged. RTX PRO 6000 tree server with replay
On a B200 (SM100, AX_CHAIN_ATTN=trtllm_mha) replay chain rounds, the GDN
prefill graph and the ring verify kernels took the tree server from 15-26%
behind AX GDN replay 8 at two to eight clients to within 3% of it, while it
stayed 26.7 / 14.4 / 6.6% ahead at one client; peak memory fell from 45.5 to
35.4 GB and one-client outputs were identical on 24 of 24 prompts. A
2,000-request stress run with cancellations completed with 0 errors.
B200 tree server report
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, except on a recognized H100, where a retest favored Marlin (explicit
AX_NVFP4_HUMMING=1 still selects Humming). 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.
| Applies to | Default | Derived from |
|---|---|---|
FC1_DFLASH_TREE |
AX_GDN_LAYERS, AX_GDN_HEADS |
the target's layer_types and linear_num_value_heads (48 / 48 for Qwen3.8-27B, 24 / 32 for Qwen3.5-9B) |
FC1_DFLASH_TREE |
FC1_DRAFT_BLOCK |
--speculative-num-draft-tokens, else the drafter's dflash_config.block_size |
FC1_DFLASH_TREE |
AX_LATTICE=1 |
a DFlash2 drafter; a DFlash (v1) drafter needs FC1_NGRAM_PATH (checked at launch) |
FC1_DFLASH_TREE |
FC1_TREE64=1 FC1_BRANCH_PILOT=1 FC1_OURS=1 FC1_FUSED=1 FC1_COMPILE_BUILD=1 AX_FAST=1 FC1_TREE_N=32 |
the measured tree configuration |
FC1_DFLASH_TREE with AX_LATTICE=1, not AX_TREE=0 |
AX_TREE_TEMP=1.55 |
the measured lattice tree shape: +3.9% (RTX PRO 6000) and +3.0% (RTX 5090) at one request for tree 16, +2.7% for tree 32 on the RTX 5090. It shapes which nodes are verified, not their number, so a round costs the same; not set under AX_NVFP4_VERIFY_PARITY=1 or AX_QUALITY_PROFILE=verified |
FC1_DFLASH_TREE |
--max-running-requests 1 --cuda-graph-max-bs-decode 1 |
only when --max-running-requests is not given; set it (and AX_CHAIN_*) for multi-user chain rounds |
| Qwen4-Exp target with any speculative algorithm | AX_QSA_RING=16 |
the stock 4-slot ring is wrong for verify windows that cross a group and refuses windows above 4 |
| Dense NVFP4 target on SM12x | --fp4-gemm-backend flashinfer_cutedsl |
only when left at auto, and not with AX_NVFP4_VERIFY_PARITY=1 or AX_QUALITY_PROFILE=verified (they keep CUTLASS). SGLang 0.5.23 auto picks CUTLASS; on the RTX PRO 6000 cute-dsl ran the 27B MLP GEMMs 23-37% faster at 8-64 rows (no gain at 128) and the served routes 6-19% faster at one client with identical greedy outputs. On the RTX 5090 (two slots, 32 GB) the tree ran 4-5% faster at one request and 8-10% at two, stock DFlash2 9-14% faster, with identical one-request outputs (report). cute-dsl compiles a kernel the first time it meets a shape: warm the server up |
DFLASH or FC1_DFLASH_TREE with --max-running-requests 8 |
--min-free-slots-delay 1 |
SGLang 0.5.23 holds each new DFlash prefill until two of eight slots are free, so eight clients ran as seven and the first-token p90 reached 0.19-0.27 s. Admitting one at a time cut it to 0.10-0.12 s on H200, B200 and RTX PRO 6000 and, with Humming, put H200 ahead of vLLM at eight clients (report). Not set under the parity profiles |
Gated-DeltaNet target, DFLASH or FC1_DFLASH_TREE, on SM100 with CUDA 13+ |
--linear-attn-prefill-backend flashinfer |
only with prefill chunks of 1-8,192 tokens and no --linear-attn-backend, deterministic inference, dynamic chunking or parity profile. SGLang picks FlashInfer prefill on SM100 only for a bf16 state; with the fp32 state the B200 ran the Triton chunk kernels. FlashInfer raised replay 8 at eight clients 9-11% and the tree at one client 2-10% on a B200; verify stays on Triton. The RTX PRO 6000 (SM120) showed no gain and keeps Triton (report) |
Gated-DeltaNet target (128-dimension heads), DFLASH or FC1_DFLASH_TREE, on SM100 |
AX_GDN_VERIFY_TILES=1, and AX_GDN_VERIFY_VIEWS=1 for DFLASH and for a tree server with replay chain rounds |
not under the parity profiles; 0 turns either off. The tiles launch SGLang's fp32 ReplaySSM ring verify on a 16-wide value tile and the window-saving verify conv on 64 channels; the views feed target verify from the projection's own strided views instead of a per-layer copy (fp32-state GDN ReplaySSM fold only). On a B200 they took 27B NVFP4 replay 8 from −5.5 / −6.7 / −7.2% to +2.6 / −3.6 / +2.0% against same-pod vLLM at eight clients. The views and the conv tile leave outputs bitwise unchanged; the ring tile sums in another order and changed 5 of 24 one-client greedy outputs (report) |
Gated-DeltaNet target (128-dimension heads), DFLASH or FC1_DFLASH_TREE with replay chain rounds, on SM100 |
AX_GDN_VERIFY_CONV=1 |
not under the parity profiles; 0 turns it off. SGLang's chain verify conv saves the K − 1 window columns after every draft token, 24 stores for the 10 columns of the deduplicated window view, after a tile that rebuilds the conv state. The plugin's kernel reads the state and each input once and stores each column once: 5.0 µs per launch against 9.4 µs at eight requests on a B200, outputs, states and windows bitwise equal. Only for launches of four requests or more (at one client SGLang's kernel served 0.5% faster); tree verify, decode and dense windows keep SGLang's kernel. Six servers each way lowered the eight-client mean request time 1.0 / 0.1 / 2.7% (report). On the tree server's replay chain rounds the views and this conv together took requests from −2.1 / −1.0 / −4.3% to +2.3 / +2.7 / −0.3% against replay 8 at two clients and from −3.2 / −4.1 / −4.5% to −0.2 / −2.0 / −2.9% at eight (report) |
Gated-DeltaNet target (128-dimension heads), DFLASH or FC1_DFLASH_TREE, on SM100 |
AX_GDN_PREFILL_POOL=1, and AX_GDN_PREFILL_GRAPH=1 unless --disable-prefill-cuda-graph |
not under the parity profiles; 0 turns either off. Both act only on SGLang's FlashInfer GDN extend with an fp32 state pool (no Mamba extra buffer). POOL runs FlashInfer in place on the pool (state_indices) instead of a gather and scatter, and the Q/K/V prepare in one launch. GRAPH gives the GDN backend SGLang's KDA prefill-graph hooks, so the breakable prefill graph captures the Gated-DeltaNet layers instead of running them eagerly: host time per prefill step fell from 23 to 2.8 ms. On a B200 they took 27B NVFP4 replay 8 from +8.6 / +2.7 / −1.9% to +16.9 / +11.7 / +5.4% against same-pod vLLM at eight clients and the first-token p50 from 63 to 41 ms; one-client greedy outputs unchanged (report). FlashInfer's chunked prefill itself runs between two graph segments over the batch's own sequences (AX_GDN_PREFILL_GRAPH_KERNEL=break, the default; graph captures it over every table slot): an empty padded sequence costs it as much as a real one, 121 µs against 35 µs for a one-sequence batch, and running it between segments lowered the eight-client mean request time 5 to 6% and raised one client 1.5 to 2.8% (report). In break mode AX_GDN_PREFILL_GRAPH_SEQS follows --max-running-requests above eight, avoiding the eager fallback at higher concurrency. The tree server takes both since 0.6.3: its mean first-token time at one client fell from 57 to 27 ms and its requests ran 24.7 / 19.6 / 11.5% faster, outputs identical on 24 of 24 prompts (report) |
Qwen3.8-27B dense target with a DFlash2 drafter, FC1_DFLASH_TREE with --max-running-requests of 2 or more, AX_CHAIN_WIDTH=8 and AX_SSM_POSITIONS, on SM100 or SM120 |
AX_GDN_CHAIN_REPLAY=1 (with --enable-linear-replayssm-spec, --mamba-ssm-dtype float32, --linear-attn-verify-backend triton) |
only when the launch meets every replay rule and uses the fused tree, including fused AX_BTREE, without AX_BTREE_NATIVE, AX_CHAIN_SCHEDULE, AX_POLICY_MODE=adaptive or a parity profile, and on SM120 without AX_CHAIN_ATTN; AX_GDN_CHAIN_REPLAY=0 keeps the state snapshots. Tree rounds and batched tree rounds write the accepted state themselves. Chain rounds write SGLang's ReplaySSM ring and fold the accepted prefix, so the pool holds no per-position state snapshots. On one GPU the radix cache may stay on. On a B200 with AX_CHAIN_ATTN=trtllm_mha the tree server then serves two to eight clients within 3% of AX replay 8 (it was 7-18% behind with snapshots), 26.7 / 14.4 / 6.6% ahead at one client, with 10 GB less memory. Hopper keeps the snapshots: on an H200 replay chain rounds were faster at eight clients and slower at two (report). See Tree server with replay chain rounds |
FC1_DFLASH_TREE with AX_GDN_CHAIN_REPLAY=1 (set or from the row above), --max-running-requests of 2 or more, on SM120 |
AX_BTREE=min(8, --max-running-requests) |
only with the fused tree and a DFlash2 lattice (AX_LATTICE=1, FC1_TREE64=1, FC1_BRANCH_PILOT=1), FC1_TREE_N of 16 or 32, no AX_BTREE_NATIVE or AX_TREE_SAMPLING, and not under a parity profile; AX_BTREE=0 keeps chain rounds. Two to eight grouped greedy requests get one tree each in one target pass instead of a chain round. Against the 0.6.2 default by mean request time: +28.0 / +19.3 / +13.0% at two clients, +19.8 / +14.9 / +3.2% at four and +3.4 / +4.8 / −0.9% at eight on an RTX PRO 6000 (eight slots), and +33.8 / +36.1 / +19.0% against same-pod vLLM at two requests on an RTX 5090, where chain rounds were level with it. Not on SM100 or SM90: with the SM100 defaults on a B200 batched trees were 6.7% faster on code at two clients and 10-18% slower on chat from two, and on an H200 slower at eight clients and on chat (SM120 report, B200 report) |
Gated-DeltaNet target (128-dimension heads), DFLASH or FC1_DFLASH_TREE with AX_GDN_CHAIN_REPLAY=1, on SM120 |
AX_GDN_VERIFY_TILES=1 AX_GDN_VERIFY_VIEWS=1 AX_GDN_VERIFY_CONV=1 |
not under the parity profiles; 0 turns each off. The same kernels as the SM100 rows above, here only for the ReplaySSM ring verify (stock DFlash2 and a tree server with state snapshots keep SGLang's). See Tree server with replay chain rounds |
Dense ModelOpt NVFP4 target, DFLASH or FC1_DFLASH_TREE, on SM90 except H100 with humming-kernels installed |
AX_NVFP4_HUMMING=1 --fp4-gemm-backend marlin |
only with the FP4 backend left at auto or marlin, and not under the parity profiles; AX_NVFP4_HUMMING=0 keeps Marlin, and is the automatic H100 choice. See Humming on Hopper |
| NVFP4 MoE target on SM110 (Jetson Thor) / SM120 | --moe-runner-backend flashinfer_cutlass, and --speculative-moe-runner-backend with speculative decoding |
only when left at auto: SGLang 0.5.23 picks TRT-LLM (SM100 only) |
The tree is refused on Qwen4-Exp targets. If the target's or drafter's config.json cannot be read (offline, a wrong revision), a tree launch stops instead of guessing: set AX_GDN_LAYERS and AX_GDN_HEADS, or AX_LATTICE (1 for DFlash2, 0 for DFlash v1), explicitly. It also stops when neither --speculative-num-draft-tokens, the drafter config nor FC1_DRAFT_BLOCK gives the draft block length. The published DFlash2 drafters list block_size 8; the measured lanes draft 16 tokens per round, so keep --speculative-num-draft-tokens 16 (the launcher prints a note about the difference). For a stock speculative route (MTP) with an unreadable target config, the launcher notes that the NVFP4 MoE backend and AX_QSA_RING defaults were not derived. A speculative launch that passes --disable-prefill-cuda-graph outside the parity path (AX_NVFP4_VERIFY_PARITY, AX_QUALITY_PROFILE=verified) gets a note: eager prefills stall the decode batch. On two B200s they cost Flash Next 26-45% of the four-client throughput, and on an RTX PRO 6000 they cost the 27B stock, tree and replay routes 7-16% at one client and 16-34% at eight (B200, RTX PRO 6000).
| Variable | Meaning |
|---|---|
FC1_TREE_N |
nodes verified per round, root included. The launch default is 32, which is the tree in the serving retests. A 64-node tree was fastest in the earlier pooled RTX sweep. 16, 32 and 64 use the plugin's host-length FlashInfer plan; other sizes use SGLang's own plan |
FC1_DRAFT_BLOCK |
tokens drafted per round (16 on the 9B and the 27B; at most 32 with FC1_TREE64=1) |
AX_LATTICE=1 |
build the tree from the DFlash2 selector lattice (needs a DFlash2 drafter). With AX_TREE=0 (chain rounds only) and no AX_LATTICE_TRACE, nothing reads the lattice, so the drafter graph is captured without it: the same greedy draft without the full-vocabulary partition (0.31 ms per round on a B200 trace) |
AX_FAST=1 |
per-round overhead fixes (no host readback of the prefix length) |
AX_GDN_LAYERS, AX_GDN_HEADS |
Gated-DeltaNet shape of the target: 48 / 48 for Qwen3.8-27B, 24 / 32 for Qwen3.5-9B |
FC1_FUSED=1 |
fused tree verifier; 0 uses SGLang's own tree verify (slower, a reference) |
FC1_NGRAM_PATH |
n-gram table of the DForkTree release, used to score trees with a DFlash (v1) drafter; lattice trees (AX_LATTICE=1) do not use it. The measured runs set it, so the example does too |
AX_CHECK=1 |
validation only: checks the mask and length bound every round (synchronous, slow) |
AX_BTREE=K |
a greedy decode batch of 2..K requests (K at most 8) gets one DFlash2 lattice tree per request (FC1_TREE_N nodes each), verified in one target forward, instead of a chain round. Off (0) unless the launch defaults set it: on SM120, with replay chain rounds, K is --max-running-requests up to 8. Needs AX_LATTICE=1, FC1_TREE64=1 and FC1_BRANCH_PILOT=1. With FC1_FUSED=1, FC1_TREE_N is 16, 32 or 64, so the 32-node default can serve one request and a batch of 2..K. With AX_SSM_POSITIONS=P the fused kernels commit the accepted state in place, as for the one-request tree, so the intermediate SSM cache keeps P positions per slot (needed on a 32 GB RTX 5090); AX_BTREE_NATIVE=1 leaves the rounds to SGLang's native GDN tree verify and then needs the radix cache off when AX_SSM_POSITIONS is set. On SM120 a fused AX_BTREE launch takes the replay default for its chain rounds. The earlier RTX PRO 6000 study used 16-node trees (results/rtx_pro_6000_tree_width/REPORT.md): +17% at two requests and +26% at four over the chain rounds, while the native kernels gain 0-2%. Host prefix lengths are read back from the device once per batched round |
AX_TREE_TEMP, AX_TREE_BRANCH_PENALTY, AX_TREE_TAIL, AX_TREE_LMAX |
need AX_LATTICE=1. The launch defaults set AX_TREE_TEMP=1.55 (see above); AX_TREE_TEMP=1 with the other defaults 0, 1, 99 keeps the plain lattice search. They shape which FC1_TREE_N nodes the lattice tree verifies (one tree per request, AX_BTREE included): rows and tail divided by the temperature before the softmax, a log-score cost per branch off a row's argmax, whether the mass outside the top-k counts, and at most AX_TREE_LMAX such branches along a path. Greedy outputs do not change; only the accepted length does. benchmarks/sglang/tune_tree_optuna.py searches them offline on lattice traces |
AX_LATTICE_TRACE=<file> |
diagnostics only, needs AX_LATTICE=1: one JSON line per request and decode round with the round's verified tokens, its accept length and, when the draft graph ran, the DFlash2 lattice it was drafted from. benchmarks/sglang/simulate_lattice_tree.py replays the recording to price chain widths and tree shapes offline. Reads back to the host every round; keep it out of speed runs |
AX_QSA_RING=16 |
Qwen4-Exp (Qwen3.8-Flash-Next) QSA sparse attention: widen the per-request pending index-key ring from 4 to 16 slots. Fixes compressed index keys built from overwritten ring members whenever a verify window crosses a 4-token group (stock SGLang 0.5.23, MTP 1-3 included) and allows verify windows up to 13 tokens (stock refuses more than 4). Works with stock MTP (--speculative-algorithm EAGLE); the tree is not supported on Qwen4-Exp |
AX_NORM_FP4=1 |
experimental, off by default: fuse the Qwen3.5 dense post-attention Gemma add-RMSNorm with gate_up's NVFP4 input quantization (vLLM's kernel). It normalizes the fp32 sum where FlashInfer normalizes the rounded bf16 sum, so greedy outputs change (18 of 24 one-client outputs on a B200). Refused with AX_NVFP4_VERIFY_PARITY=1; skipped on Humming layers (report) |
AX_QSA_CHECK=1 |
validation only: counts QSA groups compressed from ring members that do not hold their group's positions (eager, --disable-cuda-graph) |
AX_PLE_FRESH_FILE |
on by default. With --ple-offload-backend file, unlink the previous boot's PLE table file so the full rewrite goes to a new sparse file (a filled file under SGLang's MADV_RANDOM wrote at 27 MB/s on a Jetson Thor). 0 keeps SGLang's reuse |
AX_ADAPTIVE_LIVE=<file> |
tuning only: with --speculative-adaptive, re-read the adaptive policy (the --speculative-adaptive-config format plus "version") from this file when it changes, polled at most every AX_ADAPTIVE_LIVE_POLL_S seconds (0.5). Only steps captured at boot are accepted; <file>.ack reports each reload and the verify batches per step under the previous policy. benchmarks/sglang/optuna_spec.py drives it |
B200 multi-user server for the 27B (tree at one request, chain rounds of width 16 / 8 with their own
CUDA graphs on trtllm_mha): see benchmarks/sglang/run_stage1a.sh for the full flag set
(AX_CHAIN_ATTN=trtllm_mha AX_CHAIN_GRAPH_WIDTHS="16 8" AX_CHAIN_DRAFT_WIDTHS=8, 16 slots bf16 or 32
NVFP4, prefill on trtllm_mha, tree verify on triton). Set HYBRID=0 to use Triton
for the target, drafter and private chain runners.
Qwen3.8-Flash-Next with stock MTP and the ring fix (AX_QSA_RING=16 is the launch default for
Qwen4-Exp; it is spelled out here because SGLang 0.5.22 needs it):
AX_QSA_RING=16 ax-engine-sglang serve RadixArk/Qwen3.8-Flash-Next-NVFP4 \
--speculative-algorithm EAGLE --speculative-num-steps 7 --speculative-eagle-topk 1 \
--speculative-num-draft-tokens 8
The measurement lanes axtree<spec> (venv SGLang) and axotree<spec> (0.5.22 overlay) in
benchmarks/sglang/run_tree_plugin.sh run the standalone plugin's DFlash tree configuration.
The axtree lanes use AXSITE and the venv. Lattice lanes use DFlash2 scores
and can run without an n-gram table.
Benchmark results
Grouped by GPU: B200, RTX PRO 6000, RTX 5090, then Jetson Thor. Within a GPU, Qwen3.8-Flash-Next comes before Qwen3.8-27B, and BF16 comes before NVFP4. The top-level README summarizes the current serving retest. The full tables are in Serving performance.
B200
Two studies, both greedy, SGLang 0.5.23, one B200. Read the serving retest when comparing routes on the shared 128-token corpus. Read the earlier study for concurrency up to 64 and for TensorRT-LLM 1.4. Jetson Thor is measured separately. Jetson Thor
Latest same-pod comparison with stock vLLM, one to eight clients. Since 0.6.3 the tree server takes the SM100 launch defaults too (GDN prefill pool and graph, replay chain rounds, ring verify views and conv). Output tok/s and mean request time against four stock vLLM DFlash2 servers on the same pod (code / math / chat, positive is faster):
| Lane | Servers | 1 client | 2 clients | 4 clients | 8 clients |
|---|---|---|---|---|---|
| Stock vLLM DFlash2, tok/s | 4 | 748.2 / 624.6 / 412.3 | 994.8 / 926.1 / 596.9 | 1,331.2 / 1,396.5 / 926.0 | 2,080.3 / 2,190.7 / 1,449.6 |
| AX GDN replay 8, tok/s | 5 | 858.7 / 761.3 / 470.7 | 1,254.0 / 1,273.3 / 757.8 | 2,075.7 / 2,224.2 / 1,348.2 | 3,087.0 / 3,434.8 / 2,128.8 |
| AX tree 32, tok/s | 4 | 1,087.7 / 870.3 / 501.6 | 1,312.2 / 1,327.2 / 754.1 | 2,162.6 / 2,259.4 / 1,310.0 | 3,295.9 / 3,494.4 / 2,088.3 |
| AX GDN replay 8 against vLLM | +14.8 / +22.0 / +14.2% | +33.4 / +37.9 / +27.2% | +61.1 / +59.6 / +49.1% | +54.8 / +62.9 / +51.3% | |
| AX tree 32 against vLLM | +45.6 / +39.5 / +21.7% | +36.4 / +41.7 / +26.9% | +61.2 / +60.4 / +45.9% | +54.4 / +59.7 / +46.8% | |
| AX tree 32 against AX GDN replay 8 | +26.7 / +14.4 / +6.6% | +2.3 / +2.7 / −0.3% | +0.1 / +0.5 / −2.1% | −0.2 / −2.0 / −2.9% |
The tree launch is --attention-backend triton --speculative-draft-attention-backend trtllm_mha --chunked-prefill-size 8192 with AX_CHAIN_WIDTH=8 AX_SSM_POSITIONS=8 AX_CHAIN_ATTN=trtllm_mha; the
other settings come from the launch defaults. With the 0.6.2 defaults the same launch was 15-26%
behind replay 8 from two clients. vLLM ran 9-27% slower on this pod than the same build on the pod of
the next paragraph; against that pod's request times the tree server is +30.8 / +26.0 / +12.0% at one
client and +14.3 / +23.5 / +18.4% at eight. --prefill-attention-backend trtllm_mha adds 0.7 / 2.7 /
3.5% at one client and changes greedy outputs.
B200 tree server report
Earlier same-pod comparison, replay 8. With the SM100 launch defaults
(GDN verify tiles, views and conv, AX_GDN_PREFILL_POOL, AX_GDN_PREFILL_GRAPH),
AX GDN replay 8 ran 2,899.5 / 3,304.1 / 2,170.8 tok/s at eight clients, +9.6% /
+19.5% / +21.7% against five stock vLLM DFlash2 servers on the same pod, and
835.3 / 740.7 / 457.6 at one client (+0.3% / +7.2% / +2.1%); six AX servers.
Eight-client code tok/s follows one request with two greedy continuations
(sweeps read about 2,700 or 3,300 tok/s); a code request took 0.265 s on
average against 0.299 s on vLLM.
Report
Serving retest, 128 tokens, eight slots, package 0.5.1. Code / math / chat output tok/s. The add-on used a 32-node tree at one request and a width-eight chain when requests were grouped.
| Clients | Stock DFlash2 | AX tree/chain | AX GDN replay |
|---|---|---|---|
| 1 | 448.5 / 408.1 / 281.3 | 632.5 / 516.5 / 333.8 | 456.6 / 415.3 / 286.6 |
| 8 | 1,438.4 / 1,172.9 / 903.2 | 1,503.0 / 1,206.6 / 790.1 | 1,599.5 / 1,428.3 / 949.6 |
GDN replay led at eight clients by 11.2% / 21.8% / 5.1%. Retest
Earlier 1,024-token study. 64 prompts per family. Full records: dual attention backend, Flash-Next.
| Model | Mode | Result vs. stock SGLang |
|---|---|---|
| Qwen3.8-Flash-Next NVFP4 | stock MTP 7 + AX_QSA_RING=16 vs. stock MTP 3 |
code 1.22x-1.30x, math 1.05x-1.15x, chat 0.80x-0.86x |
| Qwen3.8-27B bf16 | tree at 1 request, chain width 8 / 16 above (16 slots) | c = 1: 1.09x-1.15x vs. the faster stock block; c = 2-16: 0.93x-1.09x |
| Qwen3.8-27B NVFP4 | tree at 1 request, chain width 8 / 16 above (32-64 slots) | c = 1: code 1.42x, math 1.33x, chat 1.14x; c = 2-64: 1.01x-1.21x |
| Qwen3.8-27B, both | vs. TensorRT-LLM 1.4 DFlash2 | c = 1: 1.07x-1.72x; c = 16 chat 0.81x-0.90x (engine round cost) |
| Qwen3.8-27B, both | tree 32 vs. TensorRT Edge-LLM 0.12.0 DDTree 32 on Jetson Thor | c = 1: code 1.49x-1.58x, math 1.31x-1.34x, chat 0.98x-1.01x |
Correctness checks: greedy token identity against the plugin's earlier builds (192 / 192), fp32 teacher audit at the stock mismatch rate, stress runs with aborts, sampled tree verify matching plain decoding on 28 / 28 distribution tests (bf16), QSA ring consistency check (Flash-Next).
Limits:
- Tree rounds serve one greedy request without grammar or logprobs. Every other batch, and one
sampled request unless
AX_TREE_SAMPLING=1, runs a stock DFlash2 chain round. - Tested targets: Qwen3.5-9B and Qwen3.8-27B (Gated-DeltaNet hybrids). On Qwen3.8-Flash-Next (Qwen4-Exp) only the QSA ring fix applies; SGLang does not expose its aux hidden states (needed by DFlash2) and the tree needs the PLE n-gram context.
- MTP 12 on Flash-Next needs
--max-running-requests 32(the GDN state pool grows with the draft length). Wider MTP is slower on chat; choose the step count per workload.
RTX PRO 6000
Latest same-pod comparison with stock vLLM. With the SM120 launch defaults (GDN replay for the tree server's chain rounds and the three verify kernels), the tree server led vLLM DFlash2 on every workload: 436.1 / 366.6 / 211.5 output tok/s at one client (+48.4 / +30.1 / +23.8%) and 1,403.7 / 1,340.6 / 826.2 at eight (+40.0 / +47.7 / +17.6%), eight servers against six. Use the launch in Tree server with replay chain rounds. Report
The current single-request default is a 32-node tree (FC1_TREE_N=32).
On the earlier per-workload NVFP4 retest that tree led stock DFlash2 at one client
(324.7 / 270.9 / 152.2 against 229.3 / 188.5 / 125.2 output tok/s on code /
math / chat). At eight clients, accepted-prefix GDN replay led
(996.8 / 898.1 / 580.8). For that chain, set AX_CHAIN_WIDTH=8,
AX_CHAIN_GRAPH_WIDTHS=8, AX_CHAIN_DRAFT_WIDTHS=8, and
AX_SSM_POSITIONS=8.
Retest
An earlier sweep pooled ten frozen prompts. There a 64-node tree reached 156.87 output tok/s at 0.818 s median request latency (2.88× packed AR, 1.26× stock DFlash2). At eight requests, stock DFlash2 averaged 489.86 tok/s and tree 32 with a width-eight chain averaged 484.78. Packed AR reached 388.29. Tree 64 matched packed AR on one of ten complete outputs per pass. Pooled sweep
For a recorded token-for-token match, use AX_QUALITY_PROFILE=verified
with AX_TREE=0 and a draft block of 8. That route matched serialized AR
on RTX PRO 6000 at 128 and 1,024 tokens. The tree route is refused.
Batched lattice trees. AX_BTREE=K gives each of two to K greedy requests its own tree in one
target pass, in place of a chain round. With replay chain rounds it is the SM120 default
(AX_BTREE = min(8, --max-running-requests)): on the 128-token retest with 32-node trees and eight
slots, requests ran 28.0 / 19.3 / 13.0% faster at two clients, 19.8 / 14.9 / 3.2% at four and
3.4 / 4.8 / −0.9% at eight than on the same server with chain rounds (mean request time, four servers
against three),
with one-client outputs identical on 24 of 24 prompts and 0.7 GB more memory. 16-node trees were the
better batch tree from four clients (36.0 / 16.4 / 9.2% at four) and the worse one below; a node
count per batch size is not implemented.
SM120 batched trees
The earlier study used 16-node trees on 200 prompts with 256 tokens: 395.1 / 678.8 tok/s at C2 / C4
against 336.6 / 536.8 for tree 16 with chain rounds (+17% / +26%), and 407.7 / 689.0 with
AX_TREE_TEMP=1.55. SGLang's native GDN tree kernels (AX_BTREE_NATIVE=1) gained 0-2%.
Batched trees
RTX 5090
One 32 GB RTX 5090 fits the 27B NVFP4 tree lanes with two slots, 4,096 KV tokens and
AX_SSM_POSITIONS=8 (--mem-fraction-static 0.94 --chunked-prefill-size 512).
Latest same-pod comparison with stock vLLM (128-token retest, code / math / chat). The SM120
launch defaults give this launch replay chain rounds and batched trees (AX_BTREE=2):
| Lane | Servers | Output tok/s, 1 client | Output tok/s, 2 clients | Request time against vLLM, 1 client | 2 clients |
|---|---|---|---|---|---|
| Stock vLLM DFlash2 | 3 | 328.2 / 281.2 / 183.5 | 511.3 / 483.8 / 301.5 | ||
| Stock SGLang DFlash2 | 2 | 352.4 / 287.2 / 172.8 | 473.9 / 475.8 / 284.0 | +7.4 / +2.2 / −5.8% | −3.1 / +0.6 / −6.2% |
| AX tree 32, chain rounds (0.6.2 default) | 5 | 459.0 / 372.5 / 221.5 | 514.4 / 518.0 / 301.9 | +39.9 / +32.5 / +20.7% | +4.2 / +7.1 / −0.4% |
| AX tree 32, batched trees (default) | 5 | 458.8 / 372.1 / 221.2 | 646.0 / 655.0 / 356.4 | +39.8 / +32.3 / +20.6% | +33.8 / +36.1 / +19.0% |
The batched launch peaks at 28.9 GB; with four slots and 8,192 KV tokens it peaks at 30.1 GB and serves four clients 8.4 / 18.3 / 11.8% faster than chain rounds by mean request time. A tree server with state snapshots did not start with four slots. SM120 batched trees
An earlier study, with AX_TREE_TEMP=1.55, 200 prompts and 256 tokens, output tok/s:
| Route | C1 | C2 |
|---|---|---|
| AX GDN replay, DFlash2 chain 16 | 187.6 | 338.5 |
| AX tree 16, chain 8 above one request | 220.4 | 307.7 |
AX tree 32 (FC1_TREE_N=32) |
237.8 | 310.6 |
AX batched trees (AX_BTREE=2) |
220.2 | 370.6 |
That study used 16-node batched trees. The fused kernels now also run 32- and 64-node trees, so one server can keep tree 32 when one request is live and when two are live. RTX 5090 results
Jetson Thor
Jetson Thor (SM 11.0, aarch64, 122 GB unified memory) runs the same commands as above on
lmsysorg/sglang:v0.5.23-cu130; the launch defaults detect SM110. Measured single-request output
throughput (greedy, 12 prompts, 512 tokens; 27B bf16: 8 prompts, 384 tokens), code / math / chat:
| Target | AR | Stock chain 16 | TensorRT Edge-LLM DDTree 32 | ax-engine-sglang tree |
|---|---|---|---|---|
| Qwen3.8-27B bf16 | 4.6 / 4.6 / 4.6 | 43.1 / 29.6 / 12.5 | 30.1 / 28.8 / 18.2 | 47.5 / 37.6 / 18.3 |
| Qwen3.8-27B NVFP4 | 13.4 / 13.5 / 13.5 | 93.0 / 73.5 / 30.6 | 71.4 / 68.8 / 44.2 | 106.1 / 92.1 / 43.1 |
| Qwen3.5-9B bf16 | 14.8 / 14.9 / 14.9 | 118.7 / 78.0 / 31.3 | not run | 125.5 / 98.2 / 46.2 |
All SGLang rows use FlashInfer attention. TensorRT Edge-LLM 0.12.0 served the same checkpoints, drafter and prompts; its AR matched SGLang AR. On Flash Next NVFP4 its MTP3 ran 6% below stock SGLang MTP3. Edge-LLM results. Full tables (Triton, vLLM, MTP, teacher checks) and the two-host Flash-Next run are in the Thor report.
Settings that differ from a discrete GPU:
--mem-fraction-staticis a fraction of the memory free at start-up, and CUDA's free figure on Jetson excludes page cache. Drop the page cache before starting the server (sync; echo 3 > /proc/sys/vm/drop_cachesas root) and pass--mem-fraction-static 0.70 --chunked-prefill-size 2048for the 9B and the 27B NVFP4,0.80for the 27B bf16. With other services holding about half of the memory,0.70still serves the 9B and the 27B NVFP4 tree (about 87k KV tokens on the 27B NVFP4).- Stock MTP on the 27B bf16 also needs
--max-running-requests 4: the Gated-DeltaNet state pool for the default request count leaves no KV cache. - One Thor served Qwen3.8-Flash-Next NVFP4 with the FP8 PLE table on NVMe
using
--ple-offload-embedding --ple-offload-backend file. The study used an 8,192-token KV pool and up to four simultaneous client requests. Single-Thor memory settings and adaptive MTP results - The two-host Flash Next NVFP4 run used SGLang pipeline parallelism
(
--pp-size 2 --nnodes 2 --dist-init-addr <rank-0 host>:29500 --node-rank {0,1},SGLANG_PP_LAYER_PARTITION=4,44,--mem-fraction-static 0.90,--max-running-requests 4, andSGLANG_ENABLE_PP_SPEC=1for MTP), each host loading a stage directory that lists only its own shards. Without InfiniBand, setNCCL_IB_DISABLE=1andNCCL_SOCKET_IFNAME/GLOO_SOCKET_IFNAMEto the Ethernet interface. The report gives the coordinator script. Flash-Next bf16 does not fit two Thors. - NVFP4 targets: a fresh prefill and AR decoding disagree on about 3% of tokens on SM110, for stock AR as well, so greedy identity and the teacher check cannot qualify NVFP4 routes on Thor. Qualify exact-output requirements on bf16.
Also measured on Thor with the 9B: sampled tree verify (AX_TREE_SAMPLING=1) matched stock AR
on 28 of 28 distribution tests, and a server with --max-running-requests 4 passed the mixed
request and stress checks (2,000 requests, 178 cancelled) at the stock DFlash rate for two and
four requests. Not qualified on Thor: AX_EAGLE_JOINT_SAMPLING and AX_DFLASH_JOINT_SAMPLING
on a served model (their kernel-level checks pass on SM110), and AX_QSA_STABLE_TOPK on a
served model. The CUDA checks used in the Thor report passed on SM110. The NVFP4 parity check
requires SM120.
Launch check, quality profile and adaptive chain width
ax-engine-sglang doctor applies the launcher's rules to the target's and
drafter's config.json without loading weights or starting SGLang. It takes
the model and the speculative flags of the launch and reads the same AX_*
variables. --sm 12.0 checks another GPU's compute capability and --json
prints the report for scripts. Flags outside the launch rules, such as
--port, are listed as not checked. The command exits with status 1 when the launch
would be refused.
AX_QUALITY_PROFILE=verified AX_TREE=0 ax-engine-sglang doctor RadixArk/Qwen3.8-27B-NVFP4 \
--speculative-algorithm FC1_DFLASH_TREE \
--speculative-draft-model-path incoai/Qwen3.8-27B-DFlash2 \
--speculative-num-draft-tokens 8
The report gives supported, experimental or unsupported, the derived
settings, the exact-output qualification of the GPU, target and route, and
whether the launch could use GDN replay. It claims exact output only for a
verified-profile launch the launcher would start: a verified launch it
reports as unsupported makes no claim. It does not estimate GPU memory.
| Variable | Meaning |
|---|---|
AX_QUALITY_PROFILE=verified |
run the parity path (AX_NVFP4_VERIFY_PARITY=1 and its defaults) and refuse to start unless qualification.py lists an exact-output measurement for the GPU, target and route. Needs SGLang 0.5.23 launch defaults. It sets the measured lane and refuses other values. Speculative serving needs the chain route: AX_TREE=0 with --speculative-num-draft-tokens 8 (the launcher sets FC1_TREE_N=8 and AX_CHAIN_WIDTH=8); the tree route is refused. Every route: --chunked-prefill-size 4096 (larger is accepted) and --disable-prefill-cuda-graph; AX_TREE_SAMPLING=1 is refused. The launcher prints how many sequences were measured and the conditions of the measurement |
AX_QUALITY_PROFILE=fast |
the launcher prints that the launch makes no exact-output claim; refuses AX_NVFP4_VERIFY_PARITY=1 |
AX_CHAIN_WIDTH_BY_BATCH |
chain width by the number of requests in the round, as requests:width entries from 1 request upwards: 1:16,4:8 verifies 16 tokens with up to three requests and 8 with four or more. Every width needs a graph in AX_CHAIN_GRAPH_WIDTHS. Replaces AX_CHAIN_WIDTH; refuses AX_CHAIN_SCHEDULE, AX_POLICY_MODE=adaptive, AX_NVFP4_VERIFY_PARITY=1, the verified profile, --dp-size above 1 and --disable-decode-cuda-graph. Needs --max-running-requests above 1 to have an effect. The doctor reports it as experimental. 1:16,4:8 and 1:16,5:8 were measured on RTX PRO 6000 (below) |
AX_POLICY_MODE=adaptive |
experimental: choose each chain round's width among AX_CHAIN_GRAPH_WIDTHS (at least two) from measured accepted tokens and round time, per batch-size group. AX_CHAIN_WIDTH, else the widest graph width, serves until every width is measured. One GPU (TP1, PP1, DP1). Refuses AX_CHAIN_SCHEDULE, AX_NVFP4_VERIFY_PARITY=1, AX_GDN_CHAIN_REPLAY=1, --speculative-adaptive and a graph width above the draft block |
AX_ADAPTIVE_MIN_SAMPLES, AX_ADAPTIVE_MARGIN, AX_ADAPTIVE_COOLDOWN, AX_ADAPTIVE_EXPLORE |
adaptive policy: samples per width before a decision (32), gain needed to switch (0.08), rounds between switches (50), rounds between samples of the other widths (32) |
The qualification rows cover Qwen3.8-27B NVFP4 on SM120 (RTX 5090 and RTX PRO
6000). AR and chain 8 are exact_measured: on an RTX PRO 6000 every sequence
equalled the AR reference at concurrency 1, 2 and 8 (1,000 of 128 tokens, 120
of 1,024 tokens, ten distinct prompts). The tree route is experimental: it
matched for 128 tokens, and two of ten prompts differed in 1,024-token outputs.
See docs/reports/2026-11-21-verified-profile-gate.md.
On an RTX PRO 6000 the better fixed chain width depends on the batch. With 200
distinct prompts (256 tokens each, radix cache off, two sweeps), width 8 was
4.7% slower than width 16 with two requests, 3.0% faster with four and 9.8%
faster with eight. AX_CHAIN_WIDTH_BY_BATCH="1:16,5:8" with
AX_CHAIN_GRAPH_WIDTHS="16 8" matched width 16 with two requests (+1.4%) and
four (+0.3%) and was the fastest lane with eight (+10.6% over width 16), but
with four requests it still ran width 16, 2.6% below width 8.
AX_CHAIN_WIDTH_BY_BATCH="1:16,4:8" was within 1% of the better fixed
width with two, three, four and eight requests (+0.7% over width 16 with three,
−0.2% against width 8 with four) in a second fixed-concurrency comparison.
On mixed waves of 1, 2, 4, and 8 clients, fixed width 8 led at 445.6 tok/s
and the table reached 434.0. Mixed-wave results
1:16,3:8 was 1.8% below width 16 with
three requests, where width 16 is still slightly faster than width 8. A schedule alternating 31 rounds of width 16
with one of width 8 (two switches every 32 rounds) stayed within 1% of fixed
width 16, so switches at that rate cost nothing measurable.
Compare widths on many distinct prompts. Without the verified profile, greedy outputs depend on the batch and the chain width, so the generated text and its acceptance differ between lanes. On ten prompts the same schedule was 4% to 9% below width 16 with two requests, a loss the 200 prompts did not reproduce.
The adaptive policy stays experimental and the default stays static. On the
200 prompts it was 2.3% below width 16 with two requests, 1.2% above width 8
with four (its two sweeps differed by 3%) and 0.6% below width 8 with eight. Its
choices appear under adaptive in the round statistics the worker prints every
1,000 rounds.
With the radix cache on, SGLang may run fewer requests than
--max-running-requests: it logs max_running_requests is capped to N by the mamba state cache. Eight slots became three on a 97 GB GPU at
--mem-fraction-static 0.82; --disable-radix-cache or a larger
--max-mamba-cache-size restores them.
Maintenance and validation
Startup parses and validates the tree/chain configuration before installing
upstream hooks. QSA/RNG fixes can load without constructing a DFlash worker;
tree hooks load when their flags or the custom algorithm request them. Supported
SGLang versions are 0.5.22 and 0.5.23. AX_ALLOW_UNTESTED_SGLANG=1 permits an
explicit porting experiment; exact source-anchor checks still apply.
Round policy is pure Python in policy.py. runtime.py keeps round decisions,
planning lengths and fused GDN buffers on each worker. Startup patches use
compat.py to restore replaced attributes on failure. SSM allocation and budget
hooks are compiled together before either replacement is published.
Tree rounds read fresh logits or a lattice from the drafter's sampler folded
into its CUDA graph. Eager drafts and draft graph misses use chain verification
for the round, including when the server was launched with the tree algorithm.
When chain verification keeps a prefix of a wider draft, it keeps the sampled
candidate IDs and proposal probabilities for those same positions.
The package owns ax_fast.py and ax_lattice.py; benchmarks/sglang/dft_*.py preserve the
older research imports. Legacy DForkTree overlays copy the package-owned files.
Shared commit fixtures and benchmark evidence schemas live in ../contracts/;
see maintenance boundaries.
Run the CPU checks from the repository root. Install setuptools>=77, wheel,
scipy and jsonschema in the test environment, as in the CPU workflow.
python -m unittest discover -s ax-engine-sglang/tests -v
python scripts/check_engine_contracts.py --validate-schema
python scripts/check_engine_contracts.py --peer /path/to/ax-engine
python benchmarks/sglang/test_dft_lattice.py --plugin ax-engine-sglang/ax_engine_sglang
python benchmarks/sglang/test_paired_ci.py
CUDA checks include benchmarks/sglang/test_dft_fast.py, benchmarks/sglang/test_tree_gdn.py, and
ax-engine-sglang/tests/gpu_runtime_check.py (its header lists the flags).
gpu_ple_offload_check.py checks pinned-host PLE reads and CUDA replay, including
large offsets. gpu_qsa_diagnostic_check.py checks multimodal QSA diagnostics
against real ring-overwrite and RoPE-store negative controls.
gpu_nvfp4_moe_check.py checks SM110 (Jetson Thor) / SM120 CUTLASS weight preparation, nonzero MoE
execution and changed-input graph replay before loading Flash Next weights.
scripts/check_model_regression.py --help describes the bounded comparison
against an earlier checkout with local target/drafter checkpoints. It checks
greedy identity, mixed request types and post-request state reuse. Optional
--stress-requests, --sampling-n, --sampling-seed and --long-context controls
exercise cancellation, sampled distributions and longer contexts. The stress
check requires matching idle pool usage and an observed abort when cancellation
is enabled. Use
--candidate-only --route ar|mtp3|mtp7|mtp12 for Flash Next, with a local model
and --model-override for pinned FP8 PLE on a 96 GB card. --qsa-ring 16 --qsa-check --eager enables the synchronous ring diagnostic. The runner refuses
Flash Next tree verification until PLE/QSA tree support exists. The RTX
development checks cover correctness and lifecycle behavior. See the
RTX validation plan
and installed-wheel QA results.
The independent RTX BF16 distribution control passes; the NVFP4 AR/chain
comparison fails and remains outside cross-route lossless qualification.
For Flash Next NVFP4 on SM110 (Jetson Thor) and SM120 the runner must be
flashinfer_cutlass for the target and the MTP draft. SGLang 0.5.23's automatic
NVFP4 MoE selection can prepare a different weight layout from the runner it
later chooses (g1_scale_c missing during graph warmup). The plugin's launch
defaults select CUTLASS when both are left at auto; benchmark harnesses still
pass the backends explicitly so they appear in the saved launch command.
Sampling defaults to the server RNG. Paired comparisons use --server-seed for
the baseline and the next seed for the candidate, and enforce
sampling_dist_check.py compare A B --require-independent-seeds. A single lane
uses the requested server seed unchanged and records
sampling_comparison: not_run_single_lane. Collection sidecars record the
effective seed mode, tokenized prompt hashes, and a hash of the completed sample file.
Request-seed collection requires --candidate-only and
--enable-deterministic-inference; correlated request-seed cohorts cannot be
used for the independent two-sample test. SGLang otherwise ignores that request
field. The distribution gate requires at least 10 samples per prompt in each
cohort and reports an inconclusive result when low expected counts force all
observed differences into one cell.
For failure diagnosis, --repeat-reference checks reference stability before
stress, and stress records retain the before/after token arrays.
--candidate-only --keep-server-on-failure keeps an owned failed server resident
and writes its process-group stop command to retained-server.json. Each model
run also saves a copy of the harness source for replay.
AX_QSA_STABLE_TOPK=1 (runner: --qsa-stable-topk) selects a fixed-shape,
stable tensor-sort fallback for QSA. It supports CUDA graph replay on SM120,
where the native deterministic FilteredTopK path needs more shared memory than
the device provides. Equal scores select the smaller relative block index.
gpu_qsa_topk_check.py covers ragged rows, ties, replay and hook rollback (it also passes on
SM110; a served Flash-Next model with this option was not run on Jetson Thor).
This is an opt-in correctness control; its throughput is not qualified.
AX_EAGLE_JOINT_SAMPLING=1 matches AR's FlashInfer top-k/top-p filter during
target-only EAGLE verification on SGLang 0.5.23. Both filters use the original
probabilities. The option applies when both cutoffs are active and min-p is
disabled. NVFP4 model logits can still differ between AR and block verification.
gpu_eagle_sampling_check.py checks the filter against FlashInfer's AR sampler.
AX_DFLASH_JOINT_SAMPLING=1 (runner flag --dflash-joint-sampling) applies
FlashInfer AR's joint top-k/top-p filter to target probabilities in
FC1_DFLASH_TREE chain rounds on SGLang 0.5.23. It applies when both cutoffs
are active and min-p is disabled. Rejection sampling retains the drafter's
proposal probabilities, and sampling-mask capture uses the same target filter.
gpu_dflash_sampling_check.py checks the target support and frequencies against
the FlashInfer AR sampler on CUDA.
For the B200 Qwen3.8-27B NVFP4 sampled profile, use --attention-backend flashinfer --fp4-gemm-backend flashinfer_cutlass with checkpoint-selected FP8
KV. Enable AX_GDN_UNPACKED_DECODE=1 on the AR reference and
AX_DFLASH_JOINT_SAMPLING=1 on the DFlash2 service with chain width 8. The
profile passed all 28 distribution checks at the specified cutoff. AR and
DFlash2 produced identical greedy token sequences for two of seven prompts.
B200 retest and commands ·
Greedy token identity and logit example
The RTX PRO 6000 retest passed real NVFP4 serving and kernel checks. Recurrent GDN tree and chain each matched four of seven greedy outputs against RTX AR. RTX PRO 6000 model and kernel results
For the dense Qwen3.8-27B NVFP4 checkpoint on SM12x, the regression runner
accepts --nvfp4-verify-parity for AR, DFlash2 tree and chain.
It selects FlashInfer paged attention, CUTLASS NVFP4 and unpacked GDN.
The default per-tensor FP8 projection uses a fixed Triton tile in prefill,
decode and verification to keep the accumulation order stable. The serving
Python must be able to import cutlass.cute from NVIDIA CUTLASS DSL. Use the
option on both sides of a greedy comparison, because it changes the AR
numerical reference. --nvfp4-parity-rows (AX_NVFP4_PARITY_ROWS, default 0)
must also match on both sides. A value from 1 to 64 keeps SGLang's FP8 kernels
and pads AR decode and verification to groups of that many rows; that mode
matched only with one request in flight.
With the current source checkout on GeForce RTX 5090, AR, tree and chain each matched the serialized AR reference on 100 of 100 fixed-length requests with a 4,096-token prefill chunk limit. A 512-token limit changed the 2,266-token prompt's output at concurrency two. RTX 5090 parity retest
When you launch a server yourself, AX_NVFP4_VERIFY_PARITY=1 is enough on
SGLang 0.5.23. The launch defaults add FlashInfer attention, the CUTLASS NVFP4
GEMM and unpacked GDN decode, and disable FlashInfer autotune, which picks
GEMM tactics by row count, and the radix cache, which was not checked with
partial prefix hits. Prefill graphs stay on. With FC1_DFLASH_TREE they also select the
16-node tree, recurrent GDN verification with FC1_FUSED=0 and the Triton
verify backend. Recurrent verification is one launch of SGLang's verify kernel
per layer, with a parent table that makes it match unpacked decode bit for bit.
AX_SSM_POSITIONS=8 lets tree 64 run with eight slots: a tree round serves one
request and uses the whole capped snapshot buffer as one row. On SM12x, GDN
decode and verification use 8 value columns per program instead of SGLang's 32;
tiles of 8, 16 and 32 gave the same bits, and parity tree 32 rose from 120.05
to 131.58 tok/s alone with the same outputs. A stock speculative algorithm, another attention or NVFP4 GEMM
backend, or AX_CHAIN_ATTN stops the launch, because those paths bypass the
matched verification. The earlier RTX PRO 6000 measurements used the generic
FP8 path and recorded matches at concurrency two, three and eight.
RTX PRO 6000 fixed-length results · One-launch GDN results · Generic FP8 GEMM results · Verification controls · Row group results
On the Flash Next AR reference server, AX_GDN_UNPACKED_DECODE=1 selects
unpacked Triton Gated DeltaNet decode before CUDA graph capture. To reproduce
the AR profile through the plugin, set SGLANG_PLUGINS=ax-engine and
AX_FI_OFFSET_FIX=0. Both MTP7 configurations passed the 28 distribution checks
against the unpacked AR reference. The packed AR comparisons still fail.
B200 sampling and throughput results
To avoid reloading unrelated target shards for Flash Next MTP, derive a compact
snapshot outside the repository with scripts/prepare_flash_mtp.py --help,
then pass it as --mtp-draft. The tool selects the loader's MTP/embedding names,
preserves model configuration and verifies every tensor's SHA-256 after writing.
It records the declared source revision in derivation.json and does not
requantize weights.
The main deployment and logit report
records clean-wheel GPU smokes and the unresolved NVFP4 AR/block-verification
differences on RTX PRO 6000, including native DFlash controls. The
27B NVFP4 B200 retest records
the follow-up attention and sampling controls. scripts/nvfp4_forward_probe.py
provides opt-in SGLang forward-hook factories and a matched-prefix analyzer.
Use eager execution and a single greedy request in flight; it rejects tree positions,
rejected speculative histories and incomplete/mismatched prompt sets. Its
synchronous replay probes preserve model outputs and are unsuitable for timing.
Metadata
Release files for ax-engine-sglang 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ax_engine_sglang-0.6.3.tar.gz | 292.7 kB | With provenance | Details for ax_engine_sglang-0.6.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ax_engine_sglang-0.6.3-py3-none-any.whl | Python 3 | none | any | Details for ax_engine_sglang-0.6.3-py3-none-any.whl |
Total release size: 489.2 kB
Release files / ax_engine_sglang-0.6.3.tar.gz
| Download URL | ax_engine_sglang-0.6.3.tar.gz |
|---|---|
| Size | 292.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9cb62eb132f073032072786287c53a88379aef62138b0fd1680814849d9ee65a
|
|
BLAKE2b-256 checksum How to use checksums |
ee1491ada5cd0b3b43e124ca89f3b2062c3b1eb6fea19b61d0771edf7753de52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / ax_engine_sglang-0.6.3-py3-none-any.whl
| Download URL | ax_engine_sglang-0.6.3-py3-none-any.whl |
|---|---|
| Size | 196.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
459e329b5987e5949e2e8f3e388d6cd0f7740c6391d8e8cec225d54279366651
|
|
BLAKE2b-256 checksum How to use checksums |
cc6ea2b6324407e9fe1ee46b5eb60deea23ceb7647e76241febdcad82e07c108
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for ax-engine-sglang 0.6.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ax_engine_sglang-0.6.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.