Skip to main content
Miles uses Ray’s object store by default to pass rollout data from rollout workers to trainers. Mooncake Store can replace Ray for this handoff. Both 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-backend selects the rollout object store.
  • --update-weight-transfer-mode selects 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_size and local_buffer_size.
  • For RDMA, expose the RDMA device to the Miles environment, allow memory locking, and set the local device name on each node.
The current Miles CUDA 13 image includes the Mooncake structured-object APIs used by this backend. For a custom environment, install a Mooncake package that matches the CUDA runtime and is compatible with the Miles revision. Follow the Mooncake installation guide for current package names and supported platforms. The structured-object wheel ships only on the CUDA 13 path, so 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:
Then add these options to an existing Miles training command:
Use a data-network address that every client can reach. The JSON value must remain one shell argument. 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:
On the worker node, select the same protocol and set both node addresses:
For RDMA, set 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:
Mooncake uses each Ray node IP as 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.
For fully asynchronous training, keep the same Mooncake options and use the normal Miles async entrypoint and flags:
See Fully Async Rollout for the remaining async settings.

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:
Additional replicas require additional Store capacity.