Make ART a native multi-node RL runtime with Monarch - #808
Draft
FurtherAI wants to merge 1411 commits into
Draft
Conversation
Ship locked CUDA 12 and CUDA 13 trainer environments, pinned NIXL/UCX assets, on-demand HybridEP, and managed etcd behind the public Megatron extras. Add fresh-cluster package CI and a real two-host training example, while retaining checkout setup only for source development.
…ode_training # Conflicts: # src/art/trajectories/__init__.py # src/art/trajectories/_capture/core.py # src/art/trajectories/_compact.py # src/art/trajectories/_scope.py # src/art/trajectories/tensors.py # tests/unit/trajectories/test_compact_serialization.py
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
FurtherAI
had a problem deploying
to
trainer-rank-gpu-validation
August 19, 2026 01:32 — with
GitHub Actions
Failure
FurtherAI
had a problem deploying
to
trainer-rank-gpu-validation
August 19, 2026 17:29 — with
GitHub Actions
Error
FurtherAI
had a problem deploying
to
trainer-rank-gpu-validation
August 19, 2026 17:31 — with
GitHub Actions
Failure
FurtherAI
had a problem deploying
to
trainer-rank-gpu-validation
August 19, 2026 18:08 — with
GitHub Actions
Error
FurtherAI
had a problem deploying
to
trainer-rank-gpu-validation
August 19, 2026 18:34 — with
GitHub Actions
Error
FurtherAI
temporarily deployed
to
trainer-rank-gpu-validation
August 19, 2026 18:51 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR turns ART into a native distributed RL runtime rather than a single-node trainer wrapped in remote launch glue. Monarch owns process lifecycle and typed RPC, ART owns RL semantics and policy state, Megatron/NCCL owns distributed training, and vLLM owns inference execution.
Distribution remains an execution topology, not a second programming model. Existing single-node training code continues to use
MegatronBackend()andPipelineTrainer; internally, it now compiles to the same one-host runtime used by multi-node jobs. Advanced users can provide explicit placement and service topology without changing the training loop.The PR also adds production GLM-5.2 support optimized on H200 and B300, composable CP/EP/DP/PP/VPP training, multi-node inference, CUDA 13/Blackwell support, and the asynchronous data, packing, publication, and durability paths needed to keep those systems efficient.
Design Decisions
PYTHONPATHso your rollout fn can be imported.TrainingProgramSpecare intentionally not prerequisites. Existing trajectories, trajectory groups,backend.train(), and pipeline training remain valid.Public API
art.init_megatron_runtime_config(...)HostSpec,ClusterSpec,GpuPlacementTrainerMeshSpec,ModelServiceSpec,VllmParallelSpeccompile_topology(...)ArtRuntime.start(...)ArtRuntime.start_local(...)MegatronBackend()path uses.InstalledAsyncCallableandruntime.rollout_executor(...)PackingRequestandPackedBatchRefruntime.start_trainer(...)TrainerRuntimeSpec,TrainingRunSpec, job contracts, and progress/completion events.runtime.start_model_service(...)art-monarchNormal single-node usage remains:
Explicit multi-node usage supplies a compiled runtime and rollout executor, then uses the same backend and
PipelineTrainerAPIs:These APIs allow multiprocessing rollout workers, which is useful when rollouts perform CPU-heavy environment execution.
Runtime Flow
Policy version, adapter generation, logprobs, rewards, timing, MoE routes, and mid-prefill policy changes remain attributable through this flow.
Implementation Map
The total branch diff is 280 files,
+64,465/-17,589. Excluding tests and lockfiles, production, setup, examples, and documentation contribute+40,016/-9,631; tests contribute+17,163/-5,841.src/art/distributed/+10,221: typed topology, Monarch lifecycle, rollout execution, trajectory ownership, leased queues, packing, batch transport, NIXL adapter transfer, admission, and model-service supervision.src/art/megatron/runtime/+4,426/-211: typed runtime/job/event contracts, local and Monarch executors, warm trainer supervision, managed package runtime, compilation identity, publication, and recovery.src/art/megatron/+12,851/-5,189: backend cutover, distributed service coordination, CP/EP/HybridEP, optimizer state, asynchronous snapshots, BF16 LoRA serialization, and trainer instrumentation. The old filesystemservice.pyis deleted.+3,535: sparse MLA, indexer, CP stages, LoRA projections, model spec/state, TileLang kernel, and ART model-support integration.training/pipeline_schedule.py+995: PP/VPP scheduling with variable sequence lengths, executed batch size one, recomputation, CP, and route-replay integration.+3,955/-1,699excluding lockfiles: vLLM 0.25.1 integration, distributed deployment lifecycle, binary MoE routes, policy spans, pooled fast metrics, and model-specific patches still required upstream.+1,959/-781: bounded queue control, packing lookahead, logical/executed token accounting, and async trainer dispatch.examples/multinode/tests/+17,163/-5,841: runtime lifecycle, topology, data-plane, failure/recovery, publication, model correctness, numerical parity, packing, trainability, and E2E throughput coverage.Workflow Tests
The workflow is a set of tests which run for each handler, proving things like parity with HF transformers, invariance to prefix tree packing, correct parallelism implementations, minimal train-inf mismatch, trainability and now e2e throughput. The throughput test uses a set of layers which fits a 128k packed seq on 2 gpus, cp2 ep2. vLLM is deployed with 2 gpus as well, and a synthetic workload is trained on. We assert things like a gap under 230ms p50 between consecutive fwd_bwd work, vLLM and trainer load, time to activate an adapter, trainer throughput matching expected isolated throughput (also catches recompilation issues), and overall tok/s. These ensure that the system is properly async and components are performing at peak speed.
In addition to the new stage, we redesigned how the workflow schedules itself, combined stages, and minimized imports, process startup, and repeated work. This turns a 70-90 minute run for one handler into approximately 60 minutes for all ten, with further scaling from additional GPUs.
Performance And Validation
Intentional Scope
This PR does not add a second training API, Ray, generalized-RL program definitions, multiple independent inference replicas, merged-weight serving, the old NCCL weight-transfer engine, file-backed job dispatch, JSONL polling, or nested multi-node
torchrun. Those omissions are deliberate: the delivered core is the smallest coherent runtime compatible with the efficiency target that provides correct multi-node rollout, inference, training, data movement, policy publication, durability, and single-node collapse.