Skip to content

torchforge RL Training

Guides an agent through Meta's torchforge library for reinforcement learning training runs

Stars
14,195
Licence
MIT
Files
3 files

What it does

This skill gives an AI agent detailed guidance on torchforge, Meta's PyTorch-based library for reinforcement learning (RL) on language models. With it installed, the agent can walk you through setting up an environment, writing YAML training configs, defining reward functions, writing custom loss functions, and scaling jobs across multiple GPUs. Torchforge is described as separating infrastructure from algorithm code so researchers can try methods like GRPO, DAPO and SAPO with less plumbing.

Great for

  • ML engineers or researchers who want to run GRPO or other RL post-training on a model using multiple GPUs
  • Developers experimenting with custom RL loss functions in PyTorch who want an agent to scaffold the code
  • Teams already using TorchTitan, vLLM or Monarch who want a guided starting point

Skip it if

  • Teams needing production-stable RL infrastructure: the skill itself says torchforge is experimental and APIs may change, and it points to miles or verl for production use
  • People without multi-GPU hardware: the workflows require 2 to 3+ GPUs, and running them costs significant compute
  • Non-technical users looking for a general AI assistant: this is narrow, hardware-heavy ML engineering guidance

Try asking

  • “Set up torchforge on a fresh Linux machine with conda and the install script, then verify the import works”
  • “Write a YAML config to run GRPO on Qwen2.5-7B-Instruct with the GSM8K dataset and explain each parameter”
  • “Create a custom reward function that scores math answers by checking a boxed final answer”
  • “Scaffold a new custom RL loss class in PyTorch that uses clipping and a KL penalty”
Step-by-step guide: how to use torchforge RL TrainingInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 3 original files, the MIT licence and an attribution note.

    torchforge.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip torchforge.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip torchforge.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Confirm your GPU count and CUDA or ROCm setup before asking the agent to launch training, since the workflows assume 2 to 3+ GPUs.
  • Review the install and launch scripts (scripts/install.sh, apps/*/main.py) before running them, because the agent will execute them and they install PyTorch nightly builds and large dependencies.
  • Pin versions and check the official torchforge repository, since the skill's guidance may lag behind an experimental API.

What's inside

  • references/api-reference.md
  • references/troubleshooting.md
  • SKILL.md

Redistributed unmodified from Orchestra-Research/AI-Research-SKILLs under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.