Skip to main content

A PyTorch native platform for post-training generative AI models

Project description

image torchforge

A PyTorch-native agentic RL library that lets you focus on algorithms—not infra.

GPU Tests Documentation Discord

Overview

The primary purpose of the torchforge ecosystem is to delineate infra concerns from model concerns thereby making RL experimentation easier. torchforge delivers this by providing clear RL abstractions and one scalable implementation of these abstractions. When you need fine-grained control over placement, fault handling/redirecting training loads during a run, or communication patterns, the primitives are there. When you don’t, you can focus purely on your RL algorithm.

Key features:

  • Usability for rapid research (isolating the RL loop from infrastructure)
  • Hackability for power users (all parts of the RL loop can be easily modified without interacting with infrastructure)
  • Scalability (ability to shift between async and synchronous training and across thousands of GPUs)

⚠️ Early Development Warning torchforge is currently in an experimental stage. You should expect bugs, incomplete features, and APIs that may change in future versions. The project welcomes bugfixes, but to make sure things are well coordinated you should discuss any significant change before starting the work. It's recommended that you signal your intention to contribute in the issue tracker, either by filing a new issue or by claiming an existing one.

📖 Documentation (Coming Soon)

View torchforge's hosted documentation (coming soon)

Tutorials

You can also find our notebook tutorials (coming soon)

Installation

Basic

torchforge requires PyTorch 2.9.0 with Monarch, vLLM, and torchtitan. (Note that the basic install script uses DNF, but could be easily extended to other Linux OS.)

conda create -n forge python=3.12
conda activate forge
./scripts/install.sh

Optional: By default, the packages installation uses conda. If user wants to install system packages on the target machine instead of conda, they can pass the --use-sudo to the installation script: ./script/install.sh --use-sudo.

After install, you can run the following command and should see output confirming GRPO training is running (you need a minimum 3 GPU devices):

python -m apps.grpo.main --config apps/grpo/qwen3_1_7b.yaml

Quick Start

To run SFT on a Llama3 8B model, run

python -m apps.sft.main --config apps/sft/llama3_8b.yaml

Citation

License

Source code is made available under a BSD 3 license, however you may have other legal obligations that govern your use of other content linked in this repository, such as the license or terms of service for third-party data and models.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torchforge-0.1.0rc1.tar.gz (106.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torchforge-0.1.0rc1-py3-none-any.whl (129.2 kB view details)

Uploaded Python 3

File details

Details for the file torchforge-0.1.0rc1.tar.gz.

File metadata

  • Download URL: torchforge-0.1.0rc1.tar.gz
  • Upload date:
  • Size: 106.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for torchforge-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 2a9542f5320aa2ad280846ac1f50a1631db14ac1ef476237f507bd4ad592eec6
MD5 1e595375be3156c0812109cd9a16f801
BLAKE2b-256 fefed5b7d99a502a5c9e6cb50c91204670f55422ea67f54628108d85520ea75c

See more details on using hashes here.

File details

Details for the file torchforge-0.1.0rc1-py3-none-any.whl.

File metadata

  • Download URL: torchforge-0.1.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 129.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for torchforge-0.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 1426f5a08c63f5abcd00e61f1be8374c793fb669ff0c993138a220c0a29ab3f6
MD5 ac90feaa1949452f968f14501bd70413
BLAKE2b-256 c0f39ea823601cc49e3bf0ec0d7c9e407b6ae4d4881342d2a5ce62bc8d49a41a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page