Skip to main content
miles-diffusion trains a diffusion DiT with FSDP2 while sglang-diffusion serves the rollout. The two halves must agree numerically, so the pinned versions matter more than usual: the rollout engine tracks sglang main, not a release tag, and the training side pins torch 2.11.0 (an FSDP monkey patch is version-gated on it). A future update will upgrade the training stack to torch 2.13. Use Docker unless you have a reason not to.
latest tracks sglang main and is rebuilt every few days; dated tags (dev-cu129-sglang-main-YYYYMMDD) pin a specific build. CUDA 12.9 is the only supported build — the Dockerfile carries a CUDA 13 recipe in a comment, but its sglang-kernel pin is hardcoded to cu129 and no CI covers it.

Build it yourself

Useful build args:

Run

The image ships with:
  • PyTorch 2.11.0 and the sglang base image’s CUDA stack
  • sglang built from main (/sgl-workspace/sglang, editable) with sglang.multimodal_gen
  • FlashAttention-3 (flash_attn_interface), sglang-kernel==0.4.5, torch_memory_saver==0.0.9
  • diffusers, peft, transformers, ray, wandb, and ltx-core from requirements.txt
  • miles_diffusion installed editable at /root/miles_diffusion
  • PaddleOCR’s English det/rec/cls weights pre-downloaded (the OCR reward would otherwise race-download them at runtime)
  • nccl-tests binaries on PATH for link diagnostics
To run your own working tree instead of the baked copy, bind-mount it and reinstall:

Method 2: Update an existing container

If you already run the image and want the latest code:
No Ray restart is needed — the launch scripts stop and restart the cluster themselves.

Method 3: Bare metal, from source

Strongly discouraged unless the image genuinely cannot run on your machine. Unlike Docker, this mutates the host: it installs apt packages and replays the image’s pinned package set into the system Python with --no-deps, overwriting whatever versions are already there. Do not run it on a machine you use for anything else.
Written against a CUDA 12.9 / Ubuntu 24.04 host, to match the image. Nothing enforces that, but the apt versions are unpinned, so another release hands out different versions of the apt-sourced dists and the verify step reports drift. The installer has six idempotent steps, and --from STEP resumes a failed run. The last step diffs every installed package against the image’s snapshot — a clean run ends with:
To check an existing machine against the image without installing anything: python3 .claude/skills/install-miles-diffusion/verify_env.py. Plain pip install -r requirements.txt && pip install -e . --no-deps installs, but leaves a trainer-only environment: CPU tests and --train-only SFT run, RL does not — sglang.multimodal_gen and FlashAttention-3 are not on PyPI. Resolving the full set through pip is not possible (it is only consistent under --no-deps replay), which is what the installer handles.

Verify

Then run the CPU test suite — seconds, and it catches most environment breakage:
On a machine with no sglang GPU kernels installed, install the CPU stubs first, the way CI does: uv pip install tests/ci/cpu_stubs.

Hardware

Under --colocate the training actor and the rollout engines time-share the same GPUs, so the floor is set by whichever of the two needs more memory, not by their sum.

Environment variables

Next