The four objects
The training loop
The whole oftrain_diffusion.py is three calls per iteration:
The batch-knob invariant
In miles-diffusion a sample is a whole denoising trajectory, and the fan-out continues below it: a step strategy picks the trained timesteps, and micro-batching counts (x_t → x_) pairs. One equation per level. Trajectory level — the four-knob invariant, enforced inmiles/utils/arguments.py. rollout_batch_size is
required and n_samples_per_prompt defaults to 1; of the right-hand pair, set one and the other is derived
(passing both with contradicting values aborts):
trained_timesteps_per_trajectory. Each rank then trains its 1 / dp_size share,
micro_batch_size pairs per forward, accumulating gradients until the optimizer step.
Two independent knobs control physical batching, one per side of the loop:
And one knob controls the trajectory→pair fan-out itself:
--diffusion-step-strategy-path picks the SDE step subset per
rollout (sde_window, epoch_global_random_choice, or your own function in miles/rollout/step_strategy_hub.py).
Training the full 10-step schedule would multiply the pair count by 10× in the example below.
Here is a full example with the numbers:
Next
- Launch Scripts — a canonical launcher, group by group.
- Rewards —
rm_hub, custom reward functions, prompt data format. - CLI Reference — every flag, fully cataloged.
- SDE Step Backend — how train-side log-probs mirror rollout stepping.

