Every command-line flag Miles accepts, grouped by subsystem.
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.
Essentials lists the flags most runs actually touch.
Complete reference lists every Miles flag with type and default.
Essentials
Cluster topology
Flag
Default
What
--actor-num-nodes
1
Total nodes for the actor.
--actor-num-gpus-per-node
8
GPUs per actor node.
--rollout-num-gpus
derived
GPUs for SGLang rollout (ignored when --colocate).
Sections mirror the launch-script argument groups.
Cluster
Flag
Type
Default
Notes
--actor-num-nodes
int
1
Total nodes for actor training.
--actor-num-gpus-per-node
int
8
GPUs per actor node.
--rollout-num-gpus
int
derived
Ignored under --colocate.
--rollout-num-gpus-per-engine
int
1
TP size of each SGLang engine.
--colocate
flag
off
Share GPUs between actor and rollout. Implicitly enables --offload-train, --offload-rollout, and defaults --sglang-cuda-graph-backend-prefill=disabled.
Model and checkpoints
Flag
Type
Default
Notes
--train-backend
enum
megatron
megatron or fsdp.
--hf-checkpoint
path
–
HF model dir. Provides tokenizer, config, and the weights FSDP loads.
--ref-load
path
–
Reference model in torch_dist format (Megatron).
--load
path
–
Actor checkpoint to resume from.
--save
path
–
Actor checkpoint write directory.
--save-interval
int
–
Rollouts between saves.
--save-trigger-sentinel
path
–
If this file exists at a save point, save a checkpoint now (regardless of --save-interval) and remove the file.
--custom-megatron-post-save-hook-path
<module>.<fn>
–
Rank-0 callback after each checkpoint save.
--model-name
str
–
Set in multi-node to avoid transformers file-system race.
--spec
<module> <fn>
–
Plugin spec for custom architectures (e.g. miles_plugins.models.qwen3_5 get_qwen3_5_spec).
Rollout: data and batching
Flag
Type
Default
Notes
--prompt-data
str
–
Path to a single JSONL file.
--input-key
str
input
JSONL key to Sample.prompt.
--label-key
str
None
JSONL key to Sample.label.
--metadata-key
str
metadata
JSONL key to Sample.metadata.
--apply-chat-template
flag
off
Apply tokenizer chat template.
--rollout-shuffle
flag
off
Shuffle prompts each rollout.
--num-rollout
int
–
Total rollout iterations. If unset, derived from dataset size.
--rollout-batch-size
int
–
Prompts per rollout.
--n-samples-per-prompt
int
1
Responses per prompt.
--global-batch-size
int
derived
Samples per optimizer step.
--num-steps-per-rollout
int
–
Optimizer steps per rollout. Alternative to --global-batch-size; setting one derives the other.
--over-sampling-batch-size
int
–
Oversample size for dynamic sampling (DAPO).
--balance-data
flag
off
Balance per-rank token count.
Rollout: sampling
Flag
Type
Default
Notes
--rollout-max-response-len
int
–
Max tokens per response.
--rollout-temperature
float
1.0
Sampling temperature.
--rollout-top-p
float
1.0
Top-p truncation.
--rollout-top-k
int
-1
Top-k truncation (-1 disables).
--rollout-stop
str+
–
Stop strings.
--rollout-stop-token-ids
int+
–
Stop token IDs.
Eval
Flag
Type
Default
Notes
--eval-prompt-data
str+
–
One or more name path pairs.
--eval-interval
int
–
Rollouts between eval runs.
--n-samples-per-eval-prompt
int
1
Responses per eval prompt.
--eval-max-response-len
int
–
Max eval response length. Inherits from rollout if unset.
Staging dir for per-eval HF snapshots (tmpfs recommended). Unset + --save-hf = reuse mode.
--eval-max-in-flight
int
2
Snapshots the trainer may export ahead of the eval backend. Evals are serialized, so this buys lead time, not concurrency — and one more staged snapshot.
--eval-overflow-policy
str
backpressure
At the cap: await the oldest eval, or skip the new point (logged as eval/skipped_busy).
--eval-keep-snapshots
int
2
Retired snapshots kept under --eval-hf-dir; with --eval-max-in-flight this bounds the staging dir. --save-hf output is never deleted.
--eval-sglang-*
–
–
Per-field override of any --sglang-* setting for the eval fleet only. Unset = inherit the rollout engines' value. Booleans take a --no- form (--no-eval-sglang-enable-dp-attention) so an inherited True can be turned off. tp_size is not exposed — use --eval-num-gpus-per-engine.
Performance
Flag
Type
Default
Notes
--tensor-model-parallel-size
int
1
TP.
--pipeline-model-parallel-size
int
1
PP.
--context-parallel-size
int
1
CP.
--expert-model-parallel-size
int
1
EP (MoE).
--expert-tensor-parallel-size
int
1
TP within experts.
--sequence-parallel
flag
off
Enable Megatron sequence parallel.
--use-dynamic-batch-size
flag
off
Pack varlen samples. Recommended for varlen workloads.
--max-tokens-per-gpu
int
–
Token budget per micro-batch per GPU. Required when dynamic batching is on.
--micro-batch-size
int
1
Ignored when dynamic batching is on.
--recompute-granularity
enum
Megatron default
full or selective.
--recompute-method
enum
Megatron default
uniform or block.
--recompute-num-layers
int
Megatron default
Recompute chunk size.
--gradient-checkpointing
flag
off
FSDP equivalent of recompute flags.
--fsdp-cpu-offload
flag
off
FSDP: offload params, grads, optimizer state to CPU.
--fsdp-cpu-backend
str
gloo
FSDP: CPU backend for hybrid offload.
--dp-replicate-size
int
1
FSDP2 hybrid-shard replica count.
--attn-implementation
str
flash_attention_2
FSDP only: passed to transformers, e.g. flash_attention_2, flash_attention_3, sdpa, eager.