torchforge-rl-training

Implements PyTorch-native agentic RL training with GRPO, SFT, Monarch, and TorchTitan.

2|Updated Aug 15, 2026
One-click install
npx skills add https://github.com/Jensen-Yao/agents-skills --skill torchforge-rl-training-jensen-yao
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: torchforge-rl-training
Source: https://github.com/Jensen-Yao/agents-skills/tree/main/skills/torchforge
Command: npx skills add https://github.com/Jensen-Yao/agents-skills --skill torchforge-rl-training-jensen-yao

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch>=2.9.0, torchtitan>=0.2.0, vllm, monarch, and includes references (resource) components.

What problem does it solve? Setting up reinforcement learning training for LLMs requires wiring together distributed training, inference, and weight synchronization infrastructure, which distracts from actual algorithm research. This Skill provides guidance for using torchforge, Meta's PyTorch-native RL library that separates infrastructure concerns from algorithm logic. ## Core Features & Use Cases - GRPO and SFT Training Workflows: Step-by-step configuration and launch instructions for math reasoning training with group-relative advantages and supervised fine-tuning. - Custom Loss Functions: Implement new RL algorithms (GRPO, DAPO, SAPO variants) in roughly 100 lines using the forge.losses module without touching infrastructure. - Distributed Scaling: Configure multi-GPU and multi-node training with Monarch actors, TorchTitan parallelism, vLLM inference, and TorchStore weight sync. - Use Case: Train a Qwen2.5-7B model on GSM8K with GRPO across 3 GPUs by writing a YAML config, defining a math reward function, and launching with a single python -m apps.grpo.main command. ## Quick Start Ask the agent to help you set up a GRPO training run with torchforge for a math reasoning model, including the YAML configuration and reward function.

Frequently Asked Questions about torchforge-rl-training

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I train an LLM with GRPO using torchforge?▼

Create a YAML config specifying the model, dataset, and GRPO parameters like n_samples and beta, define a reward function from forge.data.rewards, then launch with python -m apps.grpo.main --config your_config.yaml. GRPO requires at least 3 GPUs for trainer, generator, and reference model.

torchforge vs verl vs miles for RL training?▼

torchforge prioritizes clean algorithm-infrastructure separation and rapid experimentation with PyTorch-native abstractions and no Ray dependency. For production-ready stability, verl or miles are better choices; for Megatron-native training, use slime. torchforge is experimental and APIs may change.

How many GPUs does torchforge need for training?▼

SFT requires at least 2 GPUs (trainer and generator), while GRPO needs 3 or more (trainer, generator, and reference model). You can reduce requirements by running the reference model on CPU or colocating services.

Why does vLLM run out of memory during generation in torchforge?▼

CUDA OOM during generation typically comes from large batch sizes or long sequences. Reduce n_samples in the GRPO config, lower seq_len in training settings, or decrease vLLM's gpu_memory_utilization to around 0.7.

How do I fix policy collapse during GRPO training?▼

Policy collapse shows as entropy dropping to zero with stalled rewards. Increase the KL penalty coefficient beta from 0.1 to 0.2, add an entropy bonus via entropy_coef, or reduce the learning rate to stabilize training.

Does torchforge support AMD GPUs with ROCm?▼

Yes, torchforge provides a dedicated ROCm installation script. Run ./scripts/install_rocm.sh instead of the standard install.sh to set up the environment for AMD GPUs.