Compare commits
38
Commits
v0.7.1.dev27
...
trinity
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6087c3addb | ||
|
|
99957ccd93 | ||
|
|
31ff561df6 | ||
|
|
dea7707526 | ||
|
|
fca9fb0975 | ||
|
|
1dcec737d9 | ||
|
|
43c2905243 | ||
|
|
54307fc301 | ||
|
|
069e580c78 | ||
|
|
45488ca048 | ||
|
|
3b5d031028 | ||
|
|
783cff546d | ||
|
|
acbabc6f0f | ||
|
|
055f62ca32 | ||
|
|
1b8c5ef01a | ||
|
|
55fc08db46 | ||
|
|
440b3afaa8 | ||
|
|
f5946b098e | ||
|
|
cd00986f71 | ||
|
|
208ea64308 | ||
|
|
c505e07a1a | ||
|
|
cb74ae2beb | ||
|
|
56a6c5fea6 | ||
|
|
d69dbb8da4 | ||
|
|
67ba2ff986 | ||
|
|
0af5506215 | ||
|
|
47f97ee1b0 | ||
|
|
5264eb8984 | ||
|
|
4453922943 | ||
|
|
ed16f19a05 | ||
|
|
691dd4ef14 | ||
|
|
256809b2ec | ||
|
|
d085605be2 | ||
|
|
3da69fdea9 | ||
|
|
aa4f04fe22 | ||
|
|
a12935c140 | ||
|
|
0eadc24027 | ||
|
|
3d2dbae5f7 |
@@ -146,7 +146,7 @@ jobs:
|
||||
id: artifact
|
||||
run: echo "name=benchmark-${{ matrix.runner }}-$(echo '${{ matrix.model }}' | sed 's/\//--/')-${{ matrix.type }}-${{ matrix.lora_rank || 'full' }}-${{ matrix.num_gpus }}gpu-${{ matrix.ac }}-${{ matrix.attention }}-${{ matrix.seq_len }}-cp${{ matrix.cp }}-ep${{ matrix.ep }}" >> "$GITHUB_OUTPUT"
|
||||
- name: Upload benchmark result
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
if: always()
|
||||
with:
|
||||
name: ${{ steps.artifact.outputs.name }}
|
||||
@@ -163,16 +163,16 @@ jobs:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout repository # We can't use the image because then no git
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Install dependencies
|
||||
run: uv sync
|
||||
- name: Download all benchmark artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
path: /tmp/benchmark_artifacts
|
||||
pattern: benchmark-*
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
name: Build Image (ghcr)
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref:
|
||||
@@ -27,12 +25,12 @@ on:
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: primeintellect-ai/prime-rl
|
||||
BUILD_REF: ${{ github.event.release.tag_name || inputs.ref || github.ref_name }}
|
||||
BUILD_TAG: ${{ github.event.release.tag_name || inputs.tag || '' }}
|
||||
BUILD_REF: ${{ inputs.ref || github.ref_name }}
|
||||
BUILD_TAG: ${{ inputs.tag || '' }}
|
||||
BUILD_PLATFORMS: ${{ inputs.platforms || 'both' }}
|
||||
|
||||
concurrency:
|
||||
group: build-image-${{ github.event.release.tag_name || inputs.tag || inputs.ref || github.ref_name }}
|
||||
group: build-image-${{ inputs.tag || inputs.ref || github.ref_name }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
@@ -71,7 +69,7 @@ jobs:
|
||||
esac
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ env.BUILD_REF }}
|
||||
fetch-depth: 0
|
||||
@@ -129,7 +127,7 @@ jobs:
|
||||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ needs.prepare.outputs.ref }}
|
||||
fetch-depth: 0
|
||||
@@ -143,18 +141,18 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Build and push
|
||||
id: build
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile.cuda
|
||||
@@ -198,7 +196,7 @@ jobs:
|
||||
packages: write
|
||||
steps:
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: false
|
||||
- name: Init public submodules
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||
git submodule update --init --recursive -- deps/verifiers deps/renderers deps/research-environments deps/pydantic-config
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
@@ -48,9 +48,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
@@ -98,7 +98,7 @@ jobs:
|
||||
# The slim wheel intentionally excludes taskset packages, so validate a real
|
||||
# SFT config here. RL recipes are covered by the full config suite.
|
||||
for cfg_cls, args in [
|
||||
(SFTConfig, ["@", "examples/reverse_text/slurm_sft.toml"]),
|
||||
(SFTConfig, ["@", "configs/ci/slim_sft.toml"]),
|
||||
]:
|
||||
cfg = cli(cfg_cls, args=args)
|
||||
assert cfg.slurm is not None, f"expected [slurm] in {args}"
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create next .dev tag from latest release
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
const { owner, repo } = context.repo;
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
name: Docker Push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags:
|
||||
- "*"
|
||||
jobs:
|
||||
cuda:
|
||||
name: Push CUDA image to Docker
|
||||
runs-on: image-builder
|
||||
steps:
|
||||
- name: Remove unnecessary packages
|
||||
run: |
|
||||
echo "=== Before pruning ==="
|
||||
df -h
|
||||
sudo rm -rf /usr/share/dotnet
|
||||
sudo rm -rf /usr/local/lib/android
|
||||
sudo rm -rf /opt/ghc
|
||||
echo "=== After pruning ==="
|
||||
df -h
|
||||
|
||||
# Link to discussion: https://github.com/orgs/community/discussions/25678
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: false
|
||||
- name: Init public submodules
|
||||
run: |
|
||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||
git submodule update --init --recursive -- deps/verifiers deps/renderers deps/research-environments deps/pydantic-config
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: crazy-max/ghaction-docker-meta@v2
|
||||
with:
|
||||
images: |
|
||||
primeintellect/prime-rl
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha,prefix=commit-
|
||||
type=raw,value=latest,enable=${{ github.ref_type == 'tag' }}
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile.cuda
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
||||
- name: Test import
|
||||
run: docker run --entrypoint python primeintellect/prime-rl:main -c "import prime_rl"
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
apt-get install -y git
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: false
|
||||
- name: Init public submodules
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||
git submodule update --init --recursive -- deps/verifiers deps/renderers deps/research-environments deps/pydantic-config
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
uses: astral-sh/setup-uv@v7
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras --all-packages --locked
|
||||
- name: Run unit tests
|
||||
@@ -97,7 +97,7 @@ jobs:
|
||||
apt-get install -y git
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: false
|
||||
- name: Init public submodules
|
||||
@@ -105,7 +105,7 @@ jobs:
|
||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||
git submodule update --init --recursive -- deps/verifiers deps/renderers deps/research-environments deps/pydantic-config
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
uses: astral-sh/setup-uv@v7
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras --all-packages --locked
|
||||
- name: Run integration tests
|
||||
@@ -121,3 +121,11 @@ jobs:
|
||||
PYTEST_OUTPUT_DIR: /tmp/outputs
|
||||
VLLM_WORKER_MULTIPROC_METHOD: spawn
|
||||
run: uv run pytest -vvs ${{ matrix.pytest_args }}
|
||||
- name: Upload run logs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.test }}-logs
|
||||
path: /tmp/outputs/**/*.log
|
||||
retention-days: 7
|
||||
if-no-files-found: ignore
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
name: Nightly FFT
|
||||
|
||||
on:
|
||||
# Allow to manually trigger the workflow
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
config_file:
|
||||
description: "Full-FT config to dispatch (e.g. configs/ci/nightly-fft/wordle.toml). Leave empty to run all."
|
||||
required: false
|
||||
default: ""
|
||||
image_tag:
|
||||
description: "prime-rl image tag to pin (e.g. v0.7.1.dev58). Leave empty to auto-resolve the newest v*.dev* with a published manifest."
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
# Scheduled run at 3AM PST (11AM UTC) — disabled for now, enable once dry-run passes
|
||||
# schedule:
|
||||
# - cron: "0 11 * * *"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
|
||||
jobs:
|
||||
discover-configs:
|
||||
name: Discover configs
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
matrix: ${{ steps.build-matrix.outputs.matrix }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: false
|
||||
|
||||
- name: Build matrix from nightly FFT configs
|
||||
id: build-matrix
|
||||
run: |
|
||||
# Find all nightly full-finetune configs
|
||||
files=$(ls configs/ci/nightly-fft/*.toml)
|
||||
|
||||
# Filter to specific config if provided in workflow_dispatch
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.config_file }}" ]; then
|
||||
filtered=$(echo "$files" | grep -F "${{ github.event.inputs.config_file }}" || true)
|
||||
if [ -z "$filtered" ]; then
|
||||
echo "Error: Config file '${{ github.event.inputs.config_file }}' not found"
|
||||
exit 1
|
||||
fi
|
||||
files="$filtered"
|
||||
fi
|
||||
|
||||
echo "Discovered nightly FFT configs:"
|
||||
echo "$files"
|
||||
|
||||
# Build JSON of the form: { "config_file": ["configs/ci/nightly-fft/foo.toml", ...] }
|
||||
json=$(printf '%s\n' "$files" | jq -R . | jq -sc '{config_file: .}')
|
||||
|
||||
echo "matrix=$json" >> "$GITHUB_OUTPUT"
|
||||
|
||||
dispatch-run:
|
||||
name: Dispatch hosted FFT run
|
||||
needs: discover-configs
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJSON(needs.discover-configs.outputs.matrix) }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: false
|
||||
|
||||
- name: Resolve prime-rl image tag
|
||||
id: image
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Pass the dispatch input through env so a malicious value
|
||||
# cannot break out of shell context via $(...) or embedded
|
||||
# quotes — the GitHub expression is substituted before Bash
|
||||
# parses the script.
|
||||
REQUESTED_IMAGE_TAG: ${{ github.event.inputs.image_tag }}
|
||||
run: |
|
||||
# If workflow_dispatch passed an explicit image_tag, validate
|
||||
# it as a Docker/OCI tag, verify its manifest is pullable,
|
||||
# and use it as-is (skip resolution).
|
||||
requested="$REQUESTED_IMAGE_TAG"
|
||||
if [ -n "$requested" ]; then
|
||||
# OCI/Docker tag charset: [A-Za-z0-9._-], max 128, no
|
||||
# leading '.' or '-'. Reject anything else before it
|
||||
# reaches curl or GITHUB_OUTPUT.
|
||||
if ! printf '%s' "$requested" | grep -Eq '^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$'; then
|
||||
echo "Invalid image_tag: only [A-Za-z0-9._-] allowed, max 128 chars, no leading '.' or '-'." >&2
|
||||
exit 1
|
||||
fi
|
||||
registry_token=$(curl -fsSL \
|
||||
"https://ghcr.io/token?scope=repository:primeintellect-ai/prime-rl:pull" \
|
||||
| jq -r .token)
|
||||
code=$(curl -sS -o /dev/null -w '%{http_code}' \
|
||||
-H "Authorization: Bearer $registry_token" \
|
||||
-H 'Accept: application/vnd.oci.image.index.v1+json' \
|
||||
-H 'Accept: application/vnd.docker.distribution.manifest.list.v2+json' \
|
||||
"https://ghcr.io/v2/primeintellect-ai/prime-rl/manifests/$requested")
|
||||
if [ "$code" != "200" ]; then
|
||||
echo "Requested image_tag '$requested' has no published manifest (HTTP $code)." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Using pinned prime-rl image tag: $requested"
|
||||
echo "tag=$requested" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# The GHCR versions API can list a tag before its manifest is
|
||||
# actually pullable (build in-flight, or manifest step didn't
|
||||
# finish). So: pull the top N candidate tags, then verify each
|
||||
# with a manifest HEAD via the anonymous registry token flow;
|
||||
# take the newest one that resolves.
|
||||
candidates=$(gh api --paginate \
|
||||
"/orgs/primeintellect-ai/packages/container/prime-rl/versions" \
|
||||
--jq '.[].metadata.container.tags[]' \
|
||||
| grep -E '^v[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+$' \
|
||||
| sort -Vru | head -n 10)
|
||||
if [ -z "$candidates" ]; then
|
||||
echo "No v*.dev* tag listed on GHCR." >&2
|
||||
exit 1
|
||||
fi
|
||||
registry_token=$(curl -fsSL \
|
||||
"https://ghcr.io/token?scope=repository:primeintellect-ai/prime-rl:pull" \
|
||||
| jq -r .token)
|
||||
tag=""
|
||||
for cand in $candidates; do
|
||||
code=$(curl -sS -o /dev/null -w '%{http_code}' \
|
||||
-H "Authorization: Bearer $registry_token" \
|
||||
-H 'Accept: application/vnd.oci.image.index.v1+json' \
|
||||
-H 'Accept: application/vnd.docker.distribution.manifest.list.v2+json' \
|
||||
"https://ghcr.io/v2/primeintellect-ai/prime-rl/manifests/$cand")
|
||||
if [ "$code" = "200" ]; then
|
||||
tag="$cand"
|
||||
break
|
||||
fi
|
||||
echo "Skip $cand — manifest HEAD returned $code"
|
||||
done
|
||||
if [ -z "$tag" ]; then
|
||||
echo "None of the top v*.dev* tags have a published manifest." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Latest published prime-rl image tag on GHCR: $tag"
|
||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
|
||||
- name: Install prime CLI (latest)
|
||||
run: uv tool install prime
|
||||
|
||||
- name: Dispatch run
|
||||
env:
|
||||
PRIME_API_KEY: ${{ secrets.PRIME_FFT_API_KEY }}
|
||||
PRIME_TEAM_ID: ${{ secrets.PRIME_FFT_TEAM_ID }}
|
||||
PRIME_BASE_URL: ${{ secrets.PRIME_BASE_URL }}
|
||||
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
run: |
|
||||
echo "Dispatching config: ${{ matrix.config_file }}"
|
||||
echo "Image tag: ${{ steps.image.outputs.tag }}"
|
||||
# Tag the RFTRun so it's identifiable on the platform as
|
||||
# coming from this workflow. Injected here rather than in
|
||||
# the checked-in toml because a top-level `name` field
|
||||
# breaks tests/unit/test_configs.py::test_load_configs
|
||||
# (RLConfig has no top-level name).
|
||||
config_base=$(basename "${{ matrix.config_file }}" .toml)
|
||||
run_name="nightly-${config_base}-$(date -u +%Y-%m-%d)-${{ github.run_id }}"
|
||||
dispatch_cfg=$(mktemp --suffix=.toml)
|
||||
printf 'name = "%s"\n\n' "$run_name" > "$dispatch_cfg"
|
||||
cat "${{ matrix.config_file }}" >> "$dispatch_cfg"
|
||||
echo "Dispatched run name: $run_name"
|
||||
# Forward WANDB_API_KEY / HF_TOKEN into the hosted payload:
|
||||
# the full-FT dispatch path (`prime train`) only picks up
|
||||
# secrets that were explicitly collected via `-e` / `--env-file`,
|
||||
# not ambient env, so the workflow env: block alone is not
|
||||
# enough to reach the hosted trainer/orchestrator pods.
|
||||
prime train "$dispatch_cfg" \
|
||||
--image-tag "${{ steps.image.outputs.tag }}" \
|
||||
-e WANDB_API_KEY \
|
||||
-e HF_TOKEN \
|
||||
--yes --output json
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: false
|
||||
|
||||
@@ -73,7 +73,7 @@ jobs:
|
||||
apt-get install -y git
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: false
|
||||
- name: Init public submodules
|
||||
@@ -81,7 +81,7 @@ jobs:
|
||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||
git submodule update --init --recursive -- deps/verifiers deps/renderers deps/research-environments deps/pydantic-config
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
|
||||
@@ -15,17 +15,17 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
# Submodules are excluded from ruff via pyproject.toml; no need to fetch them.
|
||||
with:
|
||||
submodules: false
|
||||
- name: Run ruff
|
||||
uses: astral-sh/ruff-action@v3
|
||||
uses: astral-sh/ruff-action@v4.1.0
|
||||
with:
|
||||
version: "0.13.0"
|
||||
args: "check --config=pyproject.toml"
|
||||
- name: Run ruff format (check)
|
||||
uses: astral-sh/ruff-action@v3
|
||||
uses: astral-sh/ruff-action@v4.1.0
|
||||
with:
|
||||
version: "0.13.0"
|
||||
args: "format --check --config=pyproject.toml"
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
name: Sync Docs to Public Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'docs/**'
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
trigger-docs-sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Validate mint.json pages exist
|
||||
run: |
|
||||
@@ -46,7 +44,7 @@ jobs:
|
||||
echo "All mint.json pages verified."
|
||||
|
||||
- name: Trigger public-docs workflow
|
||||
uses: peter-evans/repository-dispatch@v3
|
||||
uses: peter-evans/repository-dispatch@v4
|
||||
with:
|
||||
token: ${{ secrets.DOCS_SYNC_PAT }}
|
||||
repository: PrimeIntellect-ai/public-docs
|
||||
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
version: ${{ steps.tag.outputs.version }}
|
||||
steps:
|
||||
- name: Checkout main
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -119,6 +119,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
# Needed to dispatch build_image.yaml below (POST .../dispatches).
|
||||
actions: write
|
||||
steps:
|
||||
- name: Publish draft release
|
||||
env:
|
||||
@@ -127,22 +129,33 @@ jobs:
|
||||
run: |
|
||||
gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --draft=false --latest
|
||||
|
||||
# Publishing runs as GITHUB_TOKEN, whose events don't retrigger
|
||||
# workflows, so dispatch the image build explicitly.
|
||||
- name: Trigger image build for the release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TAG: ${{ needs.auto-tag-on-main.outputs.tag }}
|
||||
run: |
|
||||
gh workflow run build_image.yaml --repo "$GITHUB_REPOSITORY" -f ref="$TAG"
|
||||
|
||||
tag-and-release:
|
||||
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
# Needed to dispatch build_image.yaml below (POST .../dispatches).
|
||||
actions: write
|
||||
steps:
|
||||
- name: Checkout tagged release (dispatch)
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: refs/tags/${{ inputs.tag }}
|
||||
|
||||
- name: Checkout tagged release (push)
|
||||
if: github.event_name != 'workflow_dispatch'
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -195,6 +208,7 @@ jobs:
|
||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Publish draft release
|
||||
id: publish
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TAG: ${{ steps.release.outputs.tag }}
|
||||
@@ -207,6 +221,17 @@ jobs:
|
||||
fi
|
||||
if [ "$STATE" = "false" ]; then
|
||||
echo "Release $TAG is already published; nothing to do."
|
||||
echo "published=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --draft=false --latest
|
||||
echo "published=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# Skipped when the release was already published (no rebuild needed).
|
||||
- name: Trigger image build for the release
|
||||
if: steps.publish.outputs.published == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TAG: ${{ steps.release.outputs.tag }}
|
||||
run: |
|
||||
gh workflow run build_image.yaml --repo "$GITHUB_REPOSITORY" -f ref="$TAG"
|
||||
|
||||
+2
-1
@@ -3,7 +3,8 @@
|
||||
url = git@github.com:PrimeIntellect-ai/verifiers.git
|
||||
[submodule "renderers"]
|
||||
path = deps/renderers
|
||||
url = git@github.com:PrimeIntellect-ai/renderers.git
|
||||
url = ../renderers.git
|
||||
branch = trinity
|
||||
[submodule "research-environments"]
|
||||
path = deps/research-environments
|
||||
url = git@github.com:PrimeIntellect-ai/research-environments.git
|
||||
|
||||
+2
-1
@@ -85,6 +85,7 @@ COPY packages/ /app/packages/
|
||||
COPY deps/ /app/deps/
|
||||
COPY configs /app/configs
|
||||
COPY examples /app/examples
|
||||
COPY k8s /app/k8s
|
||||
COPY benchmarks/scripts /app/benchmarks/scripts
|
||||
COPY scripts/docker-editable-pretend-versions.sh /app/scripts/docker-editable-pretend-versions.sh
|
||||
|
||||
@@ -105,7 +106,7 @@ RUN --mount=type=cache,target=/app/.cache/uv \
|
||||
&& \
|
||||
sed -i "s/fallback-version = \"0.0.0\"/fallback-version = \"${RENDERERS_PRETEND_VERSION}\"/" /app/deps/renderers/pyproject.toml \
|
||||
&& \
|
||||
uv sync --all-packages --extra flash-attn --extra flash-attn-3 --extra flash-attn-cute --extra disagg --extra gpt-oss --extra modelexpress --extra quack --group mamba-ssm --locked --no-dev \
|
||||
uv sync --all-packages --extra flash-attn --extra flash-attn-3 --extra flash-attn-cute --extra disagg --extra gpt-oss --extra quack --group mamba-ssm --locked --no-dev \
|
||||
&& \
|
||||
/app/.venv/bin/python -c 'from importlib.metadata import version; [version(name) for name in ("deep-ep", "deep-gemm", "mamba-ssm", "nixl", "quack-kernels", "vllm", "vllm-router")]'
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
---
|
||||
|
||||
<h3 align="center">
|
||||
PRIME-RL: Async RL Training at Scale
|
||||
prime-rl: Async RL Training at Scale
|
||||
</h3>
|
||||
|
||||
---
|
||||
@@ -29,7 +29,7 @@ PRIME-RL: Async RL Training at Scale
|
||||
|
||||
## Overview
|
||||
|
||||
PRIME-RL is a framework for large-scale reinforcement learning. It is designed to be easy to use and hackable, yet capable of scaling to 1000+ GPUs. Here is what we think sets it apart:
|
||||
prime-rl is a framework for large-scale reinforcement learning. It is designed to be easy to use and hackable, yet capable of scaling to 1000+ GPUs. Here is what we think sets it apart:
|
||||
|
||||
1. Fully asynchronous RL for high-throughput agentic training at scale.
|
||||
2. Performant: built to train 1T+ MoE models on 1000+ GPUs with [FSDP2](https://docs.pytorch.org/tutorials/intermediate/FSDP_tutorial.html) for training and [vLLM](https://github.com/vllm-project/vllm) for inference, with FP8 inference, PD disaggregation, EP and CP parallelism, and more.
|
||||
@@ -38,7 +38,7 @@ PRIME-RL is a framework for large-scale reinforcement learning. It is designed t
|
||||
5. Multi-node deployment with Slurm and Kubernetes support.
|
||||
6. Multimodal support for VLMs such as Qwen3-VL.
|
||||
7. Hackable, modular, and extensible by design.
|
||||
8. One-line SLURM deployment for frontier models — e.g. [`GLM-5` FP8 with P/D disaggregation, the `llm-d` router, and Mooncake KV offload](examples/glm5_llmd/README.md).
|
||||
8. One-line SLURM deployment for frontier models — e.g. [`GLM-5` FP8 with P/D disaggregation, the `llm-d` router, and Mooncake KV offload](examples/advanced/glm-5.2/).
|
||||
|
||||
|
||||
## Models support
|
||||
@@ -53,7 +53,7 @@ With `[model] impl = "auto"` (the default), the trainer selects that custom stac
|
||||
| GLM-5 (`glm_moe_dsa`) | `zai-org/GLM-5`, `zai-org/GLM-5-FP8` | yes | ✅ | ✅ |
|
||||
| Qwen3 MoE (`qwen3_moe`) | `Qwen/Qwen3-30B-A3B`, … | yes | ✅ | ✅ |
|
||||
| Qwen3.5 MoE (`qwen3_5_moe`) | `Qwen/Qwen3.5-35B-A3B`, … | yes | ✅ | ✅ |
|
||||
| Qwen3 / Qwen3.5 VLMs | see [advanced.md](docs/advanced.md#vision-language-models) (`qwen3_vl`, `qwen3_5`, `qwen3_5_moe`) | MoE only on MoE VLMs | MoE only | ✅ |
|
||||
| Qwen3 / Qwen3.5 VLMs | see [advanced.md](docs/advanced.md#multimodal-training) (`qwen3_vl`, `qwen3_5`, `qwen3_5_moe`) | MoE only on MoE VLMs | MoE only | ❌ |
|
||||
| Poolside Laguna (`laguna`) | `poolside/Laguna-XS.2` | yes | ✅ | ✅ |
|
||||
| MiniMax M2 (`minimax_m2`) | `MiniMax/MiniMax-M2` | yes | ✅ | ✅ |
|
||||
| Nemotron H (`nemotron_h`) | `nvidia/Nemotron-3-Nano-30B-A3B`, `nvidia/Nemotron-3-Super-120B-A12B`, … | yes | ✅ | ✅ |
|
||||
@@ -69,11 +69,11 @@ With `[model] impl = "auto"` (the default), the trainer selects that custom stac
|
||||
|
||||
### Prerequisites
|
||||
|
||||
Currently, you **need at least one NVIDIA GPU to use PRIME-RL**. If you don't already have access to one, we recommend our [compute platform](https://app.primeintellect.ai) for everything from renting on-demand single GPUs for developing, debugging and small ablations, to [reserving 1000+ GPU clusters](https://app.primeintellect.ai/dashboard/quotes) for production-scale training.
|
||||
Currently, you **need at least one NVIDIA GPU to use prime-rl**. If you don't already have access to one, we recommend our [compute platform](https://app.primeintellect.ai) for everything from renting on-demand single GPUs for developing, debugging and small ablations, to [reserving 1000+ GPU clusters](https://app.primeintellect.ai/dashboard/quotes) for production-scale training.
|
||||
|
||||
### Quick Setup
|
||||
|
||||
Set up PRIME-RL in a single command.
|
||||
Set up prime-rl in a single command.
|
||||
|
||||
```bash
|
||||
curl -sSL https://raw.githubusercontent.com/PrimeIntellect-ai/prime-rl/main/scripts/install.sh | bash
|
||||
@@ -154,33 +154,25 @@ uv run python -c "import flash_attn"
|
||||
3. Check that you can run SFT trainer (*this requires 1 GPU*)
|
||||
|
||||
```bash
|
||||
uv run sft @ configs/debug/sft/train.toml
|
||||
uv run sft @ configs/debug/fake/sft.toml
|
||||
```
|
||||
|
||||
4. Check that you can run the RL trainer (*this requires 1 GPU*)
|
||||
|
||||
```bash
|
||||
uv run trainer @ configs/debug/rl/train.toml
|
||||
uv run trainer @ configs/debug/fake/rl.toml
|
||||
```
|
||||
|
||||
5. Check that you can run the inference server (*this requires 1 GPU*)
|
||||
|
||||
```bash
|
||||
uv run inference @ configs/debug/infer.toml
|
||||
uv run inference --model.name Qwen/Qwen3-0.6B
|
||||
```
|
||||
|
||||
*Keep the inference server running in the background for the next steps.*
|
||||
|
||||
5.1. Check that you can run the orchestrator against the inference server
|
||||
6. Check that the full RL stack (inference + orchestrator + trainer) runs end-to-end (*this requires 2 GPUs*)
|
||||
|
||||
```bash
|
||||
uv run orchestrator @ configs/debug/orch.toml
|
||||
```
|
||||
|
||||
5.2. Check that you can run evals against the inference server
|
||||
|
||||
```bash
|
||||
uv run eval @ configs/debug/eval.toml
|
||||
uv run rl @ configs/basic/reverse-text/rl.toml
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -206,29 +198,29 @@ We provide end-to-end training examples in the [`examples`](examples) directory
|
||||
|
||||
### Basic Training: 1 to 8 GPUs
|
||||
|
||||
Follow this guide to learn the basics of Prime-RL. You can train your own models on 1 to 8 GPUs. Ideal for getting started and exploring the capabilities of the framework. These guides cover most use cases -- single-turn, multi-turn, tool calling, etc. -- on toy environments and small models.
|
||||
Follow this guide to learn the basics of prime-rl. You can train your own models on 1 to 8 GPUs. Ideal for getting started and exploring the capabilities of the framework. These guides cover most use cases -- single-turn, multi-turn, tool calling, etc. -- on toy environments and small models.
|
||||
|
||||
1. [**Reverse Text**](examples/reverse_text/README.md): Train `Qwen3-0.6B` to reverse a small chunk of text. Demonstrates tiny-scale single-turn SFT and RL training. Can be trained on a single consumer GPU in a few minutes, and is ideal for getting started.
|
||||
2. [**Wordle**](examples/wordle/README.md): Train `Qwen3-1.7B` to play Wordle. A fun example of multi-turn SFT and RL training. Can be trained on a 2-4 H100 GPUs in a few hours. Ideal for exploring the multi-turn training capabilities of the framework.
|
||||
3. [**Alphabet Sort**](examples/alphabet_sort/README.md): Train `Qwen3-4B-Instruct-2507` to sort names alphabetically. Demonstrates multi-turn RL training via LoRA without SFT warmup. Can be trained on a single H100 GPU in just over an hour. Ideal for exploring LoRA-based training.
|
||||
4. [**Wiki Search**](examples/wiki_search/README.md): Train `Qwen3-4B-Instruct-2507` to answer trivia questions by searching through a Wikipedia. Demonstrates multi-turn with web search tool use.
|
||||
5. [**Hendrycks Sanity**](examples/hendrycks_sanity/README.md): Run a sanity check experiment on `DeepSeek-R1-Distill-Qwen-1.5B` using a filtered subset of MATH where the model already partially solves 20-80% of problems. Useful for algorithm ablations.
|
||||
1. [**Reverse Text**](examples/basic/reverse-text/README.md): Train `Qwen3-0.6B` to reverse a small chunk of text. Demonstrates tiny-scale single-turn SFT and RL training. Can be trained on a single consumer GPU in a few minutes, and is ideal for getting started.
|
||||
2. [**Wordle**](examples/basic/wordle/README.md): Train `Qwen3-1.7B` to play Wordle. A fun example of multi-turn SFT and RL training. Can be trained on a 2-4 H100 GPUs in a few hours. Ideal for exploring the multi-turn training capabilities of the framework.
|
||||
3. [**Alphabet Sort**](examples/basic/alphabet-sort/README.md): Train `Qwen3-4B-Instruct-2507` to sort names alphabetically. Demonstrates multi-turn RL training via LoRA without SFT warmup. Can be trained on a single H100 GPU in just over an hour. Ideal for exploring LoRA-based training.
|
||||
4. [**Wiki Search**](examples/basic/wiki-search/README.md): Train `Qwen3-4B-Instruct-2507` to answer trivia questions by searching through a Wikipedia. Demonstrates multi-turn with web search tool use.
|
||||
5. [**Hendrycks Sanity**](examples/basic/hendrycks-sanity/README.md): Run a sanity check experiment on `DeepSeek-R1-Distill-Qwen-1.5B` using a filtered subset of MATH where the model already partially solves 20-80% of problems. Useful for algorithm ablations.
|
||||
|
||||
### Advanced Training: 32 - 2048 GPUs:
|
||||
|
||||
Follow this guide to train large models on hard reasoning and agentic / swe environments.
|
||||
Follow this guide to train large models on hard reasoning and agentic tasks.
|
||||
These guides are designed to be run from a Slurm cluster but can also be adapted to k8s deployments.
|
||||
|
||||
1. [**Qwen 3 30B - A3B Math**](examples/qwen30b_math/README.md): Train `Qwen3-30B-A3B` to solve hard math problems.
|
||||
2. [**Qwen 3 30B - A3B SWE**](examples/qwen30b_swe/README.md): Train `Qwen3-30B-A3B` to solve hard SWE problems.
|
||||
3. [**Intellect-3.1**](examples/Intellect-3.1/README.md): Reproduce our `INTELLECT-3.1` training run.
|
||||
4. [**MiniMax-M2.5 SWE**](examples/minimax_m2.5_swe/README.md): Train `MiniMax-M2.5` on agentic SWE tasks.
|
||||
5. [**High-throughput GLM-5**](examples/glm5_pd_disag/README.md): Train `GLM-5` with PD disaggregation and FP8 inference on SWE.
|
||||
6. [**High-throughput GLM-5 (llm-d)**](examples/glm5_llmd/README.md): One-line SLURM deployment for `GLM-5` FP8 with P/D disaggregation, the `llm-d` router, and Mooncake KV offload — the faster way to run `GLM-5`.
|
||||
1. [**Qwen3-30B-A3B**](examples/advanced/qwen3-30b-a3b/): Train `Qwen3-30B-A3B` on math, SWE, and agentic tool use.
|
||||
2. [**GLM-4.5-Air**](examples/advanced/glm-4.5-air/): Train `GLM-4.5-Air` on search, SWE, and terminal tasks.
|
||||
3. [**Nemotron-3-Super**](examples/advanced/nemotron-3-super/): Train the `Nemotron-3-Super-120B` hybrid-Mamba MoE on SWE at 131k context.
|
||||
4. [**MiniMax-M2.5 SWE**](examples/advanced/minimax-m2.5/): Train `MiniMax-M2.5` on agentic SWE tasks.
|
||||
5. [**INTELLECT-3.1**](examples/advanced/intellect-3.1/): Reproduce our `INTELLECT-3.1` training run.
|
||||
6. [**High-throughput GLM-5**](examples/advanced/glm-5.2/): Large-scale `GLM-5`/`GLM-5.2` inference with P/D disaggregation, the `llm-d` router, and FP8.
|
||||
|
||||
## Docs
|
||||
|
||||
Check out the [docs](docs) directory for in-depth guides on how to use PRIME-RL.
|
||||
Check out the [docs](docs) directory for in-depth guides on how to use prime-rl.
|
||||
|
||||
- [**Overview**](docs/overview.md) - Architecture, install, and a copy-pasteable end-to-end RL run
|
||||
- [**Configuration**](docs/configuration.md) - TOML composition, CLI overrides, env vars, validation
|
||||
@@ -276,7 +268,7 @@ If you find our work useful, feel free to cite it using
|
||||
```tex
|
||||
@misc{primeintellect2025prime-rl,
|
||||
author = {Prime Intellect},
|
||||
title = {PRIME-RL},
|
||||
title = {prime-rl},
|
||||
url = {https://github.com/PrimeIntellect-ai/prime-rl},
|
||||
year = {2025}
|
||||
}
|
||||
|
||||
+15
-1
@@ -1,3 +1,17 @@
|
||||
# Configs
|
||||
|
||||
This directory contains configurations for internal experiments. We do not guarantee that these configurations are functional or up-to-date.
|
||||
Configurations for running prime-rl.
|
||||
|
||||
- **[`basic/`](basic)** — small, 2-GPU (1 trainer + 1 inference) configs for the core
|
||||
environments, sized to run on a single dev machine. Each mirrors the matching
|
||||
[`examples/basic/`](../examples/basic) tutorial and is smoke-tested for one step.
|
||||
Envs: `reverse-text`, `alphabet-sort`, `wiki-search`, `wordle`, `hendrycks-sanity`.
|
||||
- **`ci/`** — integration and nightly configs used by CI.
|
||||
- **`debug/`** — throwaway configs for developing the framework itself: `algo/`
|
||||
(per-algorithm smokes) and `fake/` (fake-data trainer/SFT smokes). Not guaranteed
|
||||
functional or up to date.
|
||||
|
||||
```bash
|
||||
uv run rl @ configs/basic/<env>/rl.toml
|
||||
uv run sft @ configs/basic/<env>/sft.toml # where present
|
||||
```
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
max_steps = 100
|
||||
seq_len = 2048
|
||||
|
||||
[wandb]
|
||||
project = "alphabet-sort-debug"
|
||||
name = "alphabet-sort"
|
||||
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 512
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "alphabet-sort"
|
||||
taskset = { id = "alphabet-sort-v1", min_turns = 2, max_turns = 2 }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 50
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "alphabet-sort"
|
||||
num_examples = 50
|
||||
group_size = 4
|
||||
taskset = { id = "alphabet-sort-v1", min_turns = 2, max_turns = 2 }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer]
|
||||
|
||||
[inference]
|
||||
@@ -0,0 +1,8 @@
|
||||
# alphabet-sort (2 GPU)
|
||||
|
||||
Multi-turn task driven by a colocated user simulator, LoRA on `Qwen3-4B`. Dev mirror of
|
||||
[`examples/basic/alphabet-sort`](../../../examples/basic/alphabet-sort).
|
||||
|
||||
```bash
|
||||
uv run rl @ configs/basic/alphabet-sort/rl.toml
|
||||
```
|
||||
@@ -0,0 +1,42 @@
|
||||
# Alphabet-sort on 2 GPUs (1 trainer + 1 inference) — a multi-turn task driven by a colocated
|
||||
# user simulator, trained with LoRA on Qwen3-4B. Dev-sized mirror of examples/basic/alphabet-sort.
|
||||
|
||||
max_steps = 200
|
||||
seq_len = 2048
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 1
|
||||
num_infer_gpus = 1
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[wandb]
|
||||
project = "alphabet-sort"
|
||||
name = "alphabet-sort"
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 32
|
||||
alpha = 64
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-5
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 768
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "alphabet-sort"
|
||||
env.taskset = { id = "alphabet-sort-v1", min_turns = 3, max_turns = 5, task = { power_per_turn = false } }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[ckpt] # Checkpoint at the end of training
|
||||
|
||||
[inference]
|
||||
@@ -0,0 +1,9 @@
|
||||
# hendrycks-sanity (2 GPU)
|
||||
|
||||
Single-turn math sanity run (reward climbs slowly, meant to run long),
|
||||
`DeepSeek-R1-Distill-Qwen-1.5B`. Dev mirror of
|
||||
[`examples/basic/hendrycks-sanity`](../../../examples/basic/hendrycks-sanity).
|
||||
|
||||
```bash
|
||||
uv run rl @ configs/basic/hendrycks-sanity/rl.toml
|
||||
```
|
||||
@@ -0,0 +1,36 @@
|
||||
# Hendrycks-math sanity on 2 GPUs (1 trainer + 1 inference) — a single-turn math env meant to
|
||||
# run long (reward climbs slowly). Dev-sized mirror of examples/basic/hendrycks-sanity.
|
||||
|
||||
max_steps = 5000
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 1
|
||||
num_infer_gpus = 1
|
||||
|
||||
[model]
|
||||
name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
|
||||
[wandb]
|
||||
project = "hendrycks-sanity"
|
||||
name = "hendrycks-sanity"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 8
|
||||
seq_len = 8192
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "hendrycks-math"
|
||||
env.taskset = { id = "math-env-v1", dataset_name = "mikasenghaas/Sanity-Test-R1D-1.5B", dataset_subset = "default" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.model]
|
||||
seq_len = 16384
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 8192
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
reasoning_parser = "think"
|
||||
@@ -0,0 +1,9 @@
|
||||
# reverse-text (2 GPU)
|
||||
|
||||
Smallest end-to-end RL loop — single-turn, `Qwen3-0.6B`. Dev mirror of
|
||||
[`examples/basic/reverse-text`](../../../examples/basic/reverse-text).
|
||||
|
||||
```bash
|
||||
uv run sft @ configs/basic/reverse-text/sft.toml # optional warmup
|
||||
uv run rl @ configs/basic/reverse-text/rl.toml
|
||||
```
|
||||
@@ -0,0 +1,40 @@
|
||||
# Reverse-text on 2 GPUs (1 trainer + 1 inference) — the smallest end-to-end RL loop
|
||||
# (single-turn, 0.6B). Dev-sized mirror of examples/basic/reverse-text.
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 1
|
||||
num_infer_gpus = 1
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[wandb]
|
||||
project = "reverse-text"
|
||||
name = "reverse-text"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[ckpt] # Checkpoint at the end of training
|
||||
|
||||
[inference]
|
||||
|
||||
# PrimeIntellect Qwen3 fine-tune - select its renderer explicitly (the -SFT
|
||||
# suffix misses the MODEL_RENDERER_MAP exact match).
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
@@ -0,0 +1,19 @@
|
||||
# SFT warmup for reverse-text on 2 GPUs. Dev-sized mirror of examples/basic/reverse-text/sft.toml.
|
||||
|
||||
max_steps = 100
|
||||
|
||||
[deployment]
|
||||
num_gpus = 2
|
||||
|
||||
[ckpt] # Checkpoint at the end of training
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B"
|
||||
|
||||
[data]
|
||||
name = "willcb/R1-reverse-wikipedia-paragraphs-v1-1000"
|
||||
seq_len = 4096
|
||||
batch_size = 32
|
||||
|
||||
[optim]
|
||||
lr = 2e-5
|
||||
@@ -0,0 +1,8 @@
|
||||
# wiki-search (2 GPU)
|
||||
|
||||
Multi-turn tool calling (search a wiki corpus via native V1 tools), LoRA on `Qwen3-4B`. Dev mirror
|
||||
of [`examples/basic/wiki-search`](../../../examples/basic/wiki-search).
|
||||
|
||||
```bash
|
||||
uv run rl @ configs/basic/wiki-search/rl.toml
|
||||
```
|
||||
@@ -0,0 +1,51 @@
|
||||
# Wiki-search on 2 GPUs (1 trainer + 1 inference) — a multi-turn tool-calling task (the model
|
||||
# searches a wiki corpus via MCP tools), trained with LoRA on Qwen3-4B. Dev-sized mirror of
|
||||
# examples/basic/wiki-search.
|
||||
|
||||
max_steps = 200
|
||||
seq_len = 4096
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 1
|
||||
num_infer_gpus = 1
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[wandb]
|
||||
project = "wiki-search"
|
||||
name = "wiki-search"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-5
|
||||
weight_decay = 0.0
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 8
|
||||
dropout = 0.0
|
||||
target_modules = [
|
||||
"q_proj",
|
||||
"k_proj",
|
||||
"v_proj",
|
||||
"o_proj",
|
||||
"gate_proj",
|
||||
"up_proj",
|
||||
"down_proj",
|
||||
]
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 512
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "wiki-search"
|
||||
env.taskset = { id = "wiki-search-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[ckpt] # Checkpoint at the end of training
|
||||
|
||||
[inference.model]
|
||||
tool_call_parser = "hermes"
|
||||
@@ -0,0 +1,9 @@
|
||||
# wordle (2 GPU)
|
||||
|
||||
Multi-turn Wordle (~6-turn games), `Qwen3-1.7B-Wordle-SFT`. Dev mirror of
|
||||
[`examples/basic/wordle`](../../../examples/basic/wordle).
|
||||
|
||||
```bash
|
||||
uv run sft @ configs/basic/wordle/sft.toml # optional warmup
|
||||
uv run rl @ configs/basic/wordle/rl.toml
|
||||
```
|
||||
@@ -23,8 +23,8 @@ group_size = 8
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "wordle"
|
||||
taskset = { id = "wordle-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "wordle-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 1024
|
||||
@@ -33,9 +33,6 @@ max_completion_tokens = 1024
|
||||
|
||||
[inference] # single inference GPU (no data parallelism)
|
||||
|
||||
# Qwen3 finetune with the standard PI template patch (byte-identical to
|
||||
# PrimeIntellect/Qwen3-0.6B base); always re-emits prior <think> blocks.
|
||||
# Match that with renderer thinking_retention.
|
||||
# Fine-tune inherits the PrimeIntellect Qwen3 template byte-for-byte.
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
thinking_retention = "all"
|
||||
name = "prime-qwen3"
|
||||
@@ -0,0 +1,20 @@
|
||||
# SFT warmup for wordle on 2 GPUs. Dev-sized mirror of examples/basic/wordle/sft.toml.
|
||||
|
||||
max_steps = 20
|
||||
|
||||
[deployment]
|
||||
num_gpus = 2
|
||||
|
||||
[ckpt] # Checkpoint at the end of training
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-1.7B"
|
||||
|
||||
[data]
|
||||
name = "willcb/V3-wordle"
|
||||
seq_len = 1024
|
||||
batch_size = 64
|
||||
micro_batch_size = 1
|
||||
|
||||
[optim]
|
||||
lr = 1e-5
|
||||
@@ -24,8 +24,8 @@ max_completion_tokens = 384
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "alphabet-sort"
|
||||
taskset = { id = "alphabet-sort-v1", min_turns = 2, max_turns = 2, min_names_per_turn = 1, max_names_per_turn = 3, task = { similarity_power = 4, power_per_turn = false } }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "alphabet-sort-v1", min_turns = 2, max_turns = 2, min_names_per_turn = 1, max_names_per_turn = 3, task = { similarity_power = 4, power_per_turn = false } }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[inference]
|
||||
|
||||
|
||||
+5
-4
@@ -28,13 +28,14 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[inference]
|
||||
enable_lora = true
|
||||
gpu_memory_utilization = 0.7
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
# PrimeIntellect Qwen3 fine-tune - select its renderer explicitly (the -SFT
|
||||
# suffix misses the MODEL_RENDERER_MAP exact match).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
name = "prime-qwen3"
|
||||
+5
-4
@@ -27,13 +27,14 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[inference]
|
||||
enable_lora = true
|
||||
gpu_memory_utilization = 0.7
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
# PrimeIntellect Qwen3 fine-tune - select its renderer explicitly (the -SFT
|
||||
# suffix misses the MODEL_RENDERER_MAP exact match).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
name = "prime-qwen3"
|
||||
+2
-2
@@ -27,8 +27,8 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[inference]
|
||||
gpu_memory_utilization = 0.7
|
||||
+5
-4
@@ -16,8 +16,8 @@ max_completion_tokens = 128
|
||||
|
||||
[[train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[ckpt]
|
||||
interval = 10
|
||||
@@ -26,6 +26,7 @@ resume_step = -1
|
||||
[weight_broadcast]
|
||||
type = "filesystem"
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
# PrimeIntellect Qwen3 fine-tune - select its renderer explicitly (the -SFT
|
||||
# suffix misses the MODEL_RENDERER_MAP exact match).
|
||||
[renderer]
|
||||
name = "default"
|
||||
name = "prime-qwen3"
|
||||
+6
-6
@@ -2,7 +2,7 @@
|
||||
# The policy inference deployment is launched by the rl entrypoint on GPU 0;
|
||||
# the frozen reference server is started externally by the test fixture (see
|
||||
# tests/integration/test_reverse_text_rl_opd.py) on the same GPU. Trainer
|
||||
# takes GPU 1. Training config mirrors `reverse_text/start.toml`.
|
||||
# takes GPU 1. Training config mirrors `reverse-text/start.toml`.
|
||||
|
||||
max_steps = 15
|
||||
seq_len = 2048
|
||||
@@ -32,15 +32,15 @@ name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = ["http://localhost:8001/v1"]
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
name = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
@@ -51,8 +51,8 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
+10
-11
@@ -2,7 +2,7 @@
|
||||
# The policy inference deployment is launched by the rl entrypoint on GPU 0;
|
||||
# the frozen sampling server is started externally by the test fixture (see
|
||||
# tests/integration/test_reverse_text_rl_sft.py) on the same GPU. Trainer
|
||||
# takes GPU 1. Training config mirrors `reverse_text/start.toml`.
|
||||
# takes GPU 1. Training config mirrors `reverse-text/start.toml`.
|
||||
|
||||
max_steps = 15
|
||||
seq_len = 2048
|
||||
@@ -33,21 +33,20 @@ name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = ["http://localhost:8001/v1"]
|
||||
|
||||
# The student's renderer tokenizes the teacher's messages into the student's
|
||||
# token space (backfill). Use `default` (wraps the student tokenizer's
|
||||
# apply_chat_template) so the CE target is faithful to the student's actual
|
||||
# chat template. The stock `qwen3` renderer reimplements the Qwen format and
|
||||
# injects an empty `<think></think>` block, which this model's custom template
|
||||
# does not emit — corrupting the distillation target.
|
||||
# token space (backfill). Use `prime-qwen3` — it matches this PrimeIntellect
|
||||
# Qwen3 model's chat template token-for-token (single-turn + system), so the CE
|
||||
# target stays faithful, without the empty `<think></think>` block the stock
|
||||
# `qwen3` renderer injects (which this model's template never emits).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
name = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
@@ -58,8 +57,8 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
+5
-4
@@ -25,11 +25,12 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[inference]
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
# PrimeIntellect Qwen3 fine-tune - select its renderer explicitly (the -SFT
|
||||
# suffix misses the MODEL_RENDERER_MAP exact match).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
name = "prime-qwen3"
|
||||
+5
-4
@@ -24,11 +24,12 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[inference]
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
# PrimeIntellect Qwen3 fine-tune - select its renderer explicitly (the -SFT
|
||||
# suffix misses the MODEL_RENDERER_MAP exact match).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
name = "prime-qwen3"
|
||||
@@ -0,0 +1,32 @@
|
||||
max_steps = 200
|
||||
seq_len = 2048
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 4
|
||||
num_infer_gpus = 4
|
||||
|
||||
[wandb]
|
||||
project = "alphabet-sort"
|
||||
name = "alphabet-sort"
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 16
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "alphabet-sort"
|
||||
env.taskset = { id = "alphabet-sort-v1", min_turns = 3, max_turns = 5, task = { power_per_turn = false } }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 768
|
||||
|
||||
[trainer]
|
||||
|
||||
[inference.parallel]
|
||||
dp = 4
|
||||
@@ -0,0 +1,49 @@
|
||||
max_steps = 5000
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 4
|
||||
num_infer_gpus = 4
|
||||
|
||||
[wandb]
|
||||
project = "hendrycks-sanity"
|
||||
name = "hendrycks-sanity"
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 8
|
||||
seq_len = 8192
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "hendrycks-math"
|
||||
env.taskset = { id = "math-env-v1", dataset_name = "mikasenghaas/Sanity-Test-R1D-1.5B", dataset_subset = "default" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 50
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "aime2024"
|
||||
env.taskset = { id = "aime24-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
group_size = 32
|
||||
|
||||
[trainer]
|
||||
|
||||
[trainer.model]
|
||||
seq_len = 16384
|
||||
attn = "flash_attention_2"
|
||||
|
||||
[inference.parallel]
|
||||
dp = 4
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 8192
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
reasoning_parser = "think"
|
||||
@@ -0,0 +1,34 @@
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 1
|
||||
num_infer_gpus = 1
|
||||
|
||||
[wandb]
|
||||
project = "reverse-text"
|
||||
name = "reverse-text"
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 16
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[trainer]
|
||||
|
||||
[inference]
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
@@ -0,0 +1,40 @@
|
||||
max_steps = 200
|
||||
seq_len = 4096
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 4
|
||||
num_infer_gpus = 4
|
||||
|
||||
[wandb]
|
||||
project = "wiki-search"
|
||||
name = "wiki-search"
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 16
|
||||
oversampling_factor = 2.0
|
||||
|
||||
[[orchestrator.pre_batch_filters]]
|
||||
type = "zero_advantage"
|
||||
enforce = true
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "wiki-search"
|
||||
env.taskset = { id = "wiki-search-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 512
|
||||
|
||||
[trainer]
|
||||
|
||||
[inference.parallel]
|
||||
dp = 4
|
||||
|
||||
[inference.model]
|
||||
tool_call_parser = "hermes"
|
||||
@@ -0,0 +1,35 @@
|
||||
max_steps = 200
|
||||
seq_len = 8192
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 2
|
||||
num_infer_gpus = 6
|
||||
|
||||
[wandb]
|
||||
project = "wordle"
|
||||
name = "wordle"
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-1.7B-Wordle-SFT"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 16
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "wordle"
|
||||
env.taskset = { id = "wordle-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 1024
|
||||
|
||||
[trainer]
|
||||
|
||||
[inference.parallel]
|
||||
dp = 6
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
@@ -1,4 +1,4 @@
|
||||
# Based on configs/multimodal/rl_color_codeword.toml but tuned for CI
|
||||
# Based on configs/debug/multimodal.toml but tuned for CI.
|
||||
max_steps = 25
|
||||
seq_len = 4096
|
||||
|
||||
@@ -7,7 +7,7 @@ num_train_gpus = 4
|
||||
num_infer_gpus = 4
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-VL-4B-Instruct"
|
||||
name = "Qwen/Qwen3.5-4B"
|
||||
|
||||
[model.vlm]
|
||||
vision_encoder_attr = "model.visual"
|
||||
@@ -22,12 +22,13 @@ max_completion_tokens = 64
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "color-codeword"
|
||||
taskset = { id = "color-codeword-v1", images_per_turn = 1 }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "color-codeword-v1", images_per_turn = 1 }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer]
|
||||
|
||||
[trainer.model]
|
||||
impl = "custom"
|
||||
optimization_dtype = "bfloat16"
|
||||
reduce_dtype = "bfloat16"
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# Minimal SFT config with a [slurm] section — fixture for the slim-wheel config
|
||||
# parse check in cpu_tests.yaml. On the slim wheel the templates/ data dir is
|
||||
# absent, so [slurm].template_path must resolve to None instead of erroring.
|
||||
[slurm]
|
||||
job_name = "slim-sft-check"
|
||||
@@ -36,27 +36,27 @@ Every config writes to the default `outputs/` directory, so running two back-to-
|
||||
|
||||
```bash
|
||||
# GRPO (no frozen model)
|
||||
uv run rl @ configs/debug/algorithms/grpo.toml --output-dir outputs/grpo
|
||||
uv run rl @ configs/debug/algo/grpo.toml --output-dir outputs/grpo
|
||||
|
||||
# MaxRL (no frozen model)
|
||||
uv run rl @ configs/debug/algorithms/max_rl.toml --output-dir outputs/max_rl
|
||||
uv run rl @ configs/debug/algo/max_rl.toml --output-dir outputs/max_rl
|
||||
|
||||
# OPD (needs the frozen model on port 8001)
|
||||
uv run rl @ configs/debug/algorithms/opd.toml --output-dir outputs/opd
|
||||
uv run rl @ configs/debug/algorithms/opd_lora.toml --output-dir outputs/opd_lora
|
||||
uv run rl @ configs/debug/algo/opd.toml --output-dir outputs/opd
|
||||
uv run rl @ configs/debug/algo/opd_lora.toml --output-dir outputs/opd_lora
|
||||
|
||||
# SFT distillation (needs the frozen model on port 8001)
|
||||
uv run rl @ configs/debug/algorithms/sft_distill.toml --output-dir outputs/sft_distill
|
||||
uv run rl @ configs/debug/algorithms/sft_distill_lora.toml --output-dir outputs/sft_distill_lora
|
||||
uv run rl @ configs/debug/algo/sft_distill.toml --output-dir outputs/sft_distill
|
||||
uv run rl @ configs/debug/algo/sft_distill_lora.toml --output-dir outputs/sft_distill_lora
|
||||
|
||||
# Self-distillation against the live policy (no frozen model)
|
||||
uv run rl @ configs/debug/algorithms/self_distill.toml --output-dir outputs/self_distill
|
||||
uv run rl @ configs/debug/algo/self_distill.toml --output-dir outputs/self_distill
|
||||
|
||||
# ECHO (no frozen model; multi-turn env)
|
||||
uv run rl @ configs/debug/algorithms/echo.toml --output-dir outputs/echo
|
||||
uv run rl @ configs/debug/algo/echo.toml --output-dir outputs/echo
|
||||
|
||||
# Mixed per-env algorithms: GRPO + OPD in one run (needs the frozen model on port 8001)
|
||||
uv run rl @ configs/debug/algorithms/mixed_grpo_opd.toml --output-dir outputs/mixed_grpo_opd
|
||||
uv run rl @ configs/debug/algo/mixed_grpo_opd.toml --output-dir outputs/mixed_grpo_opd
|
||||
```
|
||||
|
||||
See [docs/algorithms.md](../../../docs/algorithms.md) for what each algorithm does and how to author your own.
|
||||
@@ -1,6 +1,6 @@
|
||||
# ECHO on the multi-turn alphabet-sort V1 taskset: GRPO on
|
||||
# action tokens + weighted CE on the env's observation tokens.
|
||||
# uv run rl @ configs/debug/algorithms/echo.toml
|
||||
# uv run rl @ configs/debug/algo/echo.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 4096
|
||||
@@ -26,8 +26,8 @@ alpha = 0.1
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "alphabet-sort"
|
||||
taskset = { id = "alphabet-sort-v1", min_turns = 3, max_turns = 5, task = { power_per_turn = false } }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "alphabet-sort-v1", min_turns = 3, max_turns = 5, task = { power_per_turn = false } }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 512
|
||||
@@ -38,11 +38,9 @@ max_completion_tokens = 512
|
||||
type = "zero_advantage"
|
||||
enforce = false
|
||||
|
||||
# Qwen3 finetune with the standard PI template patch; always re-emits prior
|
||||
# <think> blocks, matched by renderer thinking_retention.
|
||||
# Fine-tune inherits the PrimeIntellect Qwen3 template byte-for-byte.
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
thinking_retention = "all"
|
||||
name = "prime-qwen3"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-6
|
||||
@@ -16,15 +16,15 @@ group_size = 16
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
name = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
@@ -35,8 +35,8 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
@@ -16,15 +16,15 @@ group_size = 16
|
||||
type = "max_rl"
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
name = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
@@ -35,8 +35,8 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
+8
-8
@@ -6,7 +6,7 @@
|
||||
# --model.name PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL \
|
||||
# --server.port 8001 --gpu-memory-utilization 0.5 --model.enforce-eager
|
||||
# Then:
|
||||
# uv run rl @ configs/debug/algorithms/mixed_grpo_opd.toml
|
||||
# uv run rl @ configs/debug/algo/mixed_grpo_opd.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
@@ -26,20 +26,20 @@ group_size = 16
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
name = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text-grpo"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text-opd"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.train.env.algo]
|
||||
type = "opd"
|
||||
@@ -57,8 +57,8 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
@@ -3,7 +3,7 @@
|
||||
# --model.name PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL \
|
||||
# --server.port 8001 --gpu-memory-utilization 0.5 --model.enforce-eager
|
||||
# Then:
|
||||
# uv run rl @ configs/debug/algorithms/opd.toml
|
||||
# uv run rl @ configs/debug/algo/opd.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
@@ -28,15 +28,15 @@ base_url = ["http://localhost:8001/v1"]
|
||||
|
||||
# Teacher rolls out over plain chat-completions (no tokens); the renderer backfills them.
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
name = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
@@ -47,8 +47,8 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
@@ -3,7 +3,7 @@
|
||||
# --model.name PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL \
|
||||
# --server.port 8001 --gpu-memory-utilization 0.5 --model.enforce-eager
|
||||
# Then:
|
||||
# uv run rl @ configs/debug/algorithms/opd_lora.toml
|
||||
# uv run rl @ configs/debug/algo/opd_lora.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
@@ -28,15 +28,15 @@ base_url = ["http://localhost:8001/v1"]
|
||||
|
||||
# Teacher rolls out over plain chat-completions (no tokens); the renderer backfills them.
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
name = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
@@ -47,8 +47,8 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-4
|
||||
@@ -2,7 +2,7 @@
|
||||
# policy itself: the reference for each completion is the current model
|
||||
# conditioned on the expert demonstration — no extra deployment needed.
|
||||
# reverse-text carries the demonstration in its top-level `answer` field.
|
||||
# uv run rl @ configs/debug/algorithms/self_distill.toml
|
||||
# uv run rl @ configs/debug/algo/self_distill.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
@@ -24,15 +24,15 @@ type = "opsd"
|
||||
demo_key = "answer"
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
name = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
@@ -43,8 +43,8 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
@@ -3,7 +3,7 @@
|
||||
# --model.name PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL \
|
||||
# --server.port 8001 --gpu-memory-utilization 0.5 --model.enforce-eager
|
||||
# Then:
|
||||
# uv run rl @ configs/debug/algorithms/sft_distill.toml
|
||||
# uv run rl @ configs/debug/algo/sft_distill.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
@@ -28,20 +28,20 @@ name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = ["http://localhost:8001/v1"]
|
||||
|
||||
# The student's renderer tokenizes the teacher's messages into the student's
|
||||
# token space (backfill). Use `default` (wraps the student tokenizer's
|
||||
# apply_chat_template) so the CE target is faithful to the student's actual
|
||||
# chat template. The stock `qwen3` renderer injects an empty `<think></think>`
|
||||
# block this model's custom template never emits, corrupting the target.
|
||||
# token space (backfill). Use `prime-qwen3` — it matches this PrimeIntellect
|
||||
# Qwen3 model's chat template token-for-token (single-turn + system), keeping the
|
||||
# CE target faithful, without the empty `<think></think>` block the stock `qwen3`
|
||||
# renderer injects (which this model's template never emits).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
name = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
@@ -52,8 +52,8 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
+10
-10
@@ -3,7 +3,7 @@
|
||||
# --model.name PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL \
|
||||
# --server.port 8001 --gpu-memory-utilization 0.5 --model.enforce-eager
|
||||
# Then:
|
||||
# uv run rl @ configs/debug/algorithms/sft_distill_lora.toml
|
||||
# uv run rl @ configs/debug/algo/sft_distill_lora.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
@@ -28,20 +28,20 @@ name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = ["http://localhost:8001/v1"]
|
||||
|
||||
# The student's renderer tokenizes the teacher's messages into the student's
|
||||
# token space (backfill). Use `default` (wraps the student tokenizer's
|
||||
# apply_chat_template) so the CE target is faithful to the student's actual
|
||||
# chat template. The stock `qwen3` renderer injects an empty `<think></think>`
|
||||
# block this model's custom template never emits, corrupting the target.
|
||||
# token space (backfill). Use `prime-qwen3` — it matches this PrimeIntellect
|
||||
# Qwen3 model's chat template token-for-token (single-turn + system), keeping the
|
||||
# CE target faithful, without the empty `<think></think>` block the stock `qwen3`
|
||||
# renderer injects (which this model's template never emits).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
name = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
@@ -52,8 +52,8 @@ max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-4
|
||||
@@ -1,42 +0,0 @@
|
||||
max_steps = 3000
|
||||
seq_len = 4096
|
||||
|
||||
[wandb]
|
||||
project = "hendrycks-math-debug"
|
||||
name = "hendrycks-math-sanity"
|
||||
|
||||
[model]
|
||||
name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
max_inflight_rollouts = 512
|
||||
group_size = 8
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "hendrycks-math"
|
||||
taskset = { id = "math-env-v1", dataset_name = "mikasenghaas/Sanity-Test-R1D-1.5B", dataset_subset = "default" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 50
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "aime2024"
|
||||
taskset = { id = "aime24-v1" }
|
||||
group_size = 16
|
||||
|
||||
[trainer.model.ac]
|
||||
|
||||
[trainer.model.compile]
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 4096
|
||||
|
||||
[log]
|
||||
level = "debug"
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
reasoning_parser = "think"
|
||||
@@ -1,2 +0,0 @@
|
||||
[model]
|
||||
enforce_eager = true
|
||||
@@ -1,14 +0,0 @@
|
||||
max_steps = 5
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/GLM-0.5B"
|
||||
moe_use_grouped_mm = false
|
||||
impl = "custom"
|
||||
attn = "flash_attention_2"
|
||||
|
||||
[model.compile]
|
||||
|
||||
[data]
|
||||
type = "fake"
|
||||
batch_size = 2
|
||||
seq_len = 1024
|
||||
@@ -1,55 +0,0 @@
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[wandb]
|
||||
project = "reverse-text-debug"
|
||||
name = "debug-multi-env"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
|
||||
# -- multi train envs --
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text-train-1"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text-train-2"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
# -- multi eval envs --
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 10
|
||||
num_examples = 16
|
||||
group_size = 4
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "reverse-text-eval-1"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "reverse-text-eval-2"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
interval = 5
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[inference]
|
||||
gpu_memory_utilization = 0.5
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 128
|
||||
@@ -1,76 +0,0 @@
|
||||
# 2-GPU debug RL run for the multimodal (renderer) path: Qwen3-VL-4B on
|
||||
# color-codeword. Sized to actually learn (reward should trend up) while
|
||||
# staying 2-GPU friendly. Exercises RendererClient + Qwen3VLRenderer end-to-end.
|
||||
|
||||
max_steps = 15
|
||||
seq_len = 4096
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-VL-4B-Instruct"
|
||||
|
||||
[model.vlm]
|
||||
vision_encoder_attr = "model.visual"
|
||||
language_model_attr = "model.language_model"
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 1
|
||||
num_infer_gpus = 1
|
||||
gpus_per_node = 2
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
group_size = 16
|
||||
# Image processor is CPU-bound and dominates for VLMs; returns diminish past 4.
|
||||
pool_size = 4
|
||||
|
||||
# Step 0 on Qwen3-VL-4B vs color-codeword can be uniform (all-correct or
|
||||
# all-wrong), so don't enforce zero-advantage dropping or training would crash
|
||||
# before any progress.
|
||||
[[orchestrator.post_batch_filters]]
|
||||
type = "gibberish"
|
||||
|
||||
[[orchestrator.post_batch_filters]]
|
||||
type = "repetition"
|
||||
|
||||
[[orchestrator.post_batch_filters]]
|
||||
type = "zero_advantage"
|
||||
enforce = false
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 64
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "color-codeword"
|
||||
taskset = { id = "color-codeword-v1", images_per_turn = 1 }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
# Default renderer (AutoRendererConfig) resolves Qwen3-VL-4B-Instruct from
|
||||
# MODEL_RENDERER_MAP to Qwen3VLRenderer at runtime; no explicit name needed.
|
||||
|
||||
[trainer]
|
||||
|
||||
[trainer.model]
|
||||
optimization_dtype = "bfloat16"
|
||||
reduce_dtype = "bfloat16"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.model]
|
||||
# Workaround for vLLM 0.20.1 Qwen3-VL deepstack buffer bug: when num_scheduled_tokens
|
||||
# (188) gets padded up to the next cudagraph_capture_size (192), the model's
|
||||
# _set_deepstack_input_embeds sizes the buffer to 188 but forward() runs with 192,
|
||||
# triggering "Requested more deepstack tokens than available in buffer". Eager mode
|
||||
# skips the padding so num_input_tokens == num_scheduled_tokens.
|
||||
enforce_eager = true
|
||||
|
||||
[inference.parallel]
|
||||
dp = 1
|
||||
tp = 1
|
||||
|
||||
[wandb]
|
||||
project = "debug"
|
||||
name = "multimodal"
|
||||
tags = ["qwen3vl-4b", "color-codeword", "renderer"]
|
||||
@@ -1,6 +0,0 @@
|
||||
max_steps = 5
|
||||
batch_size = 16
|
||||
|
||||
[train.sampling]
|
||||
max_completion_tokens = 16
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
# v1 port of examples/alphabet_sort/rl.toml — identical except the env block, which loads
|
||||
# the v1 `alphabet-sort-v1` taskset (multi-turn via a colocated vf.User) instead of the v0
|
||||
# `primeintellect/alphabet-sort` env. Harness runs on the subprocess runtime.
|
||||
|
||||
max_steps = 200
|
||||
seq_len = 2048
|
||||
|
||||
[ckpt] # Checkpoint at the end of training
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[wandb]
|
||||
project = "alphabet-sort"
|
||||
name = "alphabet-sort"
|
||||
|
||||
[trainer.model]
|
||||
impl = "auto"
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 32
|
||||
alpha = 64
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-5
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 768
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "alphabet-sort"
|
||||
taskset = { id = "alphabet-sort-v1", min_turns = 3, max_turns = 5, task = { power_per_turn = false } }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[inference] # Default inference config
|
||||
@@ -1,54 +0,0 @@
|
||||
# Debug v1 RL run: the v1 `general-agent-v1` taskset (GeneralAgentSolverTaskset) driven by the
|
||||
# default harness, with the agent and its tool server colocated in a modal sandbox. Copied from
|
||||
# configs/general_agent/rl_qwen3_4b.toml and rewired for v1 (taskset + harness + renderer; the
|
||||
# v0 `id = "general-agent-solver-rlm"` env becomes the v1 taskset + a separate harness).
|
||||
|
||||
max_steps = 200
|
||||
seq_len = 32768
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 4
|
||||
num_infer_gpus = 4
|
||||
|
||||
[wandb]
|
||||
project = "general-agent-debug"
|
||||
name = "qwen3-4b-v1"
|
||||
|
||||
[ckpt]
|
||||
interval = 100
|
||||
keep_last = 1
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[trainer]
|
||||
|
||||
[trainer.model]
|
||||
cp = 2
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.compile]
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
rollouts_per_example = 8
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
# v1 general-agent solver taskset; the tool server is colocated in the harness's modal sandbox.
|
||||
taskset = { id = "general-agent-v1", task = { tools = { colocated = true } } }
|
||||
harness = { id = "null", runtime = { type = "modal" } }
|
||||
|
||||
[inference]
|
||||
gpu_memory_utilization = 0.85
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 32768
|
||||
|
||||
[inference.parallel]
|
||||
dp = 4
|
||||
@@ -1,41 +0,0 @@
|
||||
# GSM8K (v1) — the v1 port of configs/gsm8k/rl.toml. Trains Qwen3-0.6B on GSM8K through the
|
||||
# v1 env server: the orchestrator spawns a v1 EnvServer for the gsm8k-v1 taskset and trains on
|
||||
# the returned Traces. Runs on 2 GPUs (1 inference, 1 training):
|
||||
# uv run inference --model.name PrimeIntellect/Qwen3-0.6B # Inference pane (GPU 0)
|
||||
# uv run rl @ configs/debug/v1/gsm8k.toml --ckpt # Trainer pane (GPU 1)
|
||||
|
||||
max_steps = 100
|
||||
seq_len = 2048
|
||||
|
||||
[wandb]
|
||||
project = "gsm8k-debug"
|
||||
name = "gsm8k-v1"
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-0.6B"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 2048
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
taskset = { id = "gsm8k-v1", split = "train" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 20
|
||||
num_examples = 256
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 2048
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
taskset = { id = "gsm8k-v1", split = "test" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer] # Default trainer config
|
||||
|
||||
[inference] # Default inference config
|
||||
@@ -1,55 +0,0 @@
|
||||
# v1 analog of examples/hendrycks_sanity/rl.toml — identical config with only
|
||||
# the env sections swapped to v1 taskset/harness syntax (math-env taskset,
|
||||
# default harness, modal runtime). Submits to slurm by default; pass --no-slurm
|
||||
# to run locally.
|
||||
|
||||
output_dir = "/beegfs/mika/hendrycks-sanity-v1"
|
||||
max_steps = 200
|
||||
|
||||
[wandb]
|
||||
project = "hendrycks-sanity"
|
||||
name = "v1"
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 4
|
||||
num_infer_gpus = 4
|
||||
|
||||
[slurm]
|
||||
job_name = "hendrycks-modal"
|
||||
partition = "all"
|
||||
|
||||
[model]
|
||||
name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 8
|
||||
seq_len = 8192
|
||||
max_inflight_rollouts = 256
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "hendrycks-math"
|
||||
taskset = { id = "math-env-v1", dataset_name = "mikasenghaas/Sanity-Test-R1D-1.5B", dataset_subset = "default" }
|
||||
harness = { id = "null", runtime = { type = "modal" } }
|
||||
timeout = { scoring = 300 }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 50
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "aime2024"
|
||||
taskset = { id = "aime24-v1" }
|
||||
harness = { id = "null", runtime = { type = "modal" } }
|
||||
timeout = { scoring = 300 }
|
||||
group_size = 32
|
||||
|
||||
[trainer.model]
|
||||
seq_len = 16384
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 8192
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
reasoning_parser = "think"
|
||||
@@ -1,84 +0,0 @@
|
||||
# Qwen3.5-4B SWE RL on the v1 `r2e-gym-v1` taskset through the rlm harness on the prime runtime.
|
||||
|
||||
output_dir = "/beegfs/mika/rlm-swe-qwen35-4b"
|
||||
max_steps = 400
|
||||
seq_len = 65536
|
||||
|
||||
[slurm]
|
||||
job_name = "rlm-swe-qwen35-4b"
|
||||
project_dir = "."
|
||||
pre_run_command = "prime sandbox delete --label rlm-swe-qwen35-4b -y --plain || true"
|
||||
|
||||
[deployment]
|
||||
type = "multi_node"
|
||||
num_train_nodes = 1
|
||||
num_infer_nodes = 1
|
||||
num_infer_replicas = 2
|
||||
|
||||
[wandb]
|
||||
project = "rlm-swe-debug"
|
||||
name = "qwen35-4b"
|
||||
|
||||
[weight_broadcast]
|
||||
type = "nccl"
|
||||
|
||||
[ckpt]
|
||||
interval = 50
|
||||
keep_last = 1
|
||||
resume_step = -1
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3.5-4B"
|
||||
|
||||
# --- Trainer ---
|
||||
|
||||
[trainer]
|
||||
|
||||
[trainer.model]
|
||||
cp = 4
|
||||
cp_style = "ulysses"
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.compile]
|
||||
|
||||
# --- Orchestrator ---
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
group_size = 8
|
||||
max_inflight_rollouts = 512
|
||||
max_off_policy_steps = 16
|
||||
|
||||
# Thinking enabled for the Qwen3.5 renderer.
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3.5"
|
||||
enable_thinking = true
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
temperature = 1.0
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "rlm-swe-r2e"
|
||||
taskset = { id = "r2e-gym-v1" }
|
||||
harness = { id = "rlm", runtime = { type = "prime", labels = ["rlm-swe-qwen35-4b"] } }
|
||||
|
||||
[orchestrator.prime_monitor]
|
||||
|
||||
# --- Inference ---
|
||||
|
||||
[inference]
|
||||
gpu_memory_utilization = 0.85
|
||||
enable_prefix_caching = true
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 65536
|
||||
|
||||
[inference.parallel]
|
||||
dp = 8
|
||||
|
||||
# Qwen3.5-4B is a VL model; skip the vision tower for text-only SWE.
|
||||
# `language_model_only` is a vLLM MultiModalConfig arg (no prime-rl field) → pass via vllm_extra.
|
||||
[inference.vllm_extra]
|
||||
language_model_only = true
|
||||
@@ -1,41 +0,0 @@
|
||||
# Debug RL run on the v1 env server (reverse-text starter).
|
||||
# The orchestrator spawns a v1 EnvServer per env (it never loads the env
|
||||
# itself), dispatches rollouts by task index, and trains on the returned Traces
|
||||
# (renderer-tokenized). Light settings for a quick end-to-end smoke.
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[wandb]
|
||||
project = "reverse-text"
|
||||
name = "v1"
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
# reverse-text is a pure-text single-turn env: disable the bash tool (the model answers
|
||||
# directly) and use the subprocess runtime (no docker).
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
# No eval block, mirroring examples/reverse_text/rl.toml — this is a train-only
|
||||
# smoke. Add an [orchestrator.eval] block (with an interval) to exercise eval.
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[ckpt]
|
||||
|
||||
[inference]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -1,118 +0,0 @@
|
||||
# v1 RL run: Qwen3.6-35B-A3B (MoE) on the v1 `scaleswe-v1` SWE taskset, rlm harness on a prime
|
||||
# sandbox runtime. Each scaleswe row ships its own Docker image (NEEDS_CONTAINER) which the
|
||||
# Environment injects into the prime sandbox; the agent edits the repo + runs tests there (no MCP
|
||||
# toolset). Router replay is enabled: trainer.enable_router_replay replays the routed-expert
|
||||
# decisions returned by inference (enable_return_routed_experts).
|
||||
#
|
||||
# Built from configs/debug/v1/r2e_gym.toml (the v1 SWE structure) + the MoE parallelism from
|
||||
# configs/general_agent/rl_qwen3_30b_a3b.toml. The deployment/parallelism is a starting point off
|
||||
# the 30B-A3B reference — confirm/adjust for your cluster and the 35B / 65k-context footprint.
|
||||
|
||||
max_steps = 400
|
||||
seq_len = 65536
|
||||
|
||||
[slurm]
|
||||
job_name = "scaleswe-qwen36-35b-a3b-rlm"
|
||||
project_dir = "."
|
||||
partition = "all"
|
||||
# Clean up this run's orphaned prime sandboxes before launch (label == SLURM job name).
|
||||
pre_run_command = 'timeout 120 prime sandbox delete --label "$SLURM_JOB_NAME" -y || true'
|
||||
|
||||
[deployment]
|
||||
type = "multi_node"
|
||||
num_train_nodes = 2
|
||||
num_infer_nodes = 2
|
||||
|
||||
[wandb]
|
||||
project = "scaleswe-debug"
|
||||
name = "qwen36-35b-a3b-rlm"
|
||||
|
||||
[weight_broadcast]
|
||||
type = "nccl"
|
||||
|
||||
[ckpt]
|
||||
interval = 50
|
||||
keep_last = 1
|
||||
resume_step = -1
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3.6-35B-A3B"
|
||||
|
||||
# --- Trainer ---
|
||||
|
||||
[trainer]
|
||||
# NCCL collective watchdog timeout — raised from default 600s: scaleswe's slow
|
||||
# multi-node startup (step-0 swebench eval + slow first SWE batch) was tripping the
|
||||
# 600s _ALLGATHER_BASE watchdog → SIGABRT trainer crash.
|
||||
dist_timeout_seconds = 3600
|
||||
# Replay the routed-expert decisions returned by inference (enable_return_routed_experts)
|
||||
# so the trainer's MoE routing matches the rollout's — cuts trainer/inference mismatch on A3B.
|
||||
enable_router_replay = true
|
||||
|
||||
[trainer.model]
|
||||
cp = 2
|
||||
# Qwen3.6 is a hybrid/linear-attention model — ring CP is unsupported; ulysses
|
||||
# all-to-all on Q/K/V works with the non-softmax kernels.
|
||||
cp_style = "ulysses"
|
||||
# Chunk the LM head over tokens to avoid materializing the full [seq, vocab] logits
|
||||
# (65k seq × large vocab) — big activation-memory saver. 1024 matches the SWE configs.
|
||||
fused_lm_head_token_chunk_size = 1024
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.compile]
|
||||
|
||||
# --- Orchestrator ---
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
group_size = 16
|
||||
max_off_policy_steps = 16
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3.6"
|
||||
enable_thinking = true
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
temperature = 1.0
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "scaleswe"
|
||||
# v1 scaleswe SWE taskset; rlm harness in a prime sandbox using the row's injected Docker image.
|
||||
taskset = { id = "scaleswe-v1" }
|
||||
harness = { id = "rlm", runtime = { type = "prime", labels = ["scaleswe-qwen36-35b-a3b-rlm"] } }
|
||||
|
||||
[orchestrator.prime_monitor]
|
||||
|
||||
# --- Eval: SWE-Bench Verified (first 100 tasks) every 20 steps, rlm harness on prime ---
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 20
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "swebench-verified"
|
||||
taskset = { id = "swebench-verified-v1", use_prime_registry = true }
|
||||
harness = { id = "rlm", runtime = { type = "prime", labels = ["scaleswe-qwen36-35b-a3b-rlm"] } }
|
||||
num_examples = 100
|
||||
group_size = 1
|
||||
timeout = { rollout = 3600 }
|
||||
|
||||
# --- Inference ---
|
||||
|
||||
[inference]
|
||||
gpu_memory_utilization = 0.85
|
||||
enable_prefix_caching = true
|
||||
# Return per-token routed-expert decisions to the trainer for router replay
|
||||
# (pairs with trainer.enable_router_replay).
|
||||
enable_return_routed_experts = true
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 65536
|
||||
# Qwen3.6 is not matched by the auto tool-parser resolver; set explicitly so vLLM
|
||||
# enables auto tool choice (the scaleswe SWE agent sends tool_choice="auto").
|
||||
tool_call_parser = "qwen3_coder"
|
||||
|
||||
[inference.parallel]
|
||||
dp = 2
|
||||
tp = 4
|
||||
@@ -1,17 +0,0 @@
|
||||
# Testing Elastic Inference
|
||||
|
||||
To test the elastic inference pool without having the `rl` entrypoint start the inference server:
|
||||
|
||||
1. **Run RL with the elastic config** (orchestrator discovers servers via DNS; it will find `localhost:8000` once the server is started):
|
||||
|
||||
```bash
|
||||
uv run rl @ examples/alphabet_sort/rl_elastic.toml
|
||||
```
|
||||
|
||||
The config uses `[orchestrator.model.client.elastic]` with `hostname = "localhost"` and `port = 8000`. The orchestrator will wait for at least one ready server before starting rollouts.
|
||||
|
||||
2. **Start the inference server manually** (in a separate terminal or on another machine):
|
||||
|
||||
```bash
|
||||
uv run inference --model.name Qwen/Qwen3-4B-Instruct-2507 --enable-lora --max-lora-rank 32
|
||||
```
|
||||
@@ -1,46 +0,0 @@
|
||||
# Alphabet sort RL with elastic inference pool (no inference process started by rl).
|
||||
# Start the inference server manually first, then run: uv run rl @ examples/alphabet_sort/rl_elastic.toml
|
||||
# The orchestrator discovers servers via DNS (hostname) and only uses ready ones.
|
||||
# Omitting [inference] means inference = None, so the rl entrypoint will not start an inference process.
|
||||
|
||||
max_steps = 200
|
||||
seq_len = 2048
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[wandb]
|
||||
project = "alphabet-sort"
|
||||
name = "alphabet-sort-elastic"
|
||||
|
||||
[trainer.model]
|
||||
impl = "auto"
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 32
|
||||
alpha = 64
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-5
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 768
|
||||
|
||||
[orchestrator.model.client.elastic]
|
||||
hostname = "localhost"
|
||||
port = 8000
|
||||
sync_interval = 5.0
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "alphabet-sort"
|
||||
taskset = { id = "alphabet-sort-v1", min_turns = 3, max_turns = 5, task = { power_per_turn = false } }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
@@ -1,30 +0,0 @@
|
||||
max_steps = 5
|
||||
seq_len = 8192
|
||||
|
||||
[wandb]
|
||||
project = "general-agent-debug"
|
||||
name = "qwen3-0p6b-rlm"
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-0.6B"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 16
|
||||
rollouts_per_example = 4
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 4096
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
taskset = { id = "general-agent-v1", task = { tools = { colocated = true } } }
|
||||
harness = { id = "null", runtime = { type = "modal" } }
|
||||
|
||||
[trainer]
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 8192
|
||||
|
||||
[inference.parallel]
|
||||
dp = 1
|
||||
@@ -1,45 +0,0 @@
|
||||
max_steps = 200
|
||||
seq_len = 32768
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 4
|
||||
num_infer_gpus = 4
|
||||
|
||||
[wandb]
|
||||
project = "general-agent-debug"
|
||||
name = "qwen3-4b-rlm"
|
||||
|
||||
[ckpt]
|
||||
interval = 100
|
||||
keep_last = 1
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[trainer]
|
||||
|
||||
[trainer.model]
|
||||
cp = 2
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.compile]
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
rollouts_per_example = 8
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
taskset = { id = "general-agent-v1", task = { tools = { colocated = true } } }
|
||||
harness = { id = "null", runtime = { type = "modal" } }
|
||||
|
||||
[inference]
|
||||
gpu_memory_utilization = 0.85
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 32768
|
||||
|
||||
[inference.parallel]
|
||||
dp = 4
|
||||
@@ -1,77 +0,0 @@
|
||||
# GSM8K
|
||||
|
||||
In this example, we demonstrate how to train `Qwen3-0.6B` to answer math problems from the GSM8K dataset.
|
||||
|
||||
> This example runs on 2 GPUs (1 for inference, 1 for training).
|
||||
|
||||
## Setup
|
||||
|
||||
The `gsm8k-v1` taskset is included through the Verifiers workspace. After syncing the repository, verify it with:
|
||||
|
||||
```bash
|
||||
uv run python -c "import gsm8k_v1"
|
||||
```
|
||||
|
||||
Start the tmux session:
|
||||
|
||||
```bash
|
||||
bash scripts/tmux.sh
|
||||
```
|
||||
|
||||
## Baseline Evaluation
|
||||
|
||||
Start the inference server:
|
||||
|
||||
```bash
|
||||
# In the `Inference` pane
|
||||
uv run inference --model.name PrimeIntellect/Qwen3-0.6B
|
||||
```
|
||||
|
||||
Evaluate the base model:
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
uv run vf-eval gsm8k-v1 \
|
||||
-a '{"split": "test"}' \
|
||||
-m PrimeIntellect/Qwen3-0.6B \
|
||||
-b http://localhost:8000/v1 \
|
||||
-n 20 \
|
||||
-t 2048
|
||||
```
|
||||
|
||||
## RL Training
|
||||
|
||||
Train with the config file:
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
uv run rl @ configs/gsm8k/rl.toml \
|
||||
--wandb.project your-project-name \
|
||||
--wandb.name your-run-name \
|
||||
--ckpt
|
||||
```
|
||||
|
||||
This will write weight checkpoints in `outputs/weights/step_*`. Upload the final checkpoint to HuggingFace:
|
||||
|
||||
```bash
|
||||
uv run hf upload <user>/Qwen3-0.6B-GSM8K-RL outputs/weights/step_100
|
||||
```
|
||||
|
||||
## Evaluation
|
||||
|
||||
Evaluate your trained model:
|
||||
|
||||
```bash
|
||||
# In the `Inference` pane
|
||||
uv run inference --model.name <user>/Qwen3-0.6B-GSM8K-RL
|
||||
```
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
uv run vf-eval gsm8k-v1 \
|
||||
-a '{"split": "test"}' \
|
||||
-m <user>/Qwen3-0.6B-GSM8K-RL \
|
||||
-b http://localhost:8000/v1 \
|
||||
-n 20 \
|
||||
-t 2048
|
||||
```
|
||||
@@ -1,31 +0,0 @@
|
||||
max_steps = 100
|
||||
seq_len = 2048
|
||||
|
||||
[wandb]
|
||||
project = "gsm8k-debug"
|
||||
name = "gsm8k"
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-0.6B"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 2048
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "gsm8k"
|
||||
taskset = { id = "gsm8k-v1", split = "train" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer] # Default trainer config
|
||||
|
||||
[inference] # Default inference config
|
||||
|
||||
# Mirror of Qwen/Qwen3-0.6B; PI's template patch always re-emits prior
|
||||
# <think> blocks. Match that with renderer thinking_retention.
|
||||
[orchestrator.renderer]
|
||||
name = "auto"
|
||||
thinking_retention = "all"
|
||||
@@ -1,51 +0,0 @@
|
||||
# Hendryck's Math
|
||||
|
||||
In this example, we demonstrate how to train `Qwen/Qwen3-4B-Instruct-2507` to answer math problems from the Hendryck's Math dataset.
|
||||
|
||||
> This example runs on 2 GPUs (1 for inference, 1 for training).
|
||||
|
||||
## Setup
|
||||
|
||||
The taskset is included through the research-environments workspace. After syncing the repository, verify it with:
|
||||
|
||||
```bash
|
||||
uv run python -c "import math_env_v1"
|
||||
```
|
||||
|
||||
Start the tmux session:
|
||||
|
||||
```bash
|
||||
bash scripts/tmux.sh
|
||||
```
|
||||
|
||||
## Baseline Evaluation
|
||||
|
||||
Start the inference server:
|
||||
|
||||
```bash
|
||||
# In the `Inference` pane
|
||||
uv run inference --model.name Qwen/Qwen3-4B-Instruct-2507
|
||||
```
|
||||
|
||||
Evaluate the base model:
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
uv run vf-eval math-env-v1 \
|
||||
-a '{"dataset_name": "PrimeIntellect/Hendrycks-Math", "dataset_subset": "default"}' \
|
||||
-m Qwen/Qwen3-4B-Instruct-2507 \
|
||||
-b http://localhost:8000/v1 \
|
||||
-n 20 \
|
||||
-t 2048
|
||||
```
|
||||
|
||||
## RL Training
|
||||
|
||||
Train with the config file:
|
||||
|
||||
```bash
|
||||
# In the `Trainer` pane
|
||||
uv run rl @ configs/hendrycks_math/rl.toml \
|
||||
--wandb.project your-project-name \
|
||||
--wandb.name your-run-name
|
||||
```
|
||||
@@ -1,38 +0,0 @@
|
||||
max_steps = 500
|
||||
seq_len = 2048
|
||||
|
||||
[wandb]
|
||||
project = "hendrycks-math-debug"
|
||||
name = "hendrycks-math"
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 2048
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "hendrycks-math"
|
||||
taskset = { id = "math-env-v1", dataset_name = "PrimeIntellect/Hendrycks-Math", dataset_subset = "default", task = { math_verify_timeout = 60 } }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 10
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 2048
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "math500"
|
||||
taskset = { id = "math500-v1" }
|
||||
num_examples = 30
|
||||
group_size = 4
|
||||
|
||||
[trainer] # Default trainer config
|
||||
|
||||
[inference] # Default inference config
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
output_dir = "/data/sami_debug/nemotron-debug"
|
||||
clean_output_dir = true
|
||||
max_steps = 5
|
||||
seq_len = 2048
|
||||
|
||||
[slurm]
|
||||
job_name = "nemotron-4node"
|
||||
pre_run_command = "uv sync --all-extras --all-packages --group mamba-ssm"
|
||||
|
||||
[deployment]
|
||||
type = "multi_node"
|
||||
num_train_nodes = 4
|
||||
num_infer_nodes = 4
|
||||
|
||||
[log]
|
||||
level = "debug"
|
||||
|
||||
[wandb]
|
||||
project = "sami_debug_nemotron"
|
||||
name = "nemotron-120b-math"
|
||||
|
||||
[weight_broadcast]
|
||||
type = "nccl"
|
||||
|
||||
[model]
|
||||
name = "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16"
|
||||
|
||||
[trainer]
|
||||
dist_timeout_seconds = 1800
|
||||
|
||||
[trainer.model]
|
||||
impl = "custom"
|
||||
attn = "flash_attention_2"
|
||||
optim_cpu_offload = true
|
||||
ep = 8
|
||||
fused_lm_head_token_chunk_size = 8192
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.ac_offloading]
|
||||
max_inflight_activations = 5
|
||||
|
||||
[trainer.model.compile]
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 2048
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "hendrycks-math"
|
||||
taskset = { id = "math-env-v1", dataset_name = "PrimeIntellect/Hendrycks-Math", dataset_subset = "default", task = { math_verify_timeout = 60 } }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 10
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 2048
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "math500"
|
||||
taskset = { id = "math500-v1" }
|
||||
num_examples = 30
|
||||
group_size = 4
|
||||
|
||||
[inference.parallel]
|
||||
tp = 8
|
||||
dp = 1
|
||||
@@ -1,71 +0,0 @@
|
||||
output_dir = "outputs/rl-nemotron-debug"
|
||||
clean_output_dir = true
|
||||
max_steps = 500
|
||||
seq_len = 4096
|
||||
|
||||
[slurm]
|
||||
job_name = "nemotron-sami-debug"
|
||||
|
||||
[deployment]
|
||||
type = "multi_node"
|
||||
num_train_nodes = 2
|
||||
num_infer_nodes = 2
|
||||
|
||||
[log]
|
||||
level = "debug"
|
||||
|
||||
[wandb]
|
||||
project = "nemotron_sami_debug"
|
||||
name = "nemotron-120b-math"
|
||||
|
||||
[weight_broadcast]
|
||||
type = "nccl"
|
||||
|
||||
[model]
|
||||
name = "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16"
|
||||
|
||||
[trainer.model]
|
||||
impl = "custom"
|
||||
attn = "flash_attention_2"
|
||||
optim_cpu_offload = true
|
||||
fused_lm_head_token_chunk_size = 8192
|
||||
|
||||
[trainer.model.debug]
|
||||
random_init = true
|
||||
num_layers = 8
|
||||
|
||||
[trainer.model.ac_offloading]
|
||||
max_inflight_activations = 5
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.compile]
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 4096
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "hendrycks-math"
|
||||
taskset = { id = "math-env-v1", dataset_name = "PrimeIntellect/Hendrycks-Math", dataset_subset = "default", task = { math_verify_timeout = 60 } }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 10
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 4096
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "math500"
|
||||
taskset = { id = "math500-v1" }
|
||||
num_examples = 30
|
||||
group_size = 4
|
||||
|
||||
[inference.parallel]
|
||||
tp = 4
|
||||
dp = 4
|
||||
@@ -1,42 +0,0 @@
|
||||
max_steps = 500
|
||||
seq_len = 4096
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[wandb]
|
||||
project = "wiki-search-debug"
|
||||
name = "wiki-search-4b"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-5
|
||||
weight_decay = 0.0
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 8
|
||||
dropout = 0.0
|
||||
target_modules = [
|
||||
"q_proj",
|
||||
"k_proj",
|
||||
"v_proj",
|
||||
"o_proj",
|
||||
"gate_proj",
|
||||
"up_proj",
|
||||
"down_proj"
|
||||
]
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 16
|
||||
oversampling_factor = 2.0
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 512
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "wiki-search"
|
||||
taskset = { id = "wiki-search-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[inference.model]
|
||||
tool_call_parser = "hermes"
|
||||
Vendored
+1
-1
Submodule deps/pydantic-config updated: 99f47c6cc0...4f5ae37358
Vendored
+1
-1
Submodule deps/renderers updated: bdb96b0c84...e9619bf8f0
Vendored
+1
-1
Submodule deps/research-environments updated: dd80d75bc8...f5d423c321
Vendored
+1
-1
Submodule deps/verifiers updated: d5604bd3df...b13ba60da6
+7
-11
@@ -28,7 +28,7 @@ impl = "custom" # or "hf" to force the HF path
|
||||
| GLM-5 / GLM-5.2 (`glm_moe_dsa`) | `zai-org/GLM-5`, `zai-org/GLM-5-FP8`, `zai-org/GLM-5.2`, `zai-org/GLM-5.2-FP8` | ✅ | ✅ |
|
||||
| Qwen3 MoE | `Qwen/Qwen3-30B-A3B`, … | ✅ | ✅ |
|
||||
| Qwen3.5 MoE | `Qwen/Qwen3.5-35B-A3B`, … | ✅ | ✅ |
|
||||
| Qwen3 / Qwen3.5 VLMs | see [Multimodal training](#multimodal-training) | MoE only | ✅ |
|
||||
| Qwen3 / Qwen3.5 VLMs | see [Multimodal training](#multimodal-training) | MoE only | ❌ |
|
||||
| Laguna | `poolside/Laguna-XS.2` | ✅ | ✅ |
|
||||
| MiniMax M2 | `MiniMax/MiniMax-M2` | ✅ | ✅ |
|
||||
| Nemotron H | `nvidia/Nemotron-3-Nano-30B-A3B`, … | ✅ | ❌ |
|
||||
@@ -72,20 +72,17 @@ The built-in VLM registry covers:
|
||||
|
||||
| Family | `model_type` | Vision attr | LM attr |
|
||||
|---|---|---|---|
|
||||
| Qwen3-VL | `qwen3_vl` | `model.visual` | `model.language_model` |
|
||||
| Qwen3-VL MoE | `qwen3_vl_moe` | `model.visual` | `model.language_model` |
|
||||
| Qwen3.5 | `qwen3_5` | `model.visual` | `model.language_model` |
|
||||
| Qwen3.5-MoE | `qwen3_5_moe` | `model.visual` | `model.language_model` |
|
||||
|
||||
For a model not in the table, look up the attribute paths on the loaded HF model with `model.named_children()` and set them under `[model.vlm]` directly.
|
||||
|
||||
### Enabling VLM Mode
|
||||
|
||||
Add `[model.vlm]` and bfloat16 dtypes:
|
||||
|
||||
```toml
|
||||
[model]
|
||||
name = "Qwen/Qwen3-VL-4B-Instruct"
|
||||
name = "Qwen/Qwen3.5-4B"
|
||||
impl = "custom"
|
||||
optimization_dtype = "bfloat16"
|
||||
reduce_dtype = "bfloat16"
|
||||
|
||||
@@ -97,12 +94,11 @@ language_model_attr = "model.language_model"
|
||||
|
||||
The weight-broadcast key prefix is derived as `{language_model_attr}.layers.` automatically.
|
||||
|
||||
To add a new model family permanently, append an entry to `VLM_REGISTRY` in `src/prime_rl/utils/vlm.py`.
|
||||
VLM training requires a registered custom PrimeRL implementation.
|
||||
|
||||
### Limitations
|
||||
|
||||
- **Vision encoder frozen by default.** Set `freeze_vision_encoder = false` to fine-tune it; in that case it's FSDP-sharded per block. The combination `freeze_vision_encoder = false` + LoRA is rejected by a config validator — LoRA freezes everything non-adapter, so unfreezing the encoder under LoRA would be a silent no-op.
|
||||
- **No multimodal-safe truncation.** Token sequences are truncated to `seq_len`, but `pixel_values` and `image_grid_thw` pass through unchanged. If a sample's tokens overflow, image tokens may get dropped while image tensors still describe the full image set. Set `seq_len` to cover your longest sample.
|
||||
- **Vision encoder frozen by default.** The default LoRA targets do not match Qwen3.5 vision modules. Set `freeze_vision_encoder = false` to fine-tune the encoder; this is incompatible with LoRA because LoRA freezes all non-adapter parameters.
|
||||
- **bfloat16 mandatory.** The trainer config validator refuses any other `optimization_dtype` / `reduce_dtype` for VLMs — vLLM serves VLMs in bfloat16 and a mismatch breaks the importance ratio.
|
||||
- **Higher KL mismatch with multi-image inputs.** Expect noisier `mismatch_kl` than text-only; this is from minor numerical differences between the trainer's and vLLM's image processing.
|
||||
- **Images aren't logged to monitors.** Sample logging captures the prompt text but not the actual images.
|
||||
@@ -142,7 +138,7 @@ For large MoE serving, splitting prefill and decode onto separate vLLM groups ca
|
||||
| Agentic (SWE, Lean) | 3:1 | Long growing contexts → prefill-heavy |
|
||||
| Non-agentic (math, chat) | 1:2 | Short prompts, long generations → decode-heavy |
|
||||
|
||||
Example config: [`examples/glm5_pd_disag/rl.toml`](https://github.com/PrimeIntellect-ai/prime-rl/blob/main/examples/glm5_pd_disag/rl.toml) — full RL run on `GLM-5` with P/D disaggregation behind a `vllm-router`, FP8 inference, and NCCL weight broadcast (see the [README](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/glm5_pd_disag) for the launch story).
|
||||
Example config: [`examples/advanced/glm-5.2/swe.toml`](https://github.com/PrimeIntellect-ai/prime-rl/blob/main/examples/advanced/glm-5.2/swe.toml) — full RL run on `GLM-5` with P/D disaggregation behind a `vllm-router`, FP8 inference, and NCCL weight broadcast, paired with an inference config from [`examples/advanced/glm-5.2/infer/`](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/advanced/glm-5.2/infer).
|
||||
|
||||
Monitor live queue depths to detect imbalance:
|
||||
|
||||
@@ -160,4 +156,4 @@ salloc -N 1 --gres=gpu:1 bash -c 'bash scripts/install_nixl_from_source.sh'
|
||||
uv pip install --reinstall --no-deps deps/nixl_cu12-*.whl
|
||||
```
|
||||
|
||||
The script writes UCX 1.19 to `third_party/ucx/`; the bundled sbatch templates prepend it to `LD_LIBRARY_PATH` so it overrides the system version. Re-run both commands after every `uv sync`, since the lock pins the wheel.
|
||||
The script writes UCX 1.19 to `third_party/ucx/`; the bundled sbatch templates prepend it to `LD_LIBRARY_PATH` so it overrides the system version. Re-run both commands after every `uv sync`, since the lock pins the wheel.
|
||||
|
||||
+9
-4
@@ -117,10 +117,15 @@ Both components resolve per environment. Each env inherits `[orchestrator.algo]`
|
||||
type = "grpo"
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
id = "math-env" # inherits grpo
|
||||
name = "math"
|
||||
taskset = { id = "math-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
# inherits the top-level grpo
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
id = "terminal-env"
|
||||
name = "terminal"
|
||||
taskset = { id = "terminal-v1" }
|
||||
harness = { id = "bash", runtime = { type = "subprocess" } }
|
||||
algo = { type = "echo" } # this env runs its own algorithm
|
||||
```
|
||||
|
||||
@@ -272,7 +277,7 @@ The per-token training signal is set by `algo.type` and the [algorithm](#the-alg
|
||||
| `grpo` | `rl` | Group-norm: reward minus per-group baseline, optional length penalty. |
|
||||
| `max_rl` | `rl` | Mean-normalized group credit (maximum-likelihood RL). |
|
||||
| `echo` | `rl` + `ce` | Group-norm on action tokens, plus weighted CE on env-provided tokens selected by message role (each role's `alpha` is its ECHO λ), optionally narrowed by a user filter. |
|
||||
| `opd` | `ref_kl` | On-policy distillation: per-token reverse KL to a reference model (`model`, an inline frozen hosted model), evaluated in the trainer from shipped reference logprobs. No credit — rollouts keep `advantages = None` (advantage-based filters never fire) and ship no advantage stream; `group_size` only fans out sampling. |
|
||||
| `opd` | `ref_kl` | On-policy distillation: per-token reverse KL to a reference model (`teacher`, an inline frozen hosted model), evaluated in the trainer from shipped reference logprobs. No credit — rollouts keep `advantages = None` (advantage-based filters never fire) and ship no advantage stream; `group_size` only fans out sampling. |
|
||||
| `opsd` | `ref_kl` | SDFT: per-token reverse KL to a demo-conditioned reference. No credit — rollouts keep `advantages = None` (advantage-based filters never fire) and ship no advantage stream. |
|
||||
| `sft` | `ce` | Cross-entropy on the sampled tokens. Assigns no advantage — trains on every sampled token. |
|
||||
|
||||
@@ -415,7 +420,7 @@ tok.apply_chat_template(messages, tokenize=False)
|
||||
# (the <think>R1</think> from turn 2 is gone)
|
||||
```
|
||||
|
||||
Hand-coded renderers ship for `qwen3`, `qwen3-vl`, `qwen3.5`, `glm5`, `glm4.5`, `minimax-m2`, `deepseek-v3`, `kimi-k2`, `kimi-k2.5`, `nemotron-3`, `gpt-oss`; anything else falls back to `DefaultRenderer` (a generic `apply_chat_template` wrapper). Pick one via:
|
||||
Hand-coded renderers ship for `qwen3`, `qwen3-vl`, `qwen3.5`, `glm-5`, `glm-4.5`, `minimax-m2`, `deepseek-v3`, `kimi-k2`, `kimi-k2.5`, `nemotron-3`, `gpt-oss`; anything else falls back to `DefaultRenderer` (a generic `apply_chat_template` wrapper). Pick one via:
|
||||
|
||||
```toml
|
||||
[orchestrator.renderer]
|
||||
|
||||
+21
-20
@@ -34,7 +34,7 @@ Field values come from three sources — Pydantic defaults, TOML files (passed w
|
||||
The `@` token introduces a TOML file. Multiple `@` arguments compose left-to-right, deep-merged — unset fields in an overlay keep the base value:
|
||||
|
||||
```bash
|
||||
uv run rl @ examples/reverse_text/rl.toml # one file
|
||||
uv run rl @ examples/basic/reverse-text/rl.toml # one file
|
||||
uv run rl @ base.toml @ overlay.toml # left to right
|
||||
uv run rl --trainer @ trainer.toml --orchestrator @ orch.toml # per-section
|
||||
uv run rl @ base.toml --trainer @ trainer.toml # mixed
|
||||
@@ -149,25 +149,25 @@ Training environments are an array of tables — set one per env, optionally wit
|
||||
```toml
|
||||
[[orchestrator.train.env]]
|
||||
name = "gsm8k"
|
||||
taskset = { id = "gsm8k-v1", split = "train" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "gsm8k-v1", split = "train" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
ratio = 3 # 75% of batches
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
taskset = { id = "reverse-text-v1" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
ratio = 1 # default — 25% of batches
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "gsm8k-eval"
|
||||
taskset = { id = "gsm8k-v1", split = "test" }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
env.taskset = { id = "gsm8k-v1", split = "test" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
```
|
||||
|
||||
`ratio` defaults to `1` (equal weight per env); values are relative weights normalized to probabilities across envs.
|
||||
|
||||
Fields in `taskset` configure the V1 taskset. `harness` selects how its tasks are run.
|
||||
Everything environment lives under the `env` block (verifiers' `[env]` shape): `env.taskset` configures the v1 taskset, and each agent is a field on the env — `env.agent.harness` selects how the single-agent env's tasks are run, and per-run caps are per-agent (`env.agent.max_turns`, `env.agent.timeout`, `env.agent.max_output_tokens`). A multi-agent env declares its own seats (`env.<role>.*`).
|
||||
|
||||
The same taskset can appear multiple times across train and eval (or with different settings) — useful for evaluating on a held-out split or comparing two configurations side by side. When it is reused, set a distinct `name` on each entry; `name` defaults to the taskset id and must be unique across all envs in the same group.
|
||||
|
||||
@@ -206,30 +206,31 @@ For standalone `sft` and `inference` configs, `[env_vars]` applies to that entry
|
||||
|
||||
## Examples
|
||||
|
||||
The shipped end-to-end examples in [`examples/`](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples) are the canonical, kept-up-to-date references — the rest of the repo's TOMLs (under `configs/`) are CI- and debug-internal and may drift. Each example directory has its own README with the full launch story.
|
||||
The shipped end-to-end examples in [`examples/`](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples) are the canonical, kept-up-to-date references — the rest of the repo's TOMLs (under `configs/`) are CI- and debug-internal and may drift. Each basic example directory has its own README with the full launch story; the advanced examples are config-only.
|
||||
|
||||
**Basic** (1–8 GPUs):
|
||||
|
||||
- [**Reverse Text**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/reverse_text) — `Qwen3-0.6B` reversing a chunk of text. Tiny single-turn SFT + RL; runs on a single consumer GPU in minutes.
|
||||
- [**Wordle**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/wordle) — `Qwen3-1.7B` playing Wordle. Multi-turn SFT + RL; 2–4 H100s.
|
||||
- [**Alphabet Sort**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/alphabet_sort) — `Qwen3-4B-Instruct-2507` sorting names alphabetically. Multi-turn LoRA RL without SFT warmup; one H100.
|
||||
- [**Wiki Search**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/wiki_search) — `Qwen3-4B-Instruct-2507` answering trivia by web-searching Wikipedia. Multi-turn with tool use.
|
||||
- [**Hendrycks Sanity**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/hendrycks_sanity) — `DeepSeek-R1-Distill-Qwen-1.5B` on a filtered MATH subset. Useful for algorithm ablations.
|
||||
- [**Reverse Text**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/basic/reverse-text) — `Qwen3-0.6B` reversing a chunk of text. Tiny single-turn SFT + RL; runs on a single consumer GPU in minutes.
|
||||
- [**Wordle**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/basic/wordle) — `Qwen3-1.7B` playing Wordle. Multi-turn SFT + RL; 2–4 H100s.
|
||||
- [**Alphabet Sort**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/basic/alphabet-sort) — `Qwen3-4B-Instruct-2507` sorting names alphabetically. Multi-turn LoRA RL without SFT warmup; one H100.
|
||||
- [**Wiki Search**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/basic/wiki-search) — `Qwen3-4B-Instruct-2507` answering trivia by searching a Wikipedia corpus. Multi-turn with tool use.
|
||||
- [**Hendrycks Sanity**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/basic/hendrycks-sanity) — `DeepSeek-R1-Distill-Qwen-1.5B` on a filtered MATH subset. Useful for algorithm ablations.
|
||||
|
||||
**Advanced** (32–2048 GPUs, SLURM):
|
||||
|
||||
- [**Qwen 3 30B – A3B Math**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/qwen30b_math) — `Qwen3-30B-A3B` on hard math.
|
||||
- [**Qwen 3 30B – A3B SWE**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/qwen30b_swe) — `Qwen3-30B-A3B` on hard SWE.
|
||||
- [**INTELLECT-3.1**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/intellect-3.1) — reproduces our INTELLECT-3.1 training run.
|
||||
- [**MiniMax-M2.5 SWE**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/minimax_m2.5_swe) — `MiniMax-M2.5` on agentic SWE.
|
||||
- [**High-throughput GLM-5**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/glm5_pd_disag) — `GLM-5` with P/D disaggregation and FP8 inference.
|
||||
- [**Qwen3-30B-A3B**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/advanced/qwen3-30b-a3b) — `Qwen3-30B-A3B` on math, SWE, and tool use.
|
||||
- [**GLM-4.5-Air**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/advanced/glm-4.5-air) — `GLM-4.5-Air` on search, SWE, and terminal.
|
||||
- [**Nemotron-3-Super**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/advanced/nemotron-3-super) — `Nemotron-3-Super-120B` hybrid-Mamba MoE on SWE at 131k context.
|
||||
- [**MiniMax-M2.5 SWE**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/advanced/minimax-m2.5) — `MiniMax-M2.5` on agentic SWE.
|
||||
- [**INTELLECT-3.1**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/advanced/intellect-3.1) — reproduces our INTELLECT-3.1 training run.
|
||||
- [**High-throughput GLM-5**](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/advanced/glm-5.2) — large-scale `GLM-5`/`GLM-5.2` inference with P/D disaggregation and FP8.
|
||||
|
||||
### Worked Example: Compose, Override, Dry-Run
|
||||
|
||||
Start from a shipped base config, override two fields on the CLI, and dry-run:
|
||||
|
||||
```bash
|
||||
uv run rl @ examples/reverse_text/rl.toml \
|
||||
uv run rl @ examples/basic/reverse-text/rl.toml \
|
||||
--wandb.name my-experiment \
|
||||
--trainer.optim.lr 5e-6 \
|
||||
--output-dir /tmp/reverse-dry \
|
||||
|
||||
+17
-5
@@ -14,6 +14,7 @@ This page covers workflows for developing on `prime-rl` itself — running the t
|
||||
- [Implement the Modeling Code](#implement-the-modeling-code)
|
||||
- [Register a Mini Preset](#register-a-mini-preset)
|
||||
- [Run the Smoke Test](#run-the-smoke-test)
|
||||
- [Adding a Custom VLM Implementation](#adding-a-custom-vlm-implementation)
|
||||
|
||||
## Test Suite
|
||||
|
||||
@@ -71,7 +72,7 @@ Drop the modeling code under `src/prime_rl/trainer/models/<arch>/` (HF-compatibl
|
||||
|
||||
### Register a Mini Preset
|
||||
|
||||
Add an entry to [`scripts/mini_moe.py`](https://github.com/PrimeIntellect-ai/prime-rl/blob/main/scripts/mini_moe.py) so the smoke-test workflow can build a ~0.5B test model in your architecture. The preset names the config class, picks small dimensions, and wires up the HF + PrimeRL model classes plus a tokenizer source:
|
||||
Add an entry to [`scripts/mini_moe.py`](https://github.com/PrimeIntellect-ai/prime-rl/blob/main/scripts/mini_moe.py) so the smoke-test workflow can build a ~0.5B test model in your architecture. The preset names the config class, picks small dimensions, and wires up the HF + prime-rl model classes plus a tokenizer source:
|
||||
|
||||
```python
|
||||
ARCH_PRESETS = {
|
||||
@@ -88,7 +89,7 @@ ARCH_PRESETS = {
|
||||
|
||||
### Run the Smoke Test
|
||||
|
||||
Build the mini model. This creates a ~543M-parameter GLM-4 MoE (1024 hidden, 24 layers, 8 experts) with random weights, copies the tokenizer from the original GLM-4 model, and verifies the HF↔PrimeRL roundtrip is lossless:
|
||||
Build the mini model. This creates a ~543M-parameter GLM-4 MoE (1024 hidden, 24 layers, 8 experts) with random weights, copies the tokenizer from the original GLM-4 model, and verifies the HF↔prime-rl roundtrip is lossless:
|
||||
|
||||
```bash
|
||||
uv run python scripts/mini_moe.py --arch glm4_moe --output-dir ./mini-glm-moe
|
||||
@@ -103,10 +104,9 @@ uv run python scripts/mini_moe.py --arch glm4_moe --output-dir ./mini-glm-moe --
|
||||
Warm up the random-weight mini model with SFT on reverse-text so KL divergence becomes meaningful in the RL phase. Loss drops from ~12 to ~2.5 — the output won't be coherent, but the distribution is non-trivial. A pre-built SFT'd checkpoint lives at [samsja/mini-glm-moe](https://huggingface.co/samsja/mini-glm-moe) if you want to skip this step:
|
||||
|
||||
```bash
|
||||
uv run sft @ configs/debug/moe/sft/train.toml \
|
||||
uv run sft \
|
||||
--model.name ./mini-glm-moe \
|
||||
--data.name PrimeIntellect/Reverse-Text-SFT \
|
||||
--data.type null \
|
||||
--max_steps 200 \
|
||||
--optim.lr 1e-4 \
|
||||
--ckpt.weights
|
||||
@@ -115,7 +115,7 @@ uv run sft @ configs/debug/moe/sft/train.toml \
|
||||
Then run the full RL stack on reverse-text:
|
||||
|
||||
```bash
|
||||
uv run rl @ configs/ci/integration/reverse_text_moe/start.toml \
|
||||
uv run rl @ configs/ci/integration/reverse-text-moe/start.toml \
|
||||
--model.name samsja/mini-glm-moe \
|
||||
--trainer.model.impl custom \
|
||||
--inference.gpu-memory-utilization 0.7 \
|
||||
@@ -138,3 +138,15 @@ Before merging a new model, you need to ensure the following:
|
||||
- The small smoke test passes.
|
||||
|
||||
In the PR that adds the new model, you also need to provide a table covering the KL mismatch across 20 steps on `math` environment with `batch_size=64`. All the entries in the table must lower than 0.015. If this is not met, the PR will not be merged (unless reasonable justification is provided). This is to ensure all our models are consistent and their implementations match the implementations in the inference framework.
|
||||
|
||||
## Adding a Custom VLM Implementation
|
||||
|
||||
VLM training (any run with `[model.vlm]` set, SFT or RL) is custom-implementation-only: `get_model` rejects models without a custom PrimeRL VLM class at load time. To make a new VLM family trainable, extend a custom text model with a composite VLM body — the Qwen3.5 dense (`models/qwen3_5/`) and MoE (`models/qwen3_5_moe/`) implementations are the reference. The pieces, in dependency order:
|
||||
|
||||
1. **Custom text model first.** The VLM body wraps a custom `*ForCausalLM` (see [Adding a New Model](#adding-a-new-model)), so the text side — including its state-dict conversion and KL-mismatch table — comes first.
|
||||
2. **Composite VLM body.** A `*VLMModel` that holds the HF vision encoder and the custom text model, with a `prepare_inputs_embeds_and_position_ids` step: embed tokens, run the vision encoder, scatter image embeddings over placeholder tokens, and build MRoPE 3D positions from `mm_token_type_ids` (the renderer owns the token→modality mapping). The unified `*ForCausalLM` dispatches on the config: composite config → VLM path, text config → text path.
|
||||
3. **Always run the vision encoder.** Text-only micro-batches must feed the encoder dummy pixels and graft the result into the graph with zero contribution (`inputs_embeds + image_embeds.sum() * 0.0`) so FSDP/EP collectives stay symmetric across ranks when the encoder is trainable.
|
||||
4. **Packed-boundary consumption.** Samples pack into shared rows with per-document boundaries in `seq_lens`; every custom model's `forward()` declares the typed `seq_lens`/`seq_lens_are_pre_shard` parameters (the trainer passes them unconditionally) and must honor the boundaries — varlen flash `cu_seqlens`, linear-attention state resets per document, and a loud rejection on attention paths that can't (see the packed-batch guard in any modeling file). Set `supports_packed_multimodal_training` on the VLM model once packed rows are handled — RL fails loudly at startup for VLM models without it.
|
||||
5. **Registration.** Register the composite `model_type` in `_CUSTOM_VLM_MAPPING` (`models/__init__.py`) so `get_model` dispatches to the custom class, and describe the family in `VLM_REGISTRY` (`utils/vlm.py`).
|
||||
6. **Context parallelism (optional).** CP-capable VLMs implement `set_context_parallel_attributes` and shard embeds/positions inside the model after the vision merge; the trainers defer sharding to the model for MRoPE batches under ulysses.
|
||||
7. **Validation.** Same bar as text models: the KL-mismatch table for the text path, plus an SFT run and an RL run on a real multimodal dataset (the `color-codeword` environment is the reference task).
|
||||
|
||||
+3
-3
@@ -9,7 +9,7 @@ This page covers the inference configuration and the supported features/deployme
|
||||
- [Multi-Node](#multi-node)
|
||||
- [Multi-replica](#multi-replica)
|
||||
- [Wide-EP](#wide-ep)
|
||||
- [P/D Dissagregation](#pd-dissagregation)
|
||||
- [P/D Disaggregation](#pd-disaggregation)
|
||||
- [Router](#router)
|
||||
- [Routing policies](#routing-policies)
|
||||
- [Advanced Configuration](#advanced-configuration)
|
||||
@@ -26,7 +26,7 @@ This page covers the inference configuration and the supported features/deployme
|
||||
We support 3 distinct deployment shapes:
|
||||
- [Single-Node](#single-node) - Runs the inference server on a single node. Useful for debugging, small scale experiments or smaller models. The default deployment shape.
|
||||
- [Multi-Node](#multi-node) - Runs the inference server on multiple nodes. Useful for large scale experiments or larger models, where latency is not a concern - i.e. single turn inference, long context inference, etc.
|
||||
- [Disaggregated](#disaggregated) - Runs the inference server on multiple nodes, but disaggregates the prefill and decode stages. Useful for large scale experiments or larger models, where latency is a concern and multi-node deployment creates very high E2E rollout latency, such as agentic workflows.
|
||||
- [Disaggregated](#pd-disaggregation) - Runs the inference server on multiple nodes, but disaggregates the prefill and decode stages. Useful for large scale experiments or larger models, where latency is a concern and multi-node deployment creates very high E2E rollout latency, such as agentic workflows.
|
||||
|
||||
Most of the features are supported for all deployment shapes, with few exceptions. These exceptions are rejected on validation.
|
||||
|
||||
@@ -124,7 +124,7 @@ dp = 8
|
||||
|
||||
This configuration will run 2 vLLM processes, each with `data_parallel_size_local = 4` and `tp = 2` and expert parallelism spanning 2 nodes. The requests are again routed to these processes via the `vllm-router`.
|
||||
|
||||
## P/D Dissagregation
|
||||
## P/D Disaggregation
|
||||
|
||||
This is the most advanced deployment shape. It allows you to disaggregate the prefill and decode stages, with KV cache flowing between them. This is useful for large scale deployments, where there are high requirements on latency, such as agentic workflows spanning 100s of turns.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"$schema": "https://mintlify.com/docs.json",
|
||||
"navigation": [
|
||||
{
|
||||
"group": "PRIME-RL",
|
||||
"group": "prime-rl",
|
||||
"pages": [
|
||||
"overview",
|
||||
"configuration",
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ A `prime-rl` RL run is three cooperating processes:
|
||||
|
||||

|
||||
|
||||
- **Inference** — vLLM-backed server (or fleet) holding the current policy. The orchestrator drives rollouts through the token-in `/v1/generate` route via the [`renderers`](https://github.com/PrimeIntellect-ai/renderers) package (OpenAI-compatible chat/completions routes are also exposed for external clients). We are trying to stay up-to-date with the latest vLLM features, you can read more about the supported features and deployment options in the dedicated [inference documentation](inference.md).
|
||||
- **Inference** — vLLM-backed server (or fleet) holding the current policy. The orchestrator drives rollouts through the token-in `/inference/v1/generate` route via the [`renderers`](https://github.com/PrimeIntellect-ai/renderers) package (OpenAI-compatible chat/completions routes are also exposed for external clients). We are trying to stay up-to-date with the latest vLLM features, you can read more about the supported features and deployment options in the dedicated [inference documentation](inference.md).
|
||||
- **Orchestrator** — Lightweight CPU process that owns the data plane across many [`verifiers`](https://github.com/PrimeIntellect-ai/verifiers) training and eval environments. Each env runs in an isolated subprocess with a variable-size pool of env workers for scalability. The orchestrator drives multi-turn rollouts against the inference fleet (tool use, browsers, sandboxes, long horizons) without re-tokenizing across turns, computes advantages, packs the rollouts into training batches, and relays new weights from trainer to inference.
|
||||
- **Trainer** — FSDP2 process group that consumes packed rollouts and steps the optimizer. We ship optimized custom modeling code for many MoE / dense / VLM families that unlocks advanced trainer parallelism — expert parallelism (EP, with DeepEP kernels) and context parallelism (CP) for long-sequence training — plus selective activation checkpointing, FP8 training on Hopper+, LoRA, and multi-tenant training (many concurrent LoRA tenants sharing one trainer + inference deployment). You can read more in the dedicated [training documentation](training.md).
|
||||
|
||||
@@ -29,10 +29,10 @@ You need at least one NVIDIA GPU (RTX 3090/4090/5090, A100, H100, H200, or B200)
|
||||
Train an SFT-warmed `Qwen3-0.6B` on the `reverse-text` task — the env is bundled with the [`verifiers`](https://github.com/PrimeIntellect-ai/verifiers) submodule so no separate install is needed. This config ships in the repo and runs on two GPUs (one for inference, one for the trainer):
|
||||
|
||||
```bash
|
||||
uv run rl @ examples/reverse_text/rl.toml
|
||||
uv run rl @ examples/basic/reverse-text/rl.toml
|
||||
```
|
||||
|
||||
The `rl` entrypoint reads `examples/reverse_text/rl.toml`, splits it into per-process sub-configs, picks GPU 0 for inference and GPU 1 for the trainer, launches all three processes, and tees their stdout into `outputs/logs/{trainer,orchestrator,inference}.log`. Within a minute the trainer should log `step 1` and a reward sample; after 20 steps the run completes and final HF-compatible weights land at `outputs/weights/step_20`.
|
||||
The `rl` entrypoint reads `examples/basic/reverse-text/rl.toml`, splits it into per-process sub-configs, picks GPU 0 for inference and GPU 1 for the trainer, launches all three processes, and tees their stdout into `outputs/logs/{trainer,orchestrator,inference}.log`. Within a minute the trainer should log `step 1` and a reward sample; after 20 steps the run completes and final HF-compatible weights land at `outputs/weights/step_20`.
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
+4
-4
@@ -112,7 +112,7 @@ CP shards a single sequence across multiple GPUs along the token dimension — f
|
||||
```toml
|
||||
[trainer.model]
|
||||
impl = "custom"
|
||||
attn = "flash_attention_2" # or fa3 / fa4
|
||||
attn = "auto" # auto = FA3 on Hopper, FA4 on Blackwell; or flash_attention_2/3/4
|
||||
cp = 2 # CP degree
|
||||
cp_style = "ulysses" # "ring"
|
||||
```
|
||||
@@ -226,10 +226,10 @@ gpus_per_node = 8
|
||||
|
||||
### Examples
|
||||
|
||||
Full multi-node configs ship in [`examples/multinode/`](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/multinode):
|
||||
Full multi-node configs ship under [`examples/advanced/`](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/advanced):
|
||||
|
||||
- [`rl.toml`](https://github.com/PrimeIntellect-ai/prime-rl/blob/main/examples/multinode/rl.toml) — two-node RL run with NCCL weight broadcast on a 30B MoE policy.
|
||||
- [`sft.toml`](https://github.com/PrimeIntellect-ai/prime-rl/blob/main/examples/multinode/sft.toml) — two-node SFT against the same model.
|
||||
- [`nemotron-3-super/swe.toml`](https://github.com/PrimeIntellect-ai/prime-rl/blob/main/examples/advanced/nemotron-3-super/swe.toml) — 4 trainer + 1 inference node RL on a 120B hybrid-Mamba MoE with NCCL weight broadcast.
|
||||
- [`glm-5.2/`](https://github.com/PrimeIntellect-ai/prime-rl/tree/main/examples/advanced/glm-5.2) — large-scale and P/D-disaggregated inference across the GLM-5 family.
|
||||
|
||||
For inference-only multi-node, set `[deployment] type = "multi_node"` on an inference TOML — each node runs an independent vLLM replica (TP and DP must fit within one node), and the launcher prints one URL per node. Front the URLs with a router or point clients at any of them.
|
||||
|
||||
|
||||
+5
-4
@@ -45,7 +45,7 @@ This page covers everything you need to launch, observe, checkpoint, and recover
|
||||
The minimal RL run trains an SFT-warmed `Qwen3-0.6B` on the `reverse-text` task — the env is bundled with the [`verifiers`](https://github.com/PrimeIntellect-ai/verifiers) submodule, so nothing else needs to be installed:
|
||||
|
||||
```bash
|
||||
uv run rl @ examples/reverse_text/rl.toml
|
||||
uv run rl @ examples/basic/reverse-text/rl.toml
|
||||
```
|
||||
|
||||
### Useful Knobs
|
||||
@@ -156,8 +156,9 @@ enable_thinking = false
|
||||
|
||||
If a model needs another template control, add it to that model's renderer config in `renderers` (for example a new field on the relevant `*RendererConfig`) and consume it in the renderer implementation.
|
||||
|
||||
**Renderer-backed tokenization.** SFT tokenization is renderer-only. The [`renderers`](algorithms.md#renderers) package owns message-to-token conversion and loss attribution end-to-end, so position-dependent chat templates (for example templates that strip past `—` blocks across user turns) do not corrupt the loss mask. `[renderer]` defaults to `name = "auto"`; set a typed renderer config only when you need model-specific template controls. Hand-coded renderers ship for Qwen3, Qwen3.5, GLM-5, GLM-4.5, Kimi K2/K2.5, MiniMax M2, DeepSeek V3, Nemotron 3, GPT-OSS.
|
||||
**Renderer-backed tokenization.** SFT tokenization is renderer-only. The [`renderers`](algorithms.md#renderers) package owns message-to-token conversion and loss attribution end-to-end, so position-dependent chat templates (for example templates that strip past `<think>` blocks across user turns) do not corrupt the loss mask. `[renderer]` defaults to `name = "auto"`; set a typed renderer config only when you need model-specific template controls. Hand-coded renderers ship for Qwen3, Qwen3.5, GLM-5, GLM-4.5, Kimi K2/K2.5, MiniMax M2, DeepSeek V3, Nemotron 3, GPT-OSS, and VLM families such as Qwen3-VL/Qwen3.5.
|
||||
|
||||
**VLM training requires a custom PrimeRL implementation.** Training a model with `[model.vlm]` set (SFT or RL) requires `model.impl = "custom"` and only works for models with a registered PrimeRL VLM class (currently Qwen3.5 dense and MoE).
|
||||
|
||||
See [Algorithms § Multi-Turn Trajectories](algorithms.md#multi-turn-trajectories) for the full picture.
|
||||
|
||||
@@ -166,7 +167,7 @@ See [Algorithms § Multi-Turn Trajectories](algorithms.md#multi-turn-trajectorie
|
||||
The minimal SFT run trains `Qwen3-0.6B` on the `reverse-text` SFT dataset:
|
||||
|
||||
```bash
|
||||
uv run sft @ examples/reverse_text/sft.toml --wandb
|
||||
uv run sft @ examples/basic/reverse-text/sft.toml --wandb
|
||||
```
|
||||
|
||||
Multi-GPU and multi-node use torchrun under the hood (the `sft` entrypoint manages this for you — see [Scaling § SFT and Torchrun](scaling.md#sft-and-torchrun) for non-default layouts; multi-node SFT goes through [SLURM](scaling.md#slurm)).
|
||||
@@ -336,7 +337,7 @@ Requires `PRIME_API_KEY` (set via `prime login` or env var) and an allowlisted t
|
||||
|
||||
## Rules of Thumb
|
||||
|
||||
- **Start small.** Run `examples/reverse_text/rl.toml` end-to-end on 2 GPUs before scaling. If the smoke run finishes cleanly, your install is good.
|
||||
- **Start small.** Run `examples/basic/reverse-text/rl.toml` end-to-end on 2 GPUs before scaling. If the smoke run finishes cleanly, your install is good.
|
||||
- **Batch size ≥ 64.** Smaller batches give noisy gradient estimates and the trainer's overhead-per-step dominates throughput. 64 is the practical floor; 128–512 is the range for quick ablations; production RL often runs at 1024+.
|
||||
- **Group size ≥ 8.** Bigger groups (`orchestrator.group_size`) make it more likely that a task produces a mix of high- and low-reward rollouts, which is what gives the trainer a usable signal — if all rollouts in a group succeed or all fail, the within-group advantage collapses to zero and the trainer learns nothing from that task. Bigger groups also tighten advantage normalization. 8 is the floor; 16–32 is common.
|
||||
- **Pin `output_dir` per run.** Sharing a directory across runs will mix rollouts and break resumes. `--output-dir outputs/<unique-name>` is the simplest discipline.
|
||||
|
||||
+15
-1
@@ -1,3 +1,17 @@
|
||||
# Examples
|
||||
|
||||
This directory maintains configurations for usage examples of PRIME-RL which are referenced in the [README](../README.md).
|
||||
End-to-end usage examples for prime-rl, referenced from the top-level [README](../README.md).
|
||||
|
||||
- **[`basic/`](basic)** — walk-throughs for the core environments on 1–8 GPUs (baseline eval →
|
||||
optional SFT warmup → RL → eval), each with its own README:
|
||||
- `reverse-text` — smallest end-to-end loop (single-turn, 0.6B)
|
||||
- `alphabet-sort` — multi-turn, user simulator, LoRA
|
||||
- `wiki-search` — multi-turn tool calling, LoRA
|
||||
- `wordle` — multi-turn (~6-turn games)
|
||||
- `hendrycks-sanity` — single-turn math, long-running
|
||||
- **[`advanced/`](advanced)** — larger, mostly multi-node runs on frontier models, one folder
|
||||
per model: `qwen3-30b-a3b` (math/swe/tool), `glm-4.5-air` (search/swe/terminal), `glm-5.2`
|
||||
(large-scale + PD-disaggregated inference), `minimax-m2.5` (swe), `nemotron-3-super` (swe),
|
||||
`intellect-3.1` (swe).
|
||||
|
||||
Dev-sized (2-GPU) counterparts of `basic/` live in [`configs/basic/`](../configs/basic).
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user