miles/
├── backends/ # one directory per backend, plus what they share
│ ├── megatron_utils/ # Megatron actor, update_weight/ (HF iterator), checkpointing, fp32 markers
│ ├── fsdp_utils/ # FSDP2 actor, adaptations/ per architecture, hf_weight_iterator.py,
│ │ # checkpoint.py (DCP save/resume)
│ ├── torchtitan_utils/ # torchtitan actor, Trainer config tree, hf_weight_iterator.py
│ ├── sglang_utils/ # SGLang engine wrapper + argument glue
│ └── training_utils/ # what the backends share: loss.py / loss_hub/, ParallelState,
│ # weight_update/ (engine session, transport protocols, WeightUpdater),
│ # torch_native/ (the RL step FSDP and torchtitan share, the
│ # StepRunner seam, the routing-replay surface), log + CI checkers
├── ray/ # Ray actors, placement groups, train/ and rollout/ groups
├── rollout/
│ ├── sglang_rollout.py # legacy v1 rollout function
│ ├── data_source.py # buffer + JSONL loader
│ ├── filter_hub/ # built-in filters
│ ├── rm_hub/ # built-in reward types (`--rm-type` dispatch)
│ ├── fully_async_*.py # queue-backed producer for train_async.py
│ └── inference_rollout/# default class-based rollout
├── router/ # FastAPI proxy + worker load-balancer (router.py)
├── dashboard/ # run dashboard: collector, backend, dump reader
├── true_on_policy/ # true-on-policy contracts and per-model profiles
└── utils/ # arguments.py, async / IO / distributed helpers, audit_utils/