High-performance distributed training for LLMs — RL, SFT, MoE, and beyond.
🚀 Installation · ⚡ Quick Start · 📚 Documentation
XoRL is a distributed training framework designed for large language models with composable parallelism and flexible training modes.
The XoRL stack consists of three repos:
| Repo | Description |
|---|---|
| xorl | Distributed training framework — local SFT/pretraining and server-mode RL training |
| xorl-client | Lightweight Python SDK for driving the xorl training server (forward/backward, optimizer steps, checkpointing, sampling) |
| xorl-sglang | Fork of SGLang with weight-sync APIs, MoE routing export, and numerical alignment for online RL |
Two training modes:
- Local —
torchrun-based training for offline SFT and pretraining - Server — REST API-driven training for online RL loops where xorl-client drives the training loop and xorl-sglang serves inference
Parallelism strategies — compose across validated combinations; some adapter, virtual-pipeline, and weight-sync combinations have explicit restrictions:
| Strategy | Description |
|---|---|
| FSDP2 | Fully sharded data parallelism (PyTorch native) |
| Tensor Parallel | Column/row weight sharding across GPUs |
| Pipeline Parallel | Six schedules, including 1F1B, interleaved 1F1B, zero-bubble, and V-style variants |
| Context Parallel | Ring attention + Ulysses sequence parallel |
| Expert Parallel | MoE expert sharding via DeepEP |
Fine-tuning methods — full weights, LoRA, and QLoRA (int4/nvfp4/block_fp8), all FSDP2-compatible.
git clone --recurse-submodules git@github.com:togethercomputer/xorl.git
cd xorlAlready cloned without
--recurse-submodules? Rungit submodule update --init --recursive
uv sync
source .venv/bin/activateconda create -n xorl python=3.12
conda activate xorl
pip install -e . -e "submodules/xorl-sglang/python[all]"The second editable install is required with pip/conda: pyproject.toml depends on sglang[all], and only uv resolves it to the checked-in submodules/xorl-sglang fork (via [tool.uv.sources]). Installing the submodule explicitly keeps pip from pulling upstream SGLang off PyPI.
The repo includes two git submodules under submodules/ (needed for server / online RL training):
- xorl-client — Lightweight Python SDK (no PyTorch dependency) for driving the xorl training server. Provides
ServiceClient,TrainingClient,SamplingClient, andRestClientwith async-firstAPIFuturesemantics, automatic request ordering, and Tinker API compatibility. - xorl-sglang — XoRL's fork of SGLang with NCCL and P2P weight sync, MoE route export (R3), and architecture-resolved numerical programs for online RL. The pinned revision does not include the sparse-delta receiver.
The default install already includes xorl-client from its public repository. To develop the client submodule in place, install its editable checkout:
pip install -e submodules/xorl-clientThe default profile is a single combined environment: pyproject.toml pins the PyTorch 2.11/CUDA 13 stack (Triton 3.6.0, FlashAttention 4) that the checked-in xorl-sglang revision — including its compiled sglang-kernel extension — is built against, so XoRL, xorl-client, and xorl-sglang all install into the one uv sync environment. The xorl-sglang submodule must be checked out for the install to resolve.
See the installation guide for full setup including optional dependencies (DeepEP, Flash Attention).
# Local training on 8 GPUs
torchrun --nproc_per_node=8 -m xorl.cli.train examples/local/dummy/configs/full/qwen3_8b.yamlSee the quick start guide for more examples including MoE, server training, and LoRA.
| Topic | Link |
|---|---|
| Parallelism | Overview |
| MoE & DeepEP | MoE docs |
| LoRA / QLoRA | Adapters |
| Server training | Server docs |
| Config reference | Local · Server |
| Model | Type | HuggingFace ID |
|---|---|---|
| Qwen3 | Dense | Qwen/Qwen3-8B, Qwen/Qwen3-32B, ... |
| Qwen3-MoE | Mixture-of-Experts | Qwen/Qwen3-30B-A3B, Qwen/Qwen3-235B-A22B, ... |
| Qwen3.5 | Dense | Qwen/Qwen3.5-7B, ... |
| Qwen3.5-MoE | Mixture-of-Experts | Qwen/Qwen3.5-35B-A3B, Qwen/Qwen3.5-397B-A17B, ... |
| GLM-5 | Mixture-of-Experts | zai-org/GLM-5.2-FP8 |
| DeepSeek V4 | Hybrid-attention MoE | deepseek-ai/DeepSeek-V4-Flash |
Models are loaded directly from HuggingFace checkpoints — no preprocessing needed. See the supported models page for details.
See CONTRIBUTING.md for development setup, coding conventions, and how to run tests.