1. Model Introduction
GPT-OSS is OpenAI’s open-weight language model, designed for reasoning, agentic tasks, and developer use cases. miles supports the 20 B variant. Key highlights:- Configurable reasoning effort: low / medium / high reasoning effort selectable per request.
- Full chain-of-thought: the reasoning trace is exposed and trainable.
- MXFP4 native weights: the HF checkpoint ships in MXFP4 (post-trained) — the BF16 launcher uses mbridge to load HF directly.
- Sink attention: requires
--qkv-format bshdon the Megatron path, which precludes dynamic batch sizing.
2. Supported Variants
3. Environment Setup
3.1 Download model + datasets
3.2 HF → Megatron torch_dist conversion
The launcher needs no convert_hf_to_torch_dist.py step: it loads the HF checkpoint directly via --megatron-to-hf-mode bridge (mbridge).
4. Launch
4.1 Quick start
--model-dir (default /root/models) and the dataset from
--data-dir (default /root/datasets).
5. Recipe Configuration
5.1 Parallelism
--use-dynamic-batch-size is not used on the Megatron BF16 path — the in-source comment explains: --qkv-format bshd (required for sink attention with TE) is incompatible with dynamic batch size. Only --micro-batch-size 1 is set. --sequence-parallel is on (required for TP + EP).
5.2 Algorithm
The recipe uses GRPO with--eps-clip 0.2 --eps-clip-high 0.28 --entropy-coef 0.00 and --rm-type math. --use-kl-loss is not passed — bridge mode has no Megatron-format reference checkpoint to supply --ref-load, which KL loss would need.
5.3 Rollout & SGLang
5.4 Optimizer
The launcher enables CPU Adam (--optimizer-cpu-offload --overlap-cpu-optimizer-d2h-h2d --use-precision-aware-optimizer).
5.5 Notable quirks
Attention setup:--qkv-format bshd is mandated by the sink-attention pattern; in turn it precludes --use-dynamic-batch-size. Don’t toggle either flag without the other.
The launcher passes no --load, and no --save unless you ask for it: --save exports the
bf16 HF checkpoint to <model-dir>/gpt-oss-20b-BF16 every 50 steps, which can then be fed
back in as the --hf-checkpoint.

