Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
Libra: Efficient Resource Management for Agentic RL Post-Training
Fetched from the repository for this visit.
A resource-aware systems framework for disaggregated, asynchronous post-training of agentic language models.
Latest News · Features · Architecture · Evaluation · Installation · Manual · Citation
Libra coordinates training and rollout clusters, routes requests across heterogeneous vLLM workers, and adapts resource allocation as workload pressure changes during training. Across three agentic RL benchmarks on both GPU and NPU clusters, Libra delivers up to 4.2x higher throughput and 2.7x faster reward convergence.
This repository accompanies the paper "Libra: Efficient Resource Management for Agentic RL Post-Training". Read the paper for the full design.
NPU_Support branch added NPU support for all core
functionalities.
Libra splits RL post-training into a core training pool, a core rollout pool, and an elastic hybrid pool. The Global Resource Planner chooses how many GPUs belong to training and rollout, then jointly selects the training parallelism (TP/EP/PP/DP) and heterogeneous rollout TP buckets. The Causality-Guided Bucket Scheduler uses tool-return states to estimate residual sequence length and route requests to suitable buckets. Elastic execution moves complete data-parallel replicas between rollout and training through decoupled communication domains and a non-blocking RDMA joining protocol, keeping the core training topology stable.
RL_Framework/
├── config.py # Dataclass configuration loader
├── trainer/async_rl_trainer.py # Asynchronous GRPO training loop
├── engine/ # vLLM, FSDP, and Megatron adapters
├── infra/
│ ├── cost_model/ # Cost evaluator and global planner
│ ├── elastic/ # Hybrid pool, runtime executor, IPC
│ ├── execution/ # Async runner and batch dispatcher
│ ├── observability/ # Runtime history collection
│ ├── scheduling/ # C-MLFQ and baseline schedulers
│ └── sync/ # Staleness and weight synchronization
├── workflow/ # Agentic workload implementations
├── env/ # Tools, prompts, graders, and rewards
├── configs/ # Hardware, model, and experiment configs
├── examples/ # Training entrypoints and validation examples
├── scripts/ # Local and Slurm launchers
├── data/ # Dataset preparation utilities
└── tests/ # Unit and integration tests
The updated paper evaluates Libra with Qwen3-14B and Qwen3-30B-A3B on Search-R1, R2E-Gym, and DAPO-Math-17K:
| Guide | What it covers |
|---|---|
| Cluster manual | End-to-end configuration and launch workflow |
| Data preparation | R2E-Gym, Search-R1, and DAPO-Math datasets |
| Configuration reference | Core, Megatron-Core, planner, and elastic options |
| Observability | Logs, manifests, planner decisions, and runtime history |
| Environment setup | Base software environment and dependencies |
| Compute-node setup | Environment preparation on cluster compute nodes |
| Multi-node Slurm guide | Distributed launch configuration and operational notes |
| Megatron-Core backend | Backend architecture, configuration, and stability guidance |
| Runtime history collection | Metrics and history data used by the online planner |
Libra is a research artifact. The supplied launchers target multi-node NVIDIA GPU clusters. Paths, partitions, node names, network devices, container runtimes, and model locations should be adapted to your own cluster.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .
If your platform has a compatible vLLM wheel, you can simplify installation by using that wheel instead of a source build. On clusters, install inside the same environment that Slurm jobs will activate.
This example runs 100 updates with the corrected learner and the training settings from job 1938329. A group contains four responses, and each update consumes 96 responses. The Core uses four GPUs with tensor parallelism of four. The other three four-GPU nodes start with the observed rollout layout (one TP4, two TP2 and four TP1 services). The scheduler can lend GPUs to a four-GPU Hybrid replica during training. Experiment configuration
Use a shared checkout, a shared GPU Python environment with Megatron-Core and vLLM, and a local copy of Qwen3-14B accessible on all four nodes. Prepare the task index from the directory containing the 13 R2E-Gym V1 Parquet shards. The example uses seed 42 to choose 800 training tasks and a separate held-out cohort. It scores the same 20 held-out tasks before training and every 20 updates. R2E-Gym V1 dataset
python data/prepare_r2e_gym.py /shared/data/R2E-Gym-V1/data
sbatch scripts/submit_r2e_qwen3_14b_16gpu.slurm \
--source "$PWD" --model /shared/models/Qwen3-14B \
--tasks /shared/data/R2E-Gym-V1/data/index.jsonl \
--run-dir /shared/runs/r2e-14b-001
Use a new run directory visible to every node. It contains planned.yaml with the physical layout, train.log, and logs/eval/heldout-step-*.json with per-task rewards and their mean. The original job used an earlier gradient implementation and its own frozen task split.
Run CPU-friendly tests first:
pytest -q \
tests/test_cmlfq_scheduler.py \
tests/test_preflight_planner.py \
tests/test_global_resource_planner_simulators.py \
tests/test_grpo_grouping.py \
tests/test_runtime_elastic_executor.py
GPU, distributed, native-RDMA, and end-to-end tests are environment dependent.
See the production Slurm launchers under scripts/ and the distributed or
elastic test suites under tests/.
If Libra is useful in your research, please cite:
@misc{chen2026libraefficientresourcemanagement,
title={Libra: Efficient Resource Management for Agentic RL Post-Training},
author={Kaiwen Chen and Xin Tan and Jingzong Li and Zhi Zhou and Cen Li and
Jiang Liu and Jie Meng and Jiazhi Jiang and Hong Xu},
year={2026},
eprint={2606.03077},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2606.03077},
}
If you have any questions or feedback, please email Kaiwen Chen (kwchen@link.cuhk.edu.hk).
We gratefully acknowledge Huawei's 2012 Laboratories for their collaboration and support.
Libra builds on ideas and components from the broader open-source RL and distributed-systems ecosystem, including verl, vLLM, Megatron-LM, AReaL, Sailor, and Vidur. Please cite the corresponding projects when using those components.
Libra is released under the MIT License.
GitHub checked 111h ago - refresh overdue. Recently viewed repositories target hourly refresh.