Experimental status and tested version
- torchforge is experimental. Expect potential bugs, incomplete features, and API changes.
- This documentation and these instructions were tested with torchforge commit
8bd8d5d3c793ca6e2930b471b8ada67ce2458784.
Prerequisites
- Access to a SUNK cluster with GPU nodes.
- Minimum one H100 node for GRPO training.
- 10 GB available disk space.
- A GitHub access token.
- A Weights & Biases API key.
- Conda.
Initialize GitHub and Weights & Biases credentials
The torchforge installation pulls dependencies from GitHub, and the training job reports metrics to Weights & Biases. Export your credentials so both services are available during installation and training. At a Slurm login node, run the following commands:-
Export your GitHub token. Replace
[GITHUB-TOKEN]with your GitHub access token: -
Export your Weights & Biases API key:
Get your Weights & Biases API key from wandb.ai (User Settings > API keys). Replace
[WANDB-API-KEY]with your API key:
Install torchforge
Next, set up an isolated conda environment, clone the torchforge repository at the tested commit, and run the project’s installation script. Using a dedicated conda environment keeps torchforge’s dependencies separate from the rest of the system. To install torchforge, run the following commands:-
Initialize conda:
-
Create a conda environment:
You should see output similar to the following:
-
Activate torchforge:
-
Clone the repository:
-
Run the installation script:
The installation script takes 5 to 15 minutes to complete.
You should see output similar to the following. You don’t need to re-activate the conda environment:
-
Verify the installation:
You should see output similar to the following:
Run GRPO training
With torchforge installed, you can launch a short GRPO training run as a Slurm batch job. The following steps reduce the training step count for a quick test, define a batch script that requests an H100 node, submit the job, and tail the logs so you can watch training progress. To run GRPO training, complete the following steps:-
Edit the training configuration to reduce steps for testing:
The default configuration runs for 1,000,000 steps. Lower this to 10
steps to verify the end-to-end setup quickly without waiting for a
full training run.
-
Create a Slurm batch script
torchforge-training.sbatch: -
Submit the job:
-
Monitor logs:
Eventually, you see logs like the following: