This document is relevant for: Trn2, Trn3
GPT-OSS Model Recipe#
Introduction#
gpt-oss is an open-weight Mixture-of-Experts (MoE) language model family released by OpenAI, designed for strong reasoning, tool use, and long-context generation. The published checkpoints ship with MXFP4-quantized expert weights.
gpt-oss is supported for inference serving with
vLLM using the Neuron SDK on AWS
Trainium2 (trn2) and Trainium3 (trn3) hardware.
Compatible model checkpoints:
Model |
HuggingFace |
Hardware |
Quantization |
|---|---|---|---|
gpt-oss-20b |
Trn2, Trn3 |
BF16 (Trn2), MXFP4 (Trn3) |
|
gpt-oss-120b |
Trn2, Trn3 |
BF16 (Trn2), MXFP4 (Trn3) |
On Trn3, MXFP4-quantized weights are auto-selected from the published checkpoints. On Trn2, both models run in BF16. MXFP4 is Trn3 only.
Features#
Per-model feature availability for gpt-oss. See the features guide for configuration details.
Category |
Feature |
Status |
|---|---|---|
Inputs |
Text |
✅ |
Quantization |
MXFP4 weights (Trn3) |
✅ |
BF16 weights (Trn2) |
✅ |
|
KV cache FP8 |
✅ |
|
Parallelism |
Tensor parallelism (TP) |
✅ |
Data parallelism (DP) |
✅ |
|
Expert parallelism (EP) |
✅ |
|
Pipeline parallelism (PP) |
❌ |
|
Performance |
Continuous batching |
✅ |
Segmented prefill |
✅ |
|
Prefix caching (APC) |
✅ |
|
Speculative decoding (EAGLE3) |
✅ |
|
Speculative decoding (P-EAGLE) |
✅ |
|
Disaggregated inference (1P1D / xPyD) |
✅ |
|
Decode megakernel at LNC=1 (Trn3, DI decode, 120B) |
✅ |
|
EAGLE3 with the decode megakernel (Trn3, DI decode, 120B; see EAGLE3 with the decode megakernel) |
✅ |
|
On-device sampling (greedy, top-k, top-p) |
✅ |
|
Serving |
Structured outputs / tool calling |
✅ (asynchronous scheduling needs MXFP4, the native route, no speculative decoding, the per-layer decode ( |
Compilation |
torch.compile (XLA backend) |
✅ |
CPU mode (testing) |
✅ |
|
Runtime |
Model Runner V2 |
✅ (the default, also for the decode megakernel). EAGLE3 with the decode megakernel: MRv2 only |
Status legend:
✅ Supported: integrated and tested for gpt-oss
❌ Not supported: may be considered for future releases
This model runs on Model Runner V2 (MRv2) by default. EAGLE3 with the decode megakernel runs on MRv2 only.
The deployment tutorial walks through deploying gpt-oss 20B and 120B on Trn3 (MXFP4) or Trn2 (BF16) via two paths: a single-instance server and a disaggregated-inference (separate prefill and decode) deployment.
EAGLE3 with the decode megakernel#
On the decode server of a disaggregated deployment, the decode megakernel also verifies EAGLE3 drafts. One kernel runs all decoder layers on the last token and the draft tokens of each sequence. As an option, one NKI kernel also runs the whole EAGLE3 draft step. This configuration runs on MRv2 only.
These values are the validated configuration:
Setting |
Validated value |
|---|---|
Hardware and weights |
Trn3, |
Draft model |
RedHatAI/gpt-oss-120b-speculator.eagle3, |
Deployment |
Six prefill replicas and one decode server (6P1D) on two Trn3 instances, as in the 8K/1K tutorial |
Decode server |
TP8 DP16 EP128 at |
Prefill replicas |
TP4 DP1 EP2 at |
KV cache |
Packed FP8 on both roles: |
Shape |
8,192 input tokens and 1,024 output tokens, |
Compile route |
|
|
|
Set this configuration for the EAGLE3 servers. A decode server that does not
meet a requirement of the decode megakernel uses the per-layer decode. With
neuron_config.gk_decode: true, it stops at startup and gives the reason.
Set
VLLM_USE_V2_MODEL_RUNNER=1on the decode server. Without it, the decode server uses the per-layer decode. The prefill replicas use MRv2 by default.Keep
neuron_config.gk_variantunset on the decode server, or set it toc128. Thec512andc1024decode megakernels have no form that verifies drafts.Keep
num_speculative_tokens3 and the packed FP8 KV cache on the decode server. The decode megakernel verifies drafts only in this validated setup.Set
VLLM_NEURON_DRAFT_GIGA_KERNEL=1on the decode server to run the draft step as one kernel. The kernel is off by default. Keep it off on the prefill replicas. No prefill step uses the kernel, and the flag makes the PyTorch draft slower.Set
VLLM_NEURON_NIXL_PROGRESS_THREAD_DELAY_US=1000on the decode server. The prefill replicas use 250.Set
VLLM_NEURON_RESERVED_HEADROOM_GIB=12.04on the decode server.Set
VLLM_NEURON_RESERVED_HEADROOM_GIB=15.5andVLLM_NEURON_MIN_KV_BUDGET_GIB=0.5on each prefill replica. On MRv2, this headroom gives a prefill KV budget of 0.70 GiB. This is less than the default minimum of 1.0 GiB. These two values are temporary. They change when the KV budget of MRv2 counts the draft weights correctly.The DMA-order schedule applies only to the decode graph without drafts. Unset
VLLM_NEURON_MEGA_DMA_ORDER_CONSTRAINTS_FILEandVLLM_NEURON_MEGA_DMA_ORDER_DERIVEon the decode server. Therun_decode.shscript of the 8K/1K tutorial sets the schedule file.
MRv2 also accepts drafts at fixed synthetic rates. Use this to benchmark at a
known acceptance length. Add "rejection_sample_method": "synthetic" to
--speculative-config. Also add synthetic_acceptance_length or
synthetic_acceptance_rates. For example, set
"synthetic_acceptance_length": 2.44. MRv2 does not support other rejection
methods.
Known limitations:
The prefill replicas give a higher time to first token (TTFT). The cause in the prefill step is not known.
At partial load, the time per output token (TPOT) is higher. The padding rows of the decode batch cause the higher TPOT. At 32 concurrent requests, 96 of the 128 rows of the decode batch are padding. All padding rows have the same input, so they route to the same experts. The ranks of these experts then set the time of each verify step. This limitation stays until the expert router ignores the padding rows.
Accuracy Evaluation#
Accuracy measured on real hardware with MXFP4 weights (Trn3), medium reasoning effort.
Benchmark |
gpt-oss-120b (MXFP4) |
|---|---|
GSM8K-CoT |
88.8% |
AIME25 (avg@8, medium) |
78.75% |
GPQA-diamond (medium) |
72.22% |
Tutorials#
Tutorial: Deploy gpt-oss with vLLM Neuron — End-to-end single-instance and disaggregated-inference deployment recipe for gpt-oss 20B and 120B.
Prefix caching benchmark tutorial — Benchmark prefix caching with gpt-oss across open-source datasets.
High-performance GPT-OSS 120B implementation for 8K/1K serving on Trn3 — The 6P1D configuration on two Trn3 instances with the decode megakernel, and the scripts that run it and its benchmark.
This document is relevant for: Trn2, Trn3