Deployment
Install SGLang
Install SGLang
Use an SGLang build with Amazon Ergo support and
xgrammar>=0.2.9 (required for the CONTROL-token tool-call grammar). See the SGLang installation guide for host and CUDA prerequisites.- Docker
- Python (pip / uv)
- AWS Trainium (trn3)
Pull the Amazon Ergo container image:Run the command panel’s Docker output directly on the host, or start a shell inside
Command
lmsysorg/sglang:ergo and run the Python output inside the container. See Install with Docker for container runtime setup.- Single Node · 4× GPU — smallest datacenter starting point on 1×4 GB300 (MXFP4, TP4 · EP4, DeepEP v2 + DeepGEMM).
- Low Latency — 8-GPU TP8 · EP8 All-Reduce EP (
--moe-a2a-backend none) using FlashInfer MXFP4 (--moe-runner-backend flashinfer_mxfp4) on Blackwell, SM107 Prims-TS MXFP4 (--moe-runner-backend auto) on 2×4 Vera Rubin, or DeepGEMM on MXFP8 for lowest single-request and low-concurrency latency. - Balanced · MegaMoE — 8-GPU TP8 · EP8 fused MegaMoE (
--moe-a2a-backend megamoe) over NVLink/MNNVL on GB300, 2×4 Vera Rubin (--prefill-decode-interval 48), B300, GB200, and B200 for mid-to-high concurrency, or 2× DGX Station with host-backed experts. - High Throughput — 16-GPU TP16 · EP16 · Attn-DP4 across 4×4 GB300 / GB200 or 2×8 B300 / B200 (MXFP4, MXFP8, and full BF16), or 2×4 Vera Rubin peak-throughput MegaMoE (
--prefill-decode-interval 2,--swa-full-tokens-ratio 0.05). - Overlays — enable DSpark speculative decoding (
Amazon-FMR/Ergo-dspark), switch KV cache to FP8 (fp8_e4m3), or add HiCache L1 + L2 host DRAM offload (160 GiB/rankon Vera Rubin,120 GiB/rankon Blackwell). - AWS Trainium3 — trn3.48xlarge serving (single node, or prefill/decode disaggregation over EFA up to 1M context) runs through the sglang-neuron plugin with its own launch commands; see AWS Trainium deployment.
Playground
Use the Playground to explore additional controls on top of the active Deployment command and inspect the exact diff. Any modified command is unverified until tested on your hardware.- MoE Backend — switch between
DeepEP v2 (DeepGEMM),MegaMoE (Fused),All-Reduce EP (DeepGEMM)(--moe-a2a-backend none),All-Reduce EP (FlashInfer MXFP4)on Blackwell, andAll-Reduce EP (Auto / Prims-TS MXFP4)on Vera Rubin. - DSpark Proposed Draft Tokens — shown when DSpark is active; adjust
--speculative-dspark-block-size(checkpoint default8,3on 2× DGX Station, or7 / 6 / 4to match Pareto operating points). - Prefill-Decode Interval & MegaMoE Implementation — tune
--prefill-decode-interval(paired with--prefill-decode-interval-min-bs 8) to trade interactivity for throughput, and switchSGLANG_ERGO_MEGAMOE_IMPLbetweenJIT(stocksgl-deep-gemm 0.2.9) andDeepGEMM(baked kernel inlmsysorg/sglang:ergo). - Tool Schema Enforcement — toggle
SGLANG_TOOL_STRICT_LEVEL=1to enable structural-tag tool grammar across all tools while enforcing parameter schemas on tools that setstrict: true. - Memory, Concurrency, and Scheduling — tune
--max-running-requests(auto by KV capacity standalone,48default under DSpark),--mem-fraction-static,SGLANG_ERGO_GPU_EXPERT_LAYERS(DGX Station),--disable-prefill-cuda-graph,--deepep-v2-mode(directvshybrid),--tokenizer-worker-num, adaptive prefill delayer, and--hicache-write-policy(when HiCache L2 is active).
1. Model introduction
Amazon Ergo (ErgoForCausalLM, model_type: ergo) is an open-weights reasoning and coding Mixture-of-Experts model from Amazon Frontier Model Research (FMR). It has 1.1 trillion total parameters with 55 billion active parameters per token, a 1M-token context window, and up to 128K output tokens.
Ergo interleaves 48 local sliding-window attention layers (512-token window, GPT-J RoPE) with 16 global NoPE attention layers (every 4th layer), bounding long-context KV cache growth to the 16 global layers. The feed-forward stack has 1 leading ReLU² dense layer and 63 MoE layers, each with 256 routed ReLU² experts (top-8 sigmoid routing with DeepSeek-style load balancing, routed scaling factor 2.83, and per-expert output RMSNorm) plus 1 shared ReLU² expert.
| Attribute | Specification |
|---|---|
| Developer & license | Amazon Frontier Model Research (FMR) · Amazon Ergo Open-Weights License |
| Parameters | 1.1T total / 55B active per token |
| Architecture | 64 layers (1 dense ReLU² + 63 MoE), hidden size 8,192; 256 routed experts (top-8, intermediate 4,096) + 1 shared expert (intermediate 8,192) |
| Attention | GQA (64 query heads, 8 KV heads, head dim 128, QK-norm); 48 local SWA-512 layers + 16 global NoPE layers (every 4th layer) |
| Modalities | Text-only (non-text content parts are rejected) |
| Context & output | 1,048,576-token context window (1M); 131,072-token max output (128K) |
| Reasoning & sampling | Fixed reasoning effort (reasons by default); generation_config.json defaults: temperature=1.0, top_p=0.99, max_new_tokens=131072 |
| Tokenizer & protocol | 262,144-token SentencePiece vocabulary (ErgoTokenizer) with token-level CONTROL framing for reasoning and tool calls |
Official checkpoints
| Precision / Role | Repository | Download size | Minimum NVIDIA GPU footprint |
|---|---|---|---|
| MXFP4 (primary) | Amazon-FMR/Ergo | 626 GB | 4× GB300, 8× Vera Rubin / B300 / B200 / GB200, or 2× DGX Station (host-backed) |
| MXFP8 | Amazon-FMR/Ergo-mxfp8 | 1.17 TB | 8× GB300 / B300 / GB200 / B200 |
| BF16 | Amazon-FMR/Ergo-bf16 | 2.22 TB | 16× GB300 / B300 / GB200 / B200 |
| DSpark draft | Amazon-FMR/Ergo-dspark | 6.48 GB | 3.24B BF16 5-layer draft (pairs with any target precision) |
Amazon-FMR/Ergo) · Launch Blog · License.
2. Configuration tips
Automatic runtime defaults
SGLang applies Ergo-specific defaults automatically when you leave the corresponding flags unset:- Parsers and grammar:
--reasoning-parser ergo,--tool-call-parser ergo,--grammar-backend xgrammar,--enable-strict-thinking, andthinking=Trueon/v1/chat/completions. Leave both parser flags unset —ErgoChatEncodingAdapterreads CONTROL token IDs directly and rejects text-based parsers. - Attention and MoE runners:
--moe-runner-backend deep_gemm,--moe-a2a-backend deepep_v2whenever--ep-size > 1,--attention-backend trtllm_mhaon standalone SM100/SM103/SM107 GPUs, and prefill CUDA graphs enabled by default. - Checkpoint auto-detection:
Amazon-FMR/Ergo(mxfp4) andAmazon-FMR/Ergo-mxfp8(mxfp8) declarequantization_configinconfig.json, so omit--quantization. Context length (1048576) is inherited fromconfig.json, chunked prefill defaults to16384on >=160 GiB GPUs, and--cuda-graph-max-bs-decodeis derived automatically from--max-running-requests // --attn-dp-size. - DSpark draft precision: The model override keeps
Amazon-FMR/Ergo-dsparkunquantized (BF16) even when the target uses MXFP4 or MXFP8.
Checkpoint precision and GPU sizing
Only the 256 routed experts are quantized in MXFP4 and MXFP8 checkpoints; attention projections, the leading dense layer, the shared expert, norms, router, embeddings, andlm_head stay in native precision.
| Topology & precision | Weights / GPU | Parallelism | When to pick |
|---|---|---|---|
| 4× GB300 · MXFP4 | ~147 GiB | TP4 · EP4 | Smallest single-node datacenter footprint (~10.4M FP8 KV tokens) |
| 8× Vera Rubin / Blackwell · MXFP4 | ~74 GiB | TP8 · EP8 | Best interactive latency and largest KV pool per GPU (2×4 Vera Rubin / GB300 / GB200 or 1×8 B300 / B200) |
| 8× Blackwell · MXFP8 | ~137 GiB | TP8 · EP8 | Higher weight precision on 8 GPUs; use FP8 KV on 192 GB B200/GB200 for long context |
| 16× Blackwell · MXFP4 / MXFP8 / BF16 | ~40–135 GiB | TP16 · EP16 · DP4 | High-concurrency cluster serving and the minimum topology for full BF16 |
| 2× DGX Station · MXFP4 | 38–40L GPU + host | TP2 · EP2 | Workstation deployment over 400G RDMA using host-backed experts (32K context cap) |
- Equal TP and EP.
ErgoMoEFeedForwardnormalizes each expert output before summing routes across experts, so--ep-sizemust equal--tp-size. - Shared-expert sharding (
--enable-shared-experts-attn-tp). Shards the 15.75 GiB BF16 shared expert across the attention-TP group (freeing ~13.8 GiB/GPU at TP8 and ~8 GiB/GPU at TP2) and fuses the shared-expert reduction with the routed all-reduce during decode. - FP32 LM head (
--enable-fp32-lm-head). Computes output logits in FP32 across the 262,144-token vocabulary. - Quantizing from BF16. If you start from
Amazon-FMR/Ergo-bf16or a custom BF16 fine-tune, you can quantize routed experts to MXFP8 on load with--quantization mxfp8, or convert offline once for faster startup:
Convert a local BF16 checkpoint to static MXFP4 or MXFP8
Convert a local BF16 checkpoint to static MXFP4 or MXFP8
Single-GPU conversion
--quantization mxfp8 for static MXFP8. To parallelize across multiple GPUs, pass --worker-id and --num-workers:Multi-GPU conversion (4 GPUs)
MoE dispatch and runner choices
Select Single Node · 4× GPU, Low Latency, Balanced · MegaMoE, or High Throughput in Deployment, or swap MoE backends directly in the Playground:- All-Reduce EP (
--moe-a2a-backend none). Selected by Low Latency (and used on 2× DGX Station). Pairs with--moe-runner-backend flashinfer_mxfp4on Blackwell MXFP4,--moe-runner-backend auto(SM107 Prims-TS MXFP4) on Vera Rubin MXFP4, or DeepGEMM on MXFP8. Avoids symmetric-memory buffers using a gather-free indexed finalizer and fused shared+routed all-reduce for the lowest single-request and low-concurrency latency. RequiresTP == EPwith no attention DP. - MegaMoE (
--moe-a2a-backend megamoe). Selected by Balanced · MegaMoE (and Vera Rubin High Throughput). Runs a fused SM100/SM103/SM107 kernel over NVLink/MNNVL symmetric memory that combines dispatch, MXFP4/MXFP8 grouped GEMM, per-expert output RMSNorm, and combine inside unbroken prefill and decode CUDA graphs. Use MegaMoE Implementation in the Playground to switchSGLANG_ERGO_MEGAMOE_IMPL:deepgemmenables the baked DeepGEMM MegaMoE kernel inlmsysorg/sglang:ergo(enabled by default on Vera Rubin), whilejitworks out of the box on stocksgl-deep-gemm 0.2.9. Requires MXFP4 or MXFP8 weights (not BF16) and a single NVLink/IMEX domain. - DeepEP v2 + DeepGEMM (default when unset). Selected by Single Node · 4× GPU (1×4 GB300) and 16-GPU High Throughput (TP16 · EP16 · Attn-DP4). Supports MXFP4, MXFP8, and BF16 across both single NVLink domains (
--deepep-v2-mode direct, default) and multi-node RDMA clusters (--deepep-v2-mode hybrid). SGLang validatesSGLANG_DEEPEP_V2_NUM_MAX_DISPATCH_TOKENS_PER_RANK(default128) at startup againstceil(chunked_prefill_size / (tp_size / attn_dp_size))and the decode CUDA graph verify budget — set4096for TP4 with 16K chunks, or2048for TP8 (16K chunks) and TP16 · Attn-DP4 (8K per-DP chunks).
AgentX coding-trace Pareto operating points
For long-context agentic-coding workloads on 2×4 Vera Rubin or 2×4 GB300 (TP8 · EP8, MXFP4), enable DSpark and FP8 (fp8_e4m3) KV cache in Deployment, turn on HiCache L1 + L2 at mid-to-high concurrency (160 GiB/rank on Vera Rubin, 120 GiB/rank on GB300), and tune DSpark Proposed Draft Tokens, Prefill-Decode Interval (--prefill-decode-interval, paired with --prefill-decode-interval-min-bs 8), MegaMoE Implementation (SGLANG_ERGO_MEGAMOE_IMPL=deepgemm in lmsysorg/sglang:ergo), and --max-running-requests to move along the latency–throughput frontier:
| Platform & target c | MRR | DSpark block | MoE backend (a2a + runner) | PDI | HiCache (GiB/rank) |
|---|---|---|---|---|---|
| 2×4 Vera Rubin · c=1 | 1 | 7 | none + auto (Prims-TS MXFP4) | Off | Off |
| 2×4 Vera Rubin · c=24 | 12 | 7 | megamoe + deep_gemm | 48 | 160 |
| 2×4 Vera Rubin · c=56 | 16 | 7 | megamoe + deep_gemm | 48 | 160 |
| 2×4 Vera Rubin · c=80 | 88 | 6 | megamoe + deep_gemm | 22 | 160 |
| 2×4 Vera Rubin · c=112 | 136 | 6 | megamoe + deep_gemm | 2 | 160 |
| 2×4 GB300 · c=1 | 1 | 7 | none + flashinfer_mxfp4 | Off | Off |
| 2×4 GB300 · c=8 | 16 | 6 | none + flashinfer_mxfp4 | 64 | Off |
| 2×4 GB300 · c=16 | 40 | 4 | megamoe + deep_gemm | 48 | Off |
| 2×4 GB300 · c=46 | 48 | 6 | megamoe + deep_gemm | 40 | 120 |
| 2×4 GB300 · c=64 | 72 | 6 | megamoe + deep_gemm | 16 | 120 |
c=1–8), Balanced · MegaMoE (c=16–80), or High Throughput (c=112 on Vera Rubin), layer DSpark + FP8 KV (plus HiCache L1 + L2 for c>=24 on Vera Rubin or c>=46 on GB300), and adjust --speculative-dspark-block-size, --prefill-decode-interval, and --max-running-requests (MRR, also sizing --swa-full-tokens-ratio 0.05 at c>=46 on GB300 or c>=80 on Vera Rubin). Setting MRR < c caps active decode batch size while queuing excess clients for smoother per-user interactivity.
Hybrid SWA KV cache and 1M context
Only 16 of Ergo’s 64 layers attend globally; the other 48 layers keep a fixed 512-token sliding window. SGLang’s default--swa-full-tokens-ratio is 0.8, which over-allocates the 512-token window pool at long contexts:
- Datacenter 1M context: Use
--swa-full-tokens-ratio 0.03on TP4/TP8 and0.05on TP16 · Attn-DP4 or high-concurrency TP8 MegaMoE (c>=46on GB300,c>=80on Vera Rubin) so nearly all KV memory serves the 16 global layers. - 2× DGX Station (32K context): Use
--swa-full-tokens-ratio 0.3so the smaller 9 GiB KV pool holds enough window tokens for up to 64 concurrent requests. - FP8 KV cache (
--kv-cache-dtype fp8_e4m3): Roughly doubles full-attention KV capacity (one 1M-token sequence uses ~32 GiB across the 16 global layers) and halves decode KV read bandwidth. Because KV quantization changes attention numerics, validate accuracy on your workload before enabling it in production.
Speculative decoding with Amazon-FMR/Ergo-dspark
Toggle Spec Decode → DSpark in Deployment to enable Amazon-FMR/Ergo-dspark (3.24B BF16, 5 sliding-attention layers with a 32K window).
- Minimal flags: On GB300 / Vera Rubin / B300 / GB200 / B200, SGLang reads
block_size: 8(gamma = 8, verifying 9 draft tokens per step) directly fromAmazon-FMR/Ergo-dspark/config.json, defaultsSGLANG_RAGGED_VERIFY_MODE=static, and keeps draft weights in BF16 automatically.--attention-backend trtllm_mhais added explicitly because automatic attention selection falls back to FlashInfer under DSpark unless pinned. - Draft KV cache: SGLang model overrides keep the DSpark draft KV cache in
bf16automatically (--speculative-draft-kv-cache-dtype bf16) even when the target uses--kv-cache-dtype fp8_e4m3, so no extra flag is needed and the HiCache L2 draft host pool sizes accordingly. - Batch cap: Standalone recipes leave
--max-running-requestsunset so SGLang admits dynamically up to the KV cache capacity. When DSpark is enabled, SGLang defaults to--max-running-requests 48(and derives decode CUDA graph capture up tomax_running_requests // attn_dp_size); override--max-running-requestsin the Playground when targeting a specific concurrency or Pareto operating point (or64on 2× DGX Station). - Trade-offs: The draft KV pool uses ~24% of the KV budget and each verify step costs more compute than plain decode. DSpark gives the largest speedups on structured coding and math workloads at low-to-moderate concurrency; turn it off if high-concurrency batch jobs see low acceptance lengths. On 2× DGX Station,
--speculative-dspark-block-size 3balances draft cost and acceptance.
Host-backed experts on 2× NVIDIA DGX Station
On two DGX Stations (250 GiB GB300 HBM + 494 GiB coherent host RAM per node over 400G RDMA), a TP2/EP2 rank’s MXFP4 routed experts (~290 GiB) exceed one GPU’s HBM.SGLANG_ERGO_GPU_EXPERT_LAYERS keeps the first N of 63 MoE layers in GPU HBM and pins the rest in page-locked host memory read in place by the GPU while keeping block scales, dense weights, and shared experts on GPU:
- Use
SGLANG_ERGO_GPU_EXPERT_LAYERS=38with--mem-fraction-static 0.846standalone, or40with--mem-fraction-static 0.862and--speculative-dspark-block-size 3when DSpark is enabled (add+0.016per additional GPU-resident layer). - Leave at least 1/16 of GPU HBM (~24–31 GiB) free for host-mapped driver allocations; the loader refuses to map host memory below that threshold.
- Requires
--moe-runner-backend deep_gemm(default) and a pre-quantized MXFP4/MXFP8 or BF16 checkpoint. Prefill CUDA graphs are disabled (--disable-prefill-cuda-graph) to save ~13.5 GiB of HBM per Station.
Known deployment boundaries
- Blackwell or Vera Rubin required for MXFP4 and MXFP8 on NVIDIA GPUs: Both MXFP4 (
model_overrides/ergo.py) and MXFP8 MoE kernels require NVIDIA SM100+ GPUs (Blackwell / Vera Rubin). AWS Trainium3 serves MXFP4 through its own kernels in the sglang-neuron plugin (see AWS Trainium deployment). - No pipeline or context parallelism: Scale across GPUs with
--tp-size/--ep-size(kept equal) and--attn-dp-sizewith--enable-dp-lm-head. - No EPLB / redundant experts: Do not enable
--enable-eplbor--ep-num-redundant-experts; per-expert output RMSNorm slices scales by contiguous logical expert IDs. - Text-only: Image, audio, and video content parts are rejected by the chat encoder.
3. Advanced usage
3.1 Reasoning
Amazon Ergo frames reasoning blocks with SentencePiece CONTROL token IDs and reasons by default on/v1/chat/completions. SGLang’s built-in ergo adapter separates thinking into message.reasoning_content and the final answer into message.content automatically — do not pass a different --reasoning-parser.
Ergo uses fixed reasoning effort (there is no reasoning_effort tier control). To skip the reasoning block on an individual request, pass extra_body={"chat_template_kwargs": {"thinking": False}}.
Reasoning example (Python)
Reasoning example (Python)
Reasoning example
3.2 Tool calling
Tool calls are framed by CONTROL token IDs and parsed automatically intomessage.tool_calls with finish_reason: "tool_calls" — leave --tool-call-parser unset.
- Schema-constrained tool grammar (
SGLANG_TOOL_STRICT_LEVEL=1): SetSGLANG_TOOL_STRICT_LEVEL=1(or enable Tool Schema Enforcement → Function strict (Level 1) in the Playground) to enable xgrammar structural-tag constraints on tool calls while respecting each tool definition’sstrict: truesetting for full JSON-schema parameter enforcement. - Multi-turn history: Append the full assistant message (preserving
reasoning_content,content, andtool_calls) followed byrole: "tool"messages carrying matchingtool_call_idvalues.
Tool calling example (Python)
Tool calling example (Python)
Tool calling example
3.3 HiCache (hierarchical KV caching)
For long-context multi-turn coding sessions, select HiCache → L1 + L2 (host DRAM) in Deployment to spill evicted KV pages into pinned host memory (160 GiB per GPU rank on Vera Rubin, 120 GiB on Blackwell by default) instead of recomputing shared prefixes. Adjust --hicache-size to fit your node’s available host RAM, and change --hicache-write-policy (write_through, write_through_selective, or write_back) in the Playground. See the HiCache documentation for storage-tier (L3) options.
3.4 AWS Trainium (trn3) deployment
Amazon Ergo runs on AWS Trainium3 through sglang-neuron, the SGLang platform plugin for AWS Neuron. One trn3.48xlarge serves the MXFP4 checkpoint as a single--tp-size 128 engine (16 Trainium3 devices × 8 NeuronCores at LNC1), either as one aggregated server or as prefill and decode servers on separate nodes that move the KV cache over NIXL on EFA. Every role accepts contexts up to 1M tokens.
Amazon Ergo support is not in a sglang-neuron release yet. Install the plugin from source at a revision with Ergo support.
Install
Follow the plugin’s installation from source on every node: Neuron SDK 2.33.0 (driveraws-neuronx-dkms 2.31.7.0 or later), the SGLang commit the plugin pins (it stops the launch on any other revision), and, for prefill/decode disaggregation, NIXL 1.5.0 with the plugin’s patches. Launch the instances with their EFA interfaces attached. Every command below runs with SGLANG_PLATFORM=neuron, which selects the plugin.
Prepare the weight packs
The Trainium kernels read pre-sharded per-rank operands instead of the Hugging Face shards. Pack the MXFP4 checkpoint once per node; the routed experts are repacked losslessly, as stored:Pack the checkpoint
Decode pack (P/D decode nodes)
SGLANG_NEURON_ERGO_PACK at the pack on every node and, on decode nodes, SGLANG_NEURON_ERGO_DECODE_PACK at the decode pack. pack_model writes every layer plus the LM head and embedding shards (head/, emb/); the launch checks every file of the pack and names any that are missing. Keep --model-path on the local checkpoint directory (config and tokenizer).
Single-node aggregated serving
Aggregated (1× trn3.48xlarge)
- Slots and context size the caches.
--max-running-requests(1–128) is the number of cache slots and--context-length(up to1048576) their size; the plugin sets--max-total-tokensto every slot at full context and refuses any other value. - Automatic defaults. The plugin fills in the decode batch buckets (
--cuda-graph-bs-decode), enables the small-prompt prefill programs when HBM allows, and checks each rank’s 18 GiB HBM budget at launch, refusing configurations that do not fit and naming the flag to change. - Prefix cache. Ergo’s prefix cache uses the chunk-keyed tree (
--radix-cache-backend neuron-chunk, set automatically when the radix cache is on), which matches whole 16,384-token pages. Use--disable-radix-cacheto turn it off. - First launch compiles. The server compiles every prefill and decode program at startup and never compiles while serving. The first launch takes tens of minutes; later launches reuse the Neuron compile cache.
Prefill/decode disaggregation over EFA
Each prefill and decode node runs its own--tp-size 128 server. The plugin moves the KV cache over NIXL and sets SGLANG_DISAGGREGATION_NIXL_BACKEND=LIBFABRIC (EFA) on both roles, and raises SGLang’s bootstrap and waiting timeouts to 1800 s for long prompts. Each node sizes its own caches, so the prefill can hold fewer slots than the decode.
- 1P1D · 128K
- 1P1D · 1M
Decode node
Prefill node
Balancer
- Scale out (e.g. 3P2D). Repeat
--prefilland--decodeonce per server. At 1M context, three prefill nodes (--max-running-requests 2each) feeding two decode nodes (--max-running-requests 8each) is the measured 1M layout: the prefill nodes set the cold 1M prompt rate, and each decode node adds decode throughput. - Decode role rules. A decode launches with
--disaggregation-decode-extra-slots 0(every request row is a cache slot) and without HiCache. With a decode pack and at most 32 slots it runs the expert-TP decode MoE automatically. - Decode prefix cache (optional).
--disaggregation-decode-enable-radix-cachekeeps finished prompts’ pages on the decode so that a session’s next turn transfers only its new pages; it saves transfer bytes rather than TTFT.
HiCache for multi-turn and agentic long context
On an aggregated server or a P/D prefill, add the host tier to the chunk-keyed prefix cache so evicted pages are backed up to pinned host memory and loaded back on a hit instead of being recomputed:HiCache flags (aggregated or prefill)
--hicache-size is GB per rank, and a node runs 128 ranks (--hicache-size 6 pins ~768 GB of host memory); --hicache-ratio also works. The plugin sets the I/O backend and memory layout itself. HiCache is not supported on a decode node.
Cross-node prefill
To cut cold long-prompt TTFT, two or three prefill nodes can split one prompt’s prefill by layers. The head runs the first layers and passes its activations to the next stage over NIXL on EFA; the tail runs the last layers, and every other stage merges its layers’ KV into the tail’s cache. The tail is the prefill server the balancer and decode see. Launch every stage with the same prefill command and packs, plus:- Head:
SGLANG_NEURON_ERGO_XNODE=headand--skip-server-warmup(the head takes no requests of its own). - Middle (three stages):
SGLANG_NEURON_ERGO_XNODE=1and--skip-server-warmup. - Tail:
SGLANG_NEURON_ERGO_XNODE=tail. - Peers: every stage except the head sets
SGLANG_NEURON_ERGO_XNODE_PEERto the addresses of all stages before the tail, head first:<head-node-ip>for two stages,<head-node-ip>,<middle-node-ip>for three. - Layer split:
SGLANG_NEURON_ERGO_XNODE_SPLITon every stage gives the stages’ boundaries in units of 4-layer segments:8(the default) for two stages,6,11for three.
--prefill http://<tail-node-ip>:30000). The output is identical to a one-node prefill, and a full prefix cache keeps the fresh-pool speed. On trn3.48xlarge, splitting a cold 1M-token prompt across two or three prefill stages substantially reduces time to first token.
Trainium deployment boundaries
- Greedy decoding only. The device heads select the greedy token, so sampling parameters such as
temperatureandtop_pdo not apply. Requests for logprobs or hidden states are rejected with HTTP 400. - Fixed parallelism.
--tp-size 128on one node per server,--chunked-prefill-size 16384; no--ep-size, pipeline parallelism, DP attention, mixed chunks, or speculative decoding (DSpark). - Parsers not yet validated. The Trainium recipes were validated through SGLang’s native
/generateAPI; reasoning and tool-call parsing (sections 3.1 and 3.2) have not been validated on Trainium.
