train.py and
train_async.py support the Mooncake backend, and the trainer receives the same
rollout dictionary with either backend.
Rollout-data transfer and model-weight transfer are separate settings:
--object-store-backendselects the rollout object store.--update-weight-transfer-modeselects the model-weight transfer path.
Requirements
Before starting a Miles job:- Run the same Miles revision and Mooncake version on every Ray node.
- Start
mooncake_master, or provide a Mooncake HA endpoint, and make the endpoint reachable from every node. Miles connects as a client and does not manage the endpoint lifecycle. - Use routable data-network addresses for Ray and Mooncake clients.
- Reserve enough host memory for
global_segment_sizeandlocal_buffer_size. - For RDMA, expose the RDMA device to the Miles environment, allow memory locking, and set the local device name on each node.
mooncake.structured_object_store fails to import on a CUDA 12 image. See
Versions and Images for the ENABLE_CUDA_13 switch and
that failure mode.
Configure the backend
Choose the transfer protocol before starting Ray. TCP works on any routable data network. RDMA also requires a local RDMA device on every node; device names may differ between nodes. If Ray and the Mooncake endpoint are already running, set the protocol and endpoint:MOONCAKE_MASTER_ADDR above is only a shell variable for these
examples; the environment variable Miles itself falls back to is MOONCAKE_MASTER.
Launch scripts and the Mooncake end-to-end tests assemble both pieces with
start_mooncake_master() and get_mooncake_object_store_args() from
miles/utils/external_utils/command_utils.py. The walkthrough below spells them out
instead, so every setting stays visible.
Two-node walkthrough
The example below runs three synchronous rollout and training iterations with FSDP. It uses one eight-GPU node for rollout and one eight-GPU node for training. Set the variables to match your cluster, then complete the following steps in order.
Both nodes must use the same Python environment, Miles revision, and Mooncake
version. The model and dataset paths referenced by the job must be available to the
processes that use them.
1. Choose the protocol and set node addresses
On the head node, select TCP or RDMA and set its data-network address:MOONCAKE_DEVICE before starting Ray so that Ray workers inherit the
node-local device setting.
2. Start Mooncake and Ray on the head
Activate the Miles environment first, then run:3. Join the worker
Activate the same Miles environment on the worker, then run:local_hostname by default. Starting Ray with the
data-network addresses above therefore keeps both systems on the same network.
4. Submit training from the head
Set the Store configuration and the repository, model, and dataset paths before submitting the job. The 2 GiB values are suitable for this small example; production jobs should size them for live rollout data, replicas, and concurrent transfers.Configuration reference
--mooncake-store-init-kwargs accepts the following fields:
Values supplied in
--mooncake-store-init-kwargs take precedence over environment
variables. Use data-network addresses in multi-node jobs; loopback addresses work
only when all clients run on one node.
Not every client contributes a segment: the rollout manager never does, and among
training actors one per node does. Size global_segment_size for that per-node
contribution rather than for the total client count.
Mooncake stores one replica by default. Request additional replicas with:

