Skip to main content
Miles is configured through command-line flags passed to train.py or train_async.py. The Megatron flags (such as --num-layers, --rotary-base, --recompute-granularity) are inherited via Megatron’s argument parser; Miles adds its own flags through an extra_args_provider. Run python3 train.py --help against your installed Megatron source for the canonical list. This page has two passes.
  1. Essentials lists the flags most runs actually touch.
  2. Complete reference lists every Miles flag with type and default.

Essentials

Cluster topology

See Training Script Walkthrough: Colocation for what --colocate flips on under the hood.

Batch sizing

The four-knob invariant:

Memory and throughput

Rule of thumb: start with max_tokens_per_gpu = rollout_max_response_len / cp_size, then push up until you OOM.

RL algorithm

Sampling

Optimizer

Logging

SGLang passthrough

Any flag accepted by python -m sglang.launch_server is accepted by Miles with the --sglang- prefix:
See SGLang docs for the full list.

Environment variables

Set these in Ray’s env_vars for multi-node runs:

Complete reference

Sections mirror the launch-script argument groups.

Cluster

Model and checkpoints

Rollout: data and batching

Rollout: sampling

Eval

Performance

RL algorithm

Optimizer

Reward and filters

SGLang and router

Common --sglang-* flags:

MTP / speculative decoding

Fault tolerance

Async / partial rollout

Logging

Profiling

Debugging

Customization

See Customization for the full catalog of --*-path flags that replace or extend Miles’s behavior.