Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
390e2cef48 | ||
|
|
0bafbd7c28 | ||
|
|
662f1ee4b8 | ||
|
|
2fddd88884 | ||
|
|
a059509de4 | ||
|
|
fb013c6fb6 | ||
|
|
686260561d | ||
|
|
e138ea5d9d | ||
|
|
537dc8c768 | ||
|
|
919dfbb637 |
@@ -1 +0,0 @@
|
||||
../skills
|
||||
@@ -1,11 +0,0 @@
|
||||
# .git stays: docker-editable-pretend-versions.sh reads .git/modules via the bind mount.
|
||||
outputs
|
||||
**/.venv
|
||||
**/__pycache__
|
||||
**/*.py[cod]
|
||||
**/.pytest_cache
|
||||
**/.ruff_cache
|
||||
**/.mypy_cache
|
||||
.claude
|
||||
.vscode
|
||||
*.ipynb
|
||||
@@ -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@v7
|
||||
uses: actions/upload-artifact@v4
|
||||
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@v7
|
||||
uses: actions/checkout@v4
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras
|
||||
run: uv sync
|
||||
- name: Download all benchmark artifacts
|
||||
uses: actions/download-artifact@v8
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: /tmp/benchmark_artifacts
|
||||
pattern: benchmark-*
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
name: Build Image (ghcr)
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref:
|
||||
@@ -25,51 +27,17 @@ on:
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: primeintellect-ai/prime-rl
|
||||
BUILD_REF: ${{ inputs.ref || github.ref_name }}
|
||||
BUILD_TAG: ${{ inputs.tag || '' }}
|
||||
BUILD_REF: ${{ github.event.release.tag_name || inputs.ref || github.ref_name }}
|
||||
BUILD_TAG: ${{ github.event.release.tag_name || inputs.tag || '' }}
|
||||
BUILD_PLATFORMS: ${{ inputs.platforms || 'both' }}
|
||||
|
||||
concurrency:
|
||||
group: build-image-${{ inputs.tag || inputs.ref || github.ref_name }}
|
||||
group: build-image-${{ github.event.release.tag_name || inputs.tag || inputs.ref || github.ref_name }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
authorize:
|
||||
name: Authorize dispatcher
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Require maintain or admin
|
||||
# Gate MANUAL dispatches only; other events (e.g. release) are
|
||||
# already privileged and pass through. Guard the step, not the job —
|
||||
# a skipped job would skip `prepare` via `needs: authorize`.
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
ACTOR: ${{ github.triggering_actor }}
|
||||
REPO: ${{ github.repository }}
|
||||
run: |
|
||||
# Restricted to repo members with maintain or admin. Automated
|
||||
# in-repo dispatches (devx_tag dev-image builds, the release build)
|
||||
# run as github-actions[bot] via GITHUB_TOKEN — allow those through.
|
||||
if [ "$ACTOR" = "github-actions[bot]" ]; then
|
||||
echo "Dispatcher is repo automation ($ACTOR); allowed."
|
||||
exit 0
|
||||
fi
|
||||
role=$(gh api "repos/${REPO}/collaborators/${ACTOR}/permission" --jq '.role_name' 2>/dev/null || true)
|
||||
echo "Dispatcher $ACTOR has repo role: ${role:-<none>}"
|
||||
case "$role" in
|
||||
admin|maintain)
|
||||
echo "Authorized." ;;
|
||||
*)
|
||||
echo "::error::$ACTOR (role: ${role:-none}) is not allowed to trigger image builds; requires maintain or admin." >&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
|
||||
prepare:
|
||||
name: Prepare build
|
||||
needs: authorize
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -103,7 +71,7 @@ jobs:
|
||||
esac
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ env.BUILD_REF }}
|
||||
fetch-depth: 0
|
||||
@@ -115,30 +83,27 @@ jobs:
|
||||
INPUT_TAG: ${{ env.BUILD_TAG }}
|
||||
PLATFORMS: ${{ env.BUILD_PLATFORMS }}
|
||||
run: |
|
||||
case "$INPUT_REF" in
|
||||
main|v[0-9]*|*.dev[0-9]*) ;;
|
||||
*)
|
||||
echo "ref '${INPUT_REF}' not allowed for ghcr publish (must be main, v*, or *.dev*)" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$INPUT_TAG" ] && [ "$INPUT_TAG" != "$INPUT_REF" ] && [ "$INPUT_REF" != "main" ]; then
|
||||
echo "custom 'tag' that differs from 'ref' is only allowed when ref=main; got ref='${INPUT_REF}' tag='${INPUT_TAG}'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sanitize() {
|
||||
echo "$1" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9._-]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//' | cut -c1-50
|
||||
}
|
||||
|
||||
# A ref that is exactly a git tag builds under that tag verbatim;
|
||||
# any other ref (branch / arbitrary commit) is prefixed with
|
||||
# `git describe` so the tag carries the nearest release, commit
|
||||
# distance and short sha (e.g. v0.7.0-42-g1a2b3c4d5-fix-my-branch)
|
||||
# and can't collide with a clean release tag.
|
||||
if [ -n "$INPUT_TAG" ]; then
|
||||
tag=$(sanitize "$INPUT_TAG")
|
||||
elif tag=$(git describe --tags --exact-match 2>/dev/null); then
|
||||
:
|
||||
else
|
||||
tag="$(git describe --tags --always)-$(sanitize "$INPUT_REF")"
|
||||
raw_tag="$INPUT_TAG"
|
||||
if [ -z "$raw_tag" ]; then
|
||||
raw_tag="$INPUT_REF"
|
||||
fi
|
||||
|
||||
tag=$(echo "$raw_tag" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9._-]/-/g' | sed 's/--*/-/g' | cut -c1-50 | sed 's/^-//;s/-$//')
|
||||
if [ -z "$tag" ]; then
|
||||
echo "Could not derive a valid image tag from ref='${INPUT_REF}' tag='${INPUT_TAG}'." >&2
|
||||
echo "Could not derive a valid image tag from '${raw_tag}'." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -151,6 +116,7 @@ jobs:
|
||||
build:
|
||||
name: Build and push (${{ matrix.suffix }})
|
||||
needs: prepare
|
||||
environment: ghcr-publish
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
||||
@@ -161,16 +127,10 @@ jobs:
|
||||
steps:
|
||||
- name: Remove unnecessary packages
|
||||
run: |
|
||||
# Deleting the preinstalled toolchains costs ~70s; skip unless disk is tight.
|
||||
avail_gb=$(df -BG --output=avail / | tail -1 | tr -dc '0-9')
|
||||
if [ "${avail_gb:-0}" -lt 80 ]; then
|
||||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
|
||||
else
|
||||
echo "Skipping cleanup: ${avail_gb}G available on /"
|
||||
fi
|
||||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ needs.prepare.outputs.ref }}
|
||||
fetch-depth: 0
|
||||
@@ -180,34 +140,26 @@ jobs:
|
||||
run: |
|
||||
if [ -f .gitmodules ]; then
|
||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||
git submodule update --init --recursive -- deps/pydantic-config deps/verifiers deps/renderers deps/prime-envs
|
||||
git submodule update --init --recursive -- deps/pydantic-config deps/verifiers deps/renderers deps/research-environments
|
||||
fi
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v4
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push
|
||||
id: build
|
||||
uses: docker/build-push-action@v7
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile.cuda
|
||||
# zstd compresses the multi-GB venv layers several times faster than gzip at a
|
||||
# comparable ratio. No `force-compression`, so base-image layers are reused as-is
|
||||
# rather than needlessly recompressed. Pulling zstd layers needs containerd >= 1.5
|
||||
# or Docker >= 23.
|
||||
outputs: type=image,push=true,compression=zstd,compression-level=3
|
||||
# The per-job builder is ephemeral; mode=max caches builder-stage
|
||||
# layers so warm builds skip the dependency sync.
|
||||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ matrix.suffix }}
|
||||
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ matrix.suffix }},mode=max,image-manifest=true,oci-mediatypes=true,compression=zstd,compression-level=3
|
||||
push: true
|
||||
platforms: ${{ matrix.platform }}
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.prepare.outputs.tag }}-${{ matrix.suffix }}
|
||||
@@ -247,7 +199,7 @@ jobs:
|
||||
packages: write
|
||||
steps:
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v4
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
|
||||
@@ -12,20 +12,20 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v4
|
||||
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/prime-envs deps/pydantic-config
|
||||
git submodule update --init --recursive -- deps/verifiers deps/renderers deps/research-environments deps/pydantic-config
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras --all-packages --locked
|
||||
run: uv sync --extra flash-attn --all-packages --locked
|
||||
- name: Run tests
|
||||
env:
|
||||
USERNAME_CI: CI_RUNNER
|
||||
@@ -48,9 +48,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v4
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
@@ -90,15 +90,20 @@ jobs:
|
||||
assert find_package_resource("templates") is None, "templates should not be in slim wheel"
|
||||
print("slim install OK — configs import with no heavy deps loaded")
|
||||
PY
|
||||
- name: Verify real SFT config (with [slurm]) parses on slim install
|
||||
- name: Verify real configs (with [slurm]) parse on slim install
|
||||
run: |
|
||||
/tmp/slim/bin/python - <<'PY'
|
||||
from pydantic_config import cli
|
||||
from prime_rl.configs.sft import SFTConfig
|
||||
# The slim wheel intentionally excludes taskset packages, so validate a real
|
||||
# SFT config here. RL recipes are covered by the full config suite.
|
||||
from prime_rl.configs.rl import RLConfig
|
||||
# Configs that don't pull in a v1 env package parse on the slim
|
||||
# (prime-rl-configs-only) install: the SFT config has no env sections, and the
|
||||
# reverse_text RL recipe uses a v0 env id (resolved lazily, not imported at parse).
|
||||
# RL configs on a v1 taskset can't parse here because vf.EnvServerConfig imports the
|
||||
# (uninstalled) env package at parse time.
|
||||
for cfg_cls, args in [
|
||||
(SFTConfig, ["@", "configs/ci/slim_sft.toml"]),
|
||||
(SFTConfig, ["@", "examples/reverse_text/slurm_sft.toml"]),
|
||||
(RLConfig, ["@", "examples/reverse_text/rl.toml", "@", "examples/reverse_text/slurm_rl.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@v9
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const { owner, repo } = context.repo;
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
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,15 +26,15 @@ jobs:
|
||||
apt-get install -y git
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v4
|
||||
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/prime-envs deps/pydantic-config
|
||||
git submodule update --init --recursive -- deps/verifiers deps/renderers deps/research-environments deps/pydantic-config
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras --all-packages --locked
|
||||
- name: Run unit tests
|
||||
@@ -84,12 +84,12 @@ jobs:
|
||||
- test: reverse_text_moe
|
||||
runner: vm
|
||||
pytest_args: "tests/integration/test_reverse_text_moe.py"
|
||||
- test: reverse_text_multi_run
|
||||
runner: 4xa6000
|
||||
pytest_args: "tests/integration/test_reverse_text_multi_run.py"
|
||||
- test: benchmark_regression
|
||||
runner: 4xa6000
|
||||
pytest_args: "tests/integration/test_benchmark_regression.py"
|
||||
- test: gsm8k_eval
|
||||
runner: vm
|
||||
pytest_args: "tests/integration/test_gsm8k_eval.py"
|
||||
steps:
|
||||
- name: Install Git
|
||||
run: |
|
||||
@@ -97,15 +97,15 @@ jobs:
|
||||
apt-get install -y git
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v4
|
||||
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/prime-envs deps/pydantic-config
|
||||
git submodule update --init --recursive -- deps/verifiers deps/renderers deps/research-environments deps/pydantic-config
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras --all-packages --locked
|
||||
- name: Run integration tests
|
||||
@@ -121,11 +121,3 @@ 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@v7
|
||||
with:
|
||||
name: ${{ matrix.test }}-logs
|
||||
path: /tmp/outputs/**/*.log
|
||||
retention-days: 7
|
||||
if-no-files-found: ignore
|
||||
|
||||
@@ -1,197 +0,0 @@
|
||||
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)
|
||||
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@v7
|
||||
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@v7
|
||||
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
|
||||
|
||||
# No dispatch input: auto-resolve the newest v*.dev* tag on
|
||||
# GHCR (the point of a nightly is to catch regressions on
|
||||
# tip-of-main). 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 candidates
|
||||
# and verify each with a manifest HEAD via the anonymous
|
||||
# registry token flow; take the newest one that resolves.
|
||||
# Disable pipefail locally: `grep` may exit 1 on no matches
|
||||
# (empty tag list) and `head` may SIGPIPE `sort` after
|
||||
# reading its 10 lines. Both would abort the step before the
|
||||
# explicit no-candidates guard below runs.
|
||||
set +o pipefail
|
||||
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)
|
||||
set -o pipefail
|
||||
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@v10.0.1
|
||||
|
||||
- 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@v7
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: false
|
||||
|
||||
@@ -73,15 +73,15 @@ jobs:
|
||||
apt-get install -y git
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v4
|
||||
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/prime-envs deps/pydantic-config
|
||||
git submodule update --init --recursive -- deps/verifiers deps/renderers deps/research-environments deps/pydantic-config
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
uses: astral-sh/setup-uv@v5
|
||||
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@v7
|
||||
uses: actions/checkout@v4
|
||||
# Submodules are excluded from ruff via pyproject.toml; no need to fetch them.
|
||||
with:
|
||||
submodules: false
|
||||
- name: Run ruff
|
||||
uses: astral-sh/ruff-action@v4.1.0
|
||||
uses: astral-sh/ruff-action@v3
|
||||
with:
|
||||
version: "0.15.14"
|
||||
version: "0.13.0"
|
||||
args: "check --config=pyproject.toml"
|
||||
- name: Run ruff format (check)
|
||||
uses: astral-sh/ruff-action@v4.1.0
|
||||
uses: astral-sh/ruff-action@v3
|
||||
with:
|
||||
version: "0.15.14"
|
||||
version: "0.13.0"
|
||||
args: "format --check --config=pyproject.toml"
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
name: Sync Docs to Public Docs
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'docs/**'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
trigger-docs-sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Validate mint.json pages exist
|
||||
run: |
|
||||
@@ -44,7 +46,7 @@ jobs:
|
||||
echo "All mint.json pages verified."
|
||||
|
||||
- name: Trigger public-docs workflow
|
||||
uses: peter-evans/repository-dispatch@v4
|
||||
uses: peter-evans/repository-dispatch@v3
|
||||
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@v7
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -119,8 +119,6 @@ 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:
|
||||
@@ -129,32 +127,22 @@ 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"
|
||||
|
||||
resolve-release:
|
||||
tag-and-release:
|
||||
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
tag: ${{ steps.release.outputs.tag }}
|
||||
version: ${{ steps.release.outputs.version }}
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout tagged release (dispatch)
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: refs/tags/${{ inputs.tag }}
|
||||
|
||||
- name: Checkout tagged release (push)
|
||||
if: github.event_name != 'workflow_dispatch'
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -206,19 +194,10 @@ jobs:
|
||||
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
|
||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
|
||||
publish-release:
|
||||
needs: resolve-release
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
# Needed to dispatch build_image.yaml below (POST .../dispatches).
|
||||
actions: write
|
||||
steps:
|
||||
- name: Publish draft release
|
||||
id: publish
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TAG: ${{ needs.resolve-release.outputs.tag }}
|
||||
TAG: ${{ steps.release.outputs.tag }}
|
||||
run: |
|
||||
STATE=$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json isDraft --jq '.isDraft' 2>/dev/null || echo "missing")
|
||||
if [ "$STATE" = "missing" ]; then
|
||||
@@ -228,17 +207,6 @@ 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: ${{ needs.resolve-release.outputs.tag }}
|
||||
run: |
|
||||
gh workflow run build_image.yaml --repo "$GITHUB_REPOSITORY" -f ref="$TAG"
|
||||
|
||||
+18
-3
@@ -1,13 +1,26 @@
|
||||
.vscode/*
|
||||
.claude/scheduled_tasks.lock
|
||||
.claude/worktrees/
|
||||
.codex/
|
||||
*.ipynb
|
||||
*.jsonl
|
||||
configs/endpoints.py
|
||||
|
||||
# Run artifacts
|
||||
outputs/
|
||||
# Artifacts
|
||||
**/slurm
|
||||
!src/prime_rl/slurm
|
||||
!examples/slurm
|
||||
!docs/slurm.md
|
||||
**/torchrun
|
||||
**/weights
|
||||
**/checkpoints
|
||||
**/broadcasts
|
||||
**/rollouts
|
||||
**/logs
|
||||
**/wandb
|
||||
**/evals
|
||||
**/run_*/
|
||||
!configs/**/evals
|
||||
final_summary.json
|
||||
.pydantic_config
|
||||
.chroma_db
|
||||
deps/nixl_*
|
||||
@@ -188,4 +201,6 @@ cython_debug/
|
||||
debug_I2_zero_band
|
||||
.idea
|
||||
|
||||
outputs/
|
||||
|
||||
third_party/
|
||||
|
||||
+3
-6
@@ -4,12 +4,9 @@
|
||||
[submodule "renderers"]
|
||||
path = deps/renderers
|
||||
url = git@github.com:PrimeIntellect-ai/renderers.git
|
||||
[submodule "prime-envs"]
|
||||
path = deps/prime-envs
|
||||
url = git@github.com:PrimeIntellect-ai/prime-envs.git
|
||||
[submodule "research-environments"]
|
||||
path = deps/research-environments
|
||||
url = git@github.com:PrimeIntellect-ai/research-environments.git
|
||||
[submodule "pydantic-config"]
|
||||
path = deps/pydantic-config
|
||||
url = https://github.com/PrimeIntellect-ai/pydantic-config
|
||||
[submodule "prime-kernels"]
|
||||
path = deps/prime-kernels
|
||||
url = https://github.com/PrimeIntellect-ai/prime-kernels
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
- **Minimal try/except**: let errors propagate — silent failures hide bugs. Only catch exceptions for intentional fault tolerance (retries, robustness).
|
||||
- **Don't touch `optimization_dtype` / `reduce_dtype`**: never change these model config fields (or their defaults in `trainer.py`) unless the user explicitly asks. They're load-bearing numerical knobs — flipping bfloat16/float32 silently changes training dynamics.
|
||||
- **Targeted comments**: don't explain your work process or reference old code. Use targeted comments sparingly to clarify ambiguous logic.
|
||||
- **Context parallelism**: a module that needs CP state holds a `CPContext` (`models/base.py`) as `self.cp_context`, defaulting to `CPContext()`, which is the non-CP case; `PreTrainedModelPrimeRL` supplies that default. `setup_context_parallel` in `utils/cp.py` builds one `CPContext` and assigns it to every module that has the field, so each module holds the same frozen object.
|
||||
- **Zen of Python**: remember the Zen of Python when writing code.
|
||||
```
|
||||
Beautiful is better than ugly.
|
||||
@@ -32,7 +31,6 @@ Namespaces are one honking great idea -- let's do more of those!
|
||||
## Running code
|
||||
|
||||
- **Always use uv**: run code with `uv run` or `uv run <command>`, never raw `python`.
|
||||
- **Tools vs entrypoints**: standalone scripts in `tools/` use plain argparse with positional args; `[project.scripts]` entrypoints use pydantic-config (`@ file.toml` + dotted CLI overrides).
|
||||
- **Adding dependencies**: add to `pyproject.toml` and run `uv sync --all-extras` to install and lock them.
|
||||
- **Git dependency pins**: when pinning git dependencies in `pyproject.toml`, always use a small (7-char) commit hash for the `rev` field.
|
||||
- **Never edit `.venv/`**: the local virtual env is read-only. Edits there are silently overwritten by the next `uv sync` and don't propagate to teammates or CI. Reading files under `.venv/` to understand library behavior is fine; writing is not. To fix a dependency issue, update `pyproject.toml` (pin a fork via 7-char commit hash if needed), vendor the code into `src/`, or patch upstream.
|
||||
@@ -43,9 +41,9 @@ Namespaces are one honking great idea -- let's do more of those!
|
||||
|
||||
## Skills
|
||||
|
||||
Skills live in `skills/` and are symlinked to `.claude/skills/` (Claude Code) and `.agents/skills/` (Codex). They teach agents how to handle specific workflows (e.g. starting the inference server, writing configs).
|
||||
Skills live in `skills/` and are symlinked to `.claude/skills/`. They teach agents how to handle specific workflows (e.g. starting the inference server, writing configs). When you make changes to the codebase, check if any skills need to be updated to stay accurate.
|
||||
|
||||
If a repository skill could benefit from an update, suggest the specific change, explain why it would help, and ask the user for approval before making it. Wait for approval before creating, modifying, renaming, or deleting skills, including their supporting files and symlinks. If the user has already explicitly requested or approved the skill change, proceed without asking again. Requests to change code, fix workflows, update documentation, or open a PR do not implicitly authorize skill changes. You may read and follow skills without changing them.
|
||||
You are responsible for maintaining the skills folder. When a workflow fails and you fix it – whether with help from the user or through trial and error – you must update the skills to make implicit knowledge explicit. You are also responsible for keeping the skills up to date whenever you or anyone else modifies the code.
|
||||
|
||||
## Testing
|
||||
|
||||
|
||||
+45
-112
@@ -1,21 +1,7 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# ^ `COPY --exclude` (used to split the venv into parallel-compressible layers) needs
|
||||
# Dockerfile syntax >= 1.19; `docker/dockerfile:1` resolves to the latest stable 1.x.
|
||||
|
||||
#inspired from https://github.com/astral-sh/uv-docker-example/blob/main/multistage.Dockerfile
|
||||
|
||||
# Every pyproject.toml + uv.lock, so the dependency sync below caches
|
||||
# independently of source edits.
|
||||
FROM nvidia/cuda:13.0.1-base-ubuntu24.04 AS manifests
|
||||
# .git is ~735 MB, changes every commit, and would land in the registry cache.
|
||||
COPY --exclude=.git . /ctx
|
||||
RUN mkdir -p /manifests \
|
||||
&& cd /ctx \
|
||||
&& find . -name .git -prune -o -type f -name pyproject.toml -exec cp --parents {} /manifests/ \; \
|
||||
&& cp uv.lock /manifests/
|
||||
|
||||
# Build stage - multi-arch base (supports amd64 + arm64)
|
||||
FROM nvidia/cuda:13.0.1-cudnn-devel-ubuntu24.04 AS builder
|
||||
FROM nvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04 AS builder
|
||||
LABEL maintainer="prime intellect"
|
||||
LABEL repository="prime-rl"
|
||||
|
||||
@@ -86,24 +72,11 @@ ENV UV_CACHE_DIR="/usr/local/share/uv/cache"
|
||||
# the runtime stage's `COPY /app`
|
||||
ENV UV_PROJECT_ENVIRONMENT="/app/.venv"
|
||||
|
||||
# Install Python dependencies
|
||||
# Install Python dependencies (The gradual copies help with caching)
|
||||
WORKDIR /app
|
||||
|
||||
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
||||
|
||||
# Third-party deps only — source edits don't bust this layer. First-party
|
||||
# editables install in the source-layer sync below. No build-context bind
|
||||
# mount here: .git would bust the cache every commit.
|
||||
# `--extra dashboard` (fastapi/uvicorn) is baked in so the fft chart's dashboard pod needs no runtime uv sync (see PR body).
|
||||
COPY --from=manifests /manifests /app
|
||||
RUN --mount=type=cache,target=/usr/local/share/uv/cache \
|
||||
uv sync --all-packages --extra gpu --extra dashboard --extra flash-attn --extra flash-attn-3 --extra flash-attn-cute --extra disagg --extra quack --extra kernels --group mamba-ssm --locked --no-dev \
|
||||
--no-install-workspace \
|
||||
--no-install-package prime-rl-configs \
|
||||
--no-install-package verifiers \
|
||||
--no-install-package renderers \
|
||||
--no-install-package prime-pydantic-config
|
||||
|
||||
COPY pyproject.toml /app/pyproject.toml
|
||||
COPY uv.lock /app/uv.lock
|
||||
COPY README.md /app/README.md
|
||||
@@ -112,16 +85,19 @@ 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
|
||||
|
||||
# Use submodule git metadata from the build context when present. Docker copies
|
||||
# only the submodule .git pointer files into /app/deps, so we temporarily link
|
||||
# /app/.git/modules to the read-only context before resolving versions.
|
||||
# Opt-in extras for disaggregated P/D inference (deep-ep, deep-gemm, quack).
|
||||
# Default off — they're heavy source builds only the disagg-MoE path needs.
|
||||
# Enable via `--build-arg INCLUDE_DISAGG_EXTRAS=1`.
|
||||
ARG INCLUDE_DISAGG_EXTRAS=0
|
||||
ARG VERIFIERS_PRETEND_VERSION
|
||||
ARG RENDERERS_PRETEND_VERSION
|
||||
RUN --mount=type=cache,target=/usr/local/share/uv/cache \
|
||||
RUN --mount=type=cache,target=/app/.cache/uv \
|
||||
--mount=type=bind,source=.,target=/build-context,readonly \
|
||||
if [ -d /build-context/.git/modules ]; then mkdir -p /app/.git && ln -s /build-context/.git/modules /app/.git/modules; fi \
|
||||
&& \
|
||||
@@ -133,44 +109,33 @@ RUN --mount=type=cache,target=/usr/local/share/uv/cache \
|
||||
&& \
|
||||
sed -i "s/fallback-version = \"0.0.0\"/fallback-version = \"${RENDERERS_PRETEND_VERSION}\"/" /app/deps/renderers/pyproject.toml \
|
||||
&& \
|
||||
uv sync --all-packages --extra gpu --extra dashboard --extra flash-attn --extra flash-attn-3 --extra flash-attn-cute --extra disagg --extra quack --extra kernels --group mamba-ssm --locked --no-dev \
|
||||
EXTRA_DISAGG_FLAG=""; if [ "$INCLUDE_DISAGG_EXTRAS" = "1" ]; then EXTRA_DISAGG_FLAG="--extra disagg"; fi \
|
||||
&& \
|
||||
/app/.venv/bin/python -c 'from importlib.metadata import version; [version(name) for name in ("deep-ep", "deep-gemm", "mamba-ssm", "nixl", "prime-kernels", "quack-kernels", "vllm", "vllm-router")]'
|
||||
uv sync --all-packages --extra flash-attn --extra flash-attn-3 --extra flash-attn-cute --extra gpt-oss --extra modelexpress $EXTRA_DISAGG_FLAG --group mamba-ssm --locked --no-dev
|
||||
|
||||
# Build NIXL from source against the UCX 1.19 baked above. The PyPI nixl wheel
|
||||
# ships its own UCX which segfaults on prefill→decode KV transfer (#2883);
|
||||
# rebuilding against our UCX is the documented fix. The rename is required: an
|
||||
# unrenamed source build is `nixl_cu12`, and the `nixl` shim imports nixl_cu13
|
||||
# (the PyPI wheel) first, so the fix would silently not apply. Libraries carry
|
||||
# RUNPATH=/opt/ucx/lib, so no LD_LIBRARY_PATH is needed at runtime.
|
||||
# Opt out via `--build-arg INCLUDE_NIXL_FROM_SOURCE=0`.
|
||||
#
|
||||
# NIXL's [build-system] requires are unpinned, so pip's build isolation picks up
|
||||
# new backends as they are released. meson-python 0.22.0 stopped keeping Meson's
|
||||
# build RPATH in wheel libraries, which dropped RUNPATH=/opt/ucx/lib and failed
|
||||
# the linkage check below on every build. Pin the validated backend.
|
||||
ARG INCLUDE_NIXL_FROM_SOURCE=1
|
||||
# Optional: build NIXL from source against the UCX 1.19 baked above. The PyPI
|
||||
# nixl wheel ships its own UCX which segfaults on prefill→decode KV transfer
|
||||
# (#2883); rebuilding against our UCX is the documented fix. Only needed for
|
||||
# the disaggregated P/D path — default off so training-only / single-node
|
||||
# inference builds are unaffected. Enable via `--build-arg INCLUDE_NIXL_FROM_SOURCE=1`.
|
||||
ARG INCLUDE_NIXL_FROM_SOURCE=0
|
||||
ARG NIXL_VERSION=0.10.1
|
||||
RUN if [ "$INCLUDE_NIXL_FROM_SOURCE" = "1" ]; then \
|
||||
VIRTUAL_ENV=/app/.venv uv pip install pip \
|
||||
&& git clone --depth 1 --branch ${NIXL_VERSION} https://github.com/ai-dynamo/nixl.git /tmp/nixl \
|
||||
&& cd /tmp/nixl \
|
||||
&& uv run --no-project --with tomlkit python contrib/tomlutil.py --wheel-name nixl-cu13 pyproject.toml \
|
||||
&& printf 'meson-python==0.21.1\n' > /tmp/nixl-build-constraints.txt \
|
||||
&& PKG_CONFIG_PATH=/opt/ucx/lib/pkgconfig \
|
||||
/app/.venv/bin/python -m pip wheel . --no-deps --wheel-dir=/tmp/nixl-whl \
|
||||
--build-constraint /tmp/nixl-build-constraints.txt \
|
||||
&& VIRTUAL_ENV=/app/.venv uv pip install --reinstall --no-deps /tmp/nixl-whl/nixl_cu13-*.whl \
|
||||
&& PLUGIN=/app/.venv/lib/python3.12/site-packages/.nixl_cu13.mesonpy.libs/plugins/libplugin_UCX.so \
|
||||
&& if ! ldd "$PLUGIN" | grep -q /opt/ucx/lib/libucp.so; then \
|
||||
echo "ERROR: $PLUGIN does not link /opt/ucx/lib. RUNPATH and ldd output:" >&2; \
|
||||
readelf -d "$PLUGIN" | grep -E 'RUNPATH|RPATH' >&2 || true; \
|
||||
ldd "$PLUGIN" >&2; \
|
||||
exit 1; \
|
||||
fi \
|
||||
&& rm -rf /tmp/nixl /tmp/nixl-whl /tmp/nixl-build-constraints.txt; \
|
||||
LD_LIBRARY_PATH=/opt/ucx/lib:/opt/ucx/lib/ucx \
|
||||
/app/.venv/bin/python -m pip wheel . --no-deps --wheel-dir=/app/deps \
|
||||
&& VIRTUAL_ENV=/app/.venv uv pip install --reinstall --no-deps /app/deps/nixl_cu12-*.whl \
|
||||
&& rm -rf /tmp/nixl /app/deps/nixl_cu12-*.whl; \
|
||||
fi
|
||||
|
||||
# arm64: build flash-attn from source, fix namespace conflicts, apply workarounds
|
||||
ARG TARGETARCH
|
||||
COPY scripts/docker-arm64-post-install.sh /app/scripts/docker-arm64-post-install.sh
|
||||
RUN if [ "$TARGETARCH" = "arm64" ]; then /app/scripts/docker-arm64-post-install.sh; fi
|
||||
|
||||
# Trim the CUDA toolkit to the nvcc-JIT essentials in a separate stage, so the runtime
|
||||
# COPY ships only the trimmed result (~1.5 GB) instead of the full ~6.6 GB. Drops the math
|
||||
# runtime libs (cublas/cusparse/cufft/cusolver/curand/npp/nvjpeg) and big static .a
|
||||
@@ -178,14 +143,19 @@ RUN if [ "$INCLUDE_NIXL_FROM_SOURCE" = "1" ]; then \
|
||||
# (uses pinned nvidia-* wheels) needs them. Keeps nvcc/nvvm/ptxas + headers +
|
||||
# libcudart/libnvrtc/libcudadevrt for JIT compile+link.
|
||||
FROM builder AS cuda-trim
|
||||
RUN find /usr/local/cuda-13.0/targets/*/lib \
|
||||
RUN find /usr/local/cuda-12.8/targets/*/lib \
|
||||
\( -name 'libcublas*' -o -name 'libcusparse*' -o -name 'libcufft*' \
|
||||
-o -name 'libcusolver*' -o -name 'libcurand*' -o -name 'libnpp*' \
|
||||
-o -name 'libnvjpeg*' -o -name 'libnvblas*' \) -delete \
|
||||
&& find /usr/local/cuda-13.0 -name '*.a' ! -name 'libcudadevrt.a' ! -name 'libcudart_static.a' -delete
|
||||
&& find /usr/local/cuda-12.8 -name '*.a' ! -name 'libcudadevrt.a' ! -name 'libcudart_static.a' -delete
|
||||
|
||||
# CUDA 13 runtime libs source
|
||||
FROM nvidia/cuda:13.0.1-runtime-ubuntu24.04 AS cuda13
|
||||
RUN mkdir -p /cu13 && cp -d $(find /usr/local \
|
||||
-name 'libcudart.so.13*' -o -name 'libnvrtc.so.13*' -o -name 'libnvrtc-builtins.so.13*') /cu13/
|
||||
|
||||
# Runtime image
|
||||
FROM nvidia/cuda:13.0.1-base-ubuntu24.04
|
||||
FROM nvidia/cuda:12.8.1-base-ubuntu24.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
@@ -215,43 +185,24 @@ RUN apt-get update && apt-get install -y \
|
||||
libibverbs1 \
|
||||
ibverbs-providers \
|
||||
librdmacm1 \
|
||||
libhwloc15 \
|
||||
&& ln -sf /usr/bin/python3.12 /usr/local/bin/python \
|
||||
&& apt-get clean autoclean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# AWS EFA userspace stack: libfabric + the aws-ofi-nccl NCCL net plugin,
|
||||
# installed as one version-matched unit via AWS's official installer rather
|
||||
# than picking versions by hand. Do not substitute a host-mounted copy of
|
||||
# these libraries instead of building them in -- symbol-version mismatches
|
||||
# between a host's rdma-core and a container's can silently break the NCCL
|
||||
# plugin. Run directly in this stage (not a separate one COPY'd in after):
|
||||
# the installer's own apt-get/dpkg step upgrades system rdma-core packages
|
||||
# (libibverbs, ibverbs-providers, librdmacm) in place to versions libfabric
|
||||
# actually links against -- copying only /opt/amazon out of an isolated
|
||||
# stage leaves that system-wide upgrade behind, so libfabric ends up paired
|
||||
# with whatever older rdma-core this image's own apt install pulled in and
|
||||
# fails to load (symbol version mismatch on libefa.so.1). --skip-kmod:
|
||||
# containers share the host kernel and must never build/load a kernel
|
||||
# module themselves; the EFA driver is expected to already be present on
|
||||
# the host. --skip-limit-conf: ulimits config doesn't apply inside a build.
|
||||
ARG EFA_INSTALLER_VERSION=1.47.0
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates tar gzip \
|
||||
&& curl -fsSL "https://efa-installer.amazonaws.com/aws-efa-installer-${EFA_INSTALLER_VERSION}.tar.gz" \
|
||||
-o /tmp/aws-efa-installer.tar.gz \
|
||||
&& tar -xzf /tmp/aws-efa-installer.tar.gz -C /tmp \
|
||||
&& cd /tmp/aws-efa-installer \
|
||||
&& ./efa_installer.sh -y --skip-kmod --skip-limit-conf \
|
||||
&& cd / && rm -rf /tmp/aws-efa-installer.tar.gz /tmp/aws-efa-installer \
|
||||
&& apt-get clean autoclean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# CUDA 13.0 toolkit (TileLang's runtime nvcc JIT)
|
||||
COPY --from=cuda-trim /usr/local/cuda-13.0 /usr/local/cuda-13.0
|
||||
RUN ln -sfn /usr/local/cuda-13.0 /usr/local/cuda && test -x /usr/local/cuda/bin/nvcc
|
||||
# CUDA 12.8 toolkit (TileLang's runtime nvcc JIT)
|
||||
COPY --from=cuda-trim /usr/local/cuda-12.8 /usr/local/cuda-12.8
|
||||
RUN ln -sfn /usr/local/cuda-12.8 /usr/local/cuda && test -x /usr/local/cuda/bin/nvcc
|
||||
ENV CUDA_HOME=/usr/local/cuda
|
||||
ENV PATH="/usr/local/cuda/bin:${PATH}"
|
||||
|
||||
# CUDA 13 runtime libs for deep-gemm
|
||||
COPY --from=cuda13 /cu13/ /opt/cuda13/lib64/
|
||||
RUN echo /opt/cuda13/lib64 > /etc/ld.so.conf.d/cuda13.conf \
|
||||
&& ldconfig \
|
||||
&& ldconfig -p | grep -q libcudart.so.13 \
|
||||
&& ldconfig -p | grep -q libnvrtc.so.13
|
||||
|
||||
|
||||
ARG USER_ID=1000
|
||||
ARG GROUP_ID=1000
|
||||
|
||||
@@ -269,32 +220,14 @@ RUN INSTALLER_NO_MODIFY_PATH=1 UV_INSTALL_DIR="/usr/local/bin" sh /uv-installer.
|
||||
USER appuser
|
||||
ENV PATH="/usr/local/bin:$PATH"
|
||||
WORKDIR /app
|
||||
# Copy the application from the builder, splitting the venv's largest trees into their
|
||||
# own layers. BuildKit compresses and pushes layers in parallel, so shipping the whole
|
||||
# ~20 GB venv as one layer serialized the export behind a single compressor. Splitting
|
||||
# also lets nodes pull the image in parallel. Keep the excludes below in sync with the
|
||||
# per-tree copies above, or the data lands in the image twice.
|
||||
# The volatile /app remainder goes last so a source edit re-pushes one layer,
|
||||
# not all of them.
|
||||
COPY --from=builder --chown=appuser:appuser /app/.venv/lib/python3.12/site-packages/nvidia /app/.venv/lib/python3.12/site-packages/nvidia
|
||||
COPY --from=builder --chown=appuser:appuser /app/.venv/lib/python3.12/site-packages/torch /app/.venv/lib/python3.12/site-packages/torch
|
||||
COPY --from=builder --chown=appuser:appuser /app/.venv/lib/python3.12/site-packages/vllm /app/.venv/lib/python3.12/site-packages/vllm
|
||||
COPY --from=builder --chown=appuser:appuser /app/.venv/lib/python3.12/site-packages/flash_attn /app/.venv/lib/python3.12/site-packages/flash_attn
|
||||
COPY --from=builder --chown=appuser:appuser /app/.venv/lib/python3.12/site-packages/flash_attn_2_cuda*.so /app/.venv/lib/python3.12/site-packages/
|
||||
# Copy the application from the builder
|
||||
COPY --from=builder --chown=appuser:appuser /app /app
|
||||
COPY --from=builder /opt/ucx /opt/ucx
|
||||
|
||||
# Copy and set up entrypoint script
|
||||
COPY --chown=appuser:appuser scripts/docker-entrypoint.sh /app/docker-entrypoint.sh
|
||||
RUN chmod +x /app/docker-entrypoint.sh
|
||||
|
||||
COPY --from=builder --chown=appuser:appuser \
|
||||
--exclude=.venv/lib/python3.12/site-packages/nvidia \
|
||||
--exclude=.venv/lib/python3.12/site-packages/torch \
|
||||
--exclude=.venv/lib/python3.12/site-packages/vllm \
|
||||
--exclude=.venv/lib/python3.12/site-packages/flash_attn \
|
||||
--exclude=.venv/lib/python3.12/site-packages/flash_attn_2_cuda*.so \
|
||||
/app /app
|
||||
|
||||
# Place executables in the environment at the front of the path
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
ENV UCX_HOME=/opt/ucx
|
||||
|
||||
@@ -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/advanced/glm-5.3/).
|
||||
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).
|
||||
|
||||
|
||||
## Models support
|
||||
@@ -53,13 +53,15 @@ 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#multimodal-training) (`qwen3_vl`, `qwen3_5`, `qwen3_5_moe`) | MoE only on MoE VLMs | MoE only | ✅ |
|
||||
| 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 | ✅ |
|
||||
| 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 | ✅ | ✅ |
|
||||
| Trinity (`afmoe`) | `arcee-ai/Trinity-Mini`, … | yes | ✅ | ✅ |
|
||||
| GLM-4 · GLM-4.5 MoE · INTELLECT-3 (`glm4_moe`) | `THUDM/GLM-4-9B-0414`, `zai-org/GLM-4.5-Air`, `zai-org/GLM-4.5`, `PrimeIntellect/INTELLECT-3`, … | yes | ✅ | ✅ |
|
||||
| GPT-OSS (`gpt_oss`) | `unsloth/gpt-oss-20b-BF16`, … | yes | ✅ | ✅ |
|
||||
| GPT-OSS (HF, MoE) | `openai/gpt-oss-20b`, `openai/gpt-oss-120b` | yes | ✅ | ✅ |
|
||||
| Other HF causal LMs | Qwen3 dense, Mistral, … (`impl = "hf"`) | varies | ❌ | ✅ |
|
||||
|
||||
|
||||
## Setup
|
||||
|
||||
@@ -67,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
|
||||
@@ -93,7 +95,7 @@ cd prime-rl
|
||||
2. Initialize submodules
|
||||
|
||||
```bash
|
||||
git submodule update --init -- deps/verifiers deps/renderers deps/prime-envs deps/pydantic-config
|
||||
git submodule update --init -- deps/verifiers deps/renderers deps/research-environments deps/pydantic-config
|
||||
```
|
||||
|
||||
3. Install [uv](https://docs.astral.sh/uv/)
|
||||
@@ -111,6 +113,24 @@ uv sync --all-extras
|
||||
|
||||
> *NOTE*: Environments are opt-in uv workspace members — `uv sync --all-extras` does not install them. To train on them, install all with `uv sync --all-extras --all-packages`, or a subset with `uv sync --package prime-rl --package <env>`.
|
||||
|
||||
4.1. On aarch64 hosts: build flash-attn from source for your GPU
|
||||
|
||||
> *NOTE*: aarch64 has no prebuilt flash-attn wheel. This step compiles the CUDA extension for your local GPU (~20-30 minutes). Compute capability is auto-detected from `nvidia-smi`; override with `TORCH_CUDA_ARCH_LIST=9.0` (Hopper) / `10.0` (Blackwell) if needed.
|
||||
> *NOTE*: After this step, you can't run `uv sync --all-extras` or `uv run` as it will uninstall the package, you can avoid it by running `uv sync --inexact` or `uv run --no-sync`.
|
||||
|
||||
```bash
|
||||
bash scripts/docker-arm64-post-install.sh
|
||||
```
|
||||
|
||||
3.1. Optional: Install Flash Attention 3 (on Hopper GPUs only, for flash_attention_3 attention backend)
|
||||
|
||||
> *NOTE*: This step will take a while, as it builds the Flash Attention 3 extension from source, as it has no wheels prebuilt.
|
||||
> *NOTE*: After this step, you can't run `uv sync --all-extras` or `uv run` as it will uninstall the package, you can avoid it by running `uv sync --inexact` or `uv run --no-sync`
|
||||
|
||||
```bash
|
||||
uv pip install "flash-attn-3 @ git+https://github.com/Dao-AILab/flash-attention.git@main#subdirectory=hopper" --no-build-isolation
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
@@ -134,19 +154,33 @@ 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/fake/sft.toml
|
||||
uv run sft @ configs/debug/sft/train.toml
|
||||
```
|
||||
|
||||
4. Check that you can run the inference server (*this requires 1 GPU*)
|
||||
4. Check that you can run the RL trainer (*this requires 1 GPU*)
|
||||
|
||||
```bash
|
||||
uv run inference --vllm.model Qwen/Qwen3-0.6B
|
||||
uv run trainer @ configs/debug/rl/train.toml
|
||||
```
|
||||
|
||||
5. Check that the full RL stack (inference + orchestrator + trainer) runs end-to-end (*this requires 2 GPUs*)
|
||||
5. Check that you can run the inference server (*this requires 1 GPU*)
|
||||
|
||||
```bash
|
||||
uv run rl @ examples/basic/reverse-text/rl.toml
|
||||
uv run inference @ configs/debug/infer.toml
|
||||
```
|
||||
|
||||
*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
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -172,34 +206,36 @@ 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/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.
|
||||
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.
|
||||
|
||||
### Advanced Training: 32 - 2048 GPUs:
|
||||
|
||||
Follow this guide to train large models on hard reasoning and agentic tasks.
|
||||
Follow this guide to train large models on hard reasoning and agentic / swe environments.
|
||||
These guides are designed to be run from a Slurm cluster but can also be adapted to k8s deployments.
|
||||
|
||||
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. [**GLM-5**](examples/advanced/glm-5.3/): Large-scale `GLM-5`/`GLM-5.3` training with P/D disaggregation, the `llm-d` router, and FP8.
|
||||
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`.
|
||||
|
||||
## 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
|
||||
- [**Training**](docs/training.md) - RL, SFT, checkpointing, observability, rules of thumb
|
||||
- [**Eval**](docs/eval.md) - Standalone evals against any inference server, online evals, resume, platform upload
|
||||
- [**Training**](docs/training.md) - RL, SFT, evals, checkpointing, observability, rules of thumb
|
||||
- [**Scaling**](docs/scaling.md) - Single-GPU through multi-node, FSDP/EP/CP, SLURM, benchmarking
|
||||
- [**Algorithms**](docs/algorithms.md) - Async/off-policy training, the AIPO loss, advantage and filter plugins, trajectory merging
|
||||
- [**Advanced**](docs/advanced.md) - Custom modeling, multimodal training, LoRA
|
||||
- [**Advanced**](docs/advanced.md) - Custom modeling, multimodal training, LoRA, multi-tenant training
|
||||
- [**Development**](docs/development.md) - Test suite, pre-commit hooks, adding a new model
|
||||
|
||||
## Contributing
|
||||
@@ -240,7 +276,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}
|
||||
}
|
||||
|
||||
+20
-23
@@ -6,46 +6,43 @@
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"selective_targets": null,
|
||||
"attention": "flash_attention_2",
|
||||
"output": "benchmarks/baselines/benchmark-1xa6000-Qwen--Qwen3-0.6B-rl-full-1gpu-Recompute-flash_attention_2-65536-cp1-ep1.json",
|
||||
"output": "benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 600,
|
||||
"max_steps": 4,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"ep": 1,
|
||||
"cp": 1,
|
||||
"fused_lm_head_token_chunk_size": 1024,
|
||||
"docker_image": null,
|
||||
"device_name": "NVIDIA RTX A6000",
|
||||
"commit_sha": "7007d2ef",
|
||||
"timestamp": "2026-08-29T02:35:31.543870+00:00",
|
||||
"commit_sha": "c88d08fdf",
|
||||
"timestamp": "2026-06-24T22:50:40+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 295.5118532651104
|
||||
"time_taken": 276.12556480802596
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 16.701924322664684,
|
||||
"std": 0.0999595293790186,
|
||||
"min": 16.586575698092034,
|
||||
"max": 16.763194274056005
|
||||
"mean": 20.802552047875178,
|
||||
"std": 0.16199364988631793,
|
||||
"min": 20.664358307416567,
|
||||
"max": 20.98082222151257
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 1994.6806480062144,
|
||||
"std": 11.937986005933869,
|
||||
"min": 1980.9047701633856,
|
||||
"max": 2001.998007610024
|
||||
"mean": 2484.411208996455,
|
||||
"std": 19.346608946709658,
|
||||
"min": 2467.9069802355616,
|
||||
"max": 2505.7016937694384
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 65.74198961785685,
|
||||
"std": 0.3962098986964774,
|
||||
"min": 65.49867434287444,
|
||||
"max": 66.19917749473825
|
||||
"mean": 52.79691480938345,
|
||||
"std": 0.4071756223542672,
|
||||
"min": 52.35017399210483,
|
||||
"max": 53.14720633160323
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 11.591145833333334,
|
||||
"pct": 24.45296844104
|
||||
"gib": 11.728515625,
|
||||
"pct": 24.742767157118376
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+20
-23
@@ -6,46 +6,43 @@
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"selective_targets": null,
|
||||
"attention": "flash_attention_2",
|
||||
"output": "benchmarks/baselines/benchmark-4xa6000-Qwen--Qwen3-0.6B-rl-full-4gpu-Recompute-flash_attention_2-65536-cp1-ep1.json",
|
||||
"output": "benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 600,
|
||||
"max_steps": 4,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"ep": 1,
|
||||
"cp": 1,
|
||||
"fused_lm_head_token_chunk_size": 1024,
|
||||
"docker_image": null,
|
||||
"device_name": "NVIDIA RTX A6000",
|
||||
"commit_sha": "7007d2ef",
|
||||
"timestamp": "2026-08-29T02:28:40.728120+00:00",
|
||||
"commit_sha": "c88d08fdf",
|
||||
"timestamp": "2026-06-24T22:55:54+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 317.33935201819986
|
||||
"time_taken": 291.91085167229176
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 15.880248465863398,
|
||||
"std": 0.005915779562921215,
|
||||
"min": 15.873443653590638,
|
||||
"max": 15.884167926432548
|
||||
"mean": 17.217465998339005,
|
||||
"std": 0.02905058130694137,
|
||||
"min": 17.19503698271855,
|
||||
"max": 17.250282374540514
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 7586.197539502296,
|
||||
"std": 2.826043462792163,
|
||||
"min": 7582.946793757898,
|
||||
"max": 7588.069915881657
|
||||
"mean": 8225.003435798719,
|
||||
"std": 13.877833769765575,
|
||||
"min": 8214.288808538377,
|
||||
"max": 8240.68023789224
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 69.21047159920757,
|
||||
"std": 0.022114607283211834,
|
||||
"min": 69.19065106380731,
|
||||
"max": 69.234325167723
|
||||
"mean": 63.90305413212627,
|
||||
"std": 0.11015530079183487,
|
||||
"min": 63.77801387012005,
|
||||
"max": 63.985770548693836
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 8.55078125,
|
||||
"pct": 18.038939985655993
|
||||
"gib": 6.298828125,
|
||||
"pct": 13.288163877053583
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,18 +2,15 @@
|
||||
"""
|
||||
Run a single benchmark configuration and output JSON results.
|
||||
|
||||
This script runs a normal short training (--max-steps) with the file monitor
|
||||
enabled and aggregates throughput / MFU / step time / peak memory from the
|
||||
run's metrics.jsonl.
|
||||
This script wraps the prime-rl training with --bench.output-json to get
|
||||
metrics directly without parsing console output.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import statistics
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
@@ -23,7 +20,6 @@ import torch
|
||||
from pydantic import Field
|
||||
|
||||
from prime_rl.utils.config import BaseConfig, cli
|
||||
from prime_rl.utils.pathing import get_file_monitor_dir
|
||||
|
||||
MAX_LORAS = 4
|
||||
|
||||
@@ -71,6 +67,11 @@ class BenchmarkConfig(BaseConfig):
|
||||
Field(description="Activation checkpointing type"),
|
||||
] = "Recompute"
|
||||
|
||||
selective_targets: Annotated[
|
||||
list[str] | None,
|
||||
Field(description="Selective activation checkpoint targets when ac=Selective"),
|
||||
] = None
|
||||
|
||||
attention: Annotated[
|
||||
Literal["sdpa", "flash_attention_2", "flash_attention_3", "flash_attention_4"],
|
||||
Field(description="Attention implementation"),
|
||||
@@ -82,8 +83,6 @@ class BenchmarkConfig(BaseConfig):
|
||||
|
||||
timeout: Annotated[int, Field(description="Timeout in seconds")] = 3600
|
||||
|
||||
max_steps: Annotated[int, Field(ge=2, description="Training steps to run. The first step is warmup.")] = 4
|
||||
|
||||
micro_batches: Annotated[int, Field(ge=1, description="Number of micro batches")] = 2
|
||||
|
||||
ep: Annotated[int, Field(ge=1, description="Expert parallelism size (1 = no EP)")] = 1
|
||||
@@ -116,7 +115,7 @@ class BenchmarkConfig(BaseConfig):
|
||||
] = None
|
||||
|
||||
|
||||
def build_command(config: BenchmarkConfig, output_dir: Path) -> list[str]:
|
||||
def build_command(config: BenchmarkConfig) -> list[str]:
|
||||
"""Build the benchmark command from config."""
|
||||
# Determine training script
|
||||
if config.type == "rl":
|
||||
@@ -138,24 +137,20 @@ def build_command(config: BenchmarkConfig, output_dir: Path) -> list[str]:
|
||||
str(config.seq_len),
|
||||
"--model.attn",
|
||||
config.attention,
|
||||
"--max-steps",
|
||||
str(config.max_steps),
|
||||
"--output-dir",
|
||||
str(output_dir),
|
||||
"--monitors.file.path",
|
||||
"metrics.jsonl",
|
||||
"--bench.output-json",
|
||||
str(config.output),
|
||||
"--model.compile",
|
||||
"--dist-timeout-seconds",
|
||||
str(config.timeout),
|
||||
]
|
||||
if config.type == "sft":
|
||||
cmd.extend(["--run.name", "bench"])
|
||||
|
||||
# Add activation checkpointing if enabled
|
||||
if config.ac == "Recompute":
|
||||
cmd.append("--model.ac")
|
||||
elif config.ac == "Selective":
|
||||
cmd.extend(["--model.ac", "--model.ac.mode", "selective"])
|
||||
if config.selective_targets:
|
||||
cmd.extend(["--model.ac.targets", json.dumps(config.selective_targets)])
|
||||
elif config.ac == "Offload":
|
||||
cmd.append("--model.ac-offloading")
|
||||
|
||||
@@ -203,65 +198,14 @@ def dummy_metrics() -> dict:
|
||||
}
|
||||
|
||||
|
||||
def aggregate_metrics(metrics_path: Path) -> dict:
|
||||
"""Aggregate per-step metrics from a run's metrics.jsonl.
|
||||
|
||||
Each metrics.jsonl line is one monitor.log call (``{"step": N, ...}``);
|
||||
merge the lines per step, drop the first (warmup) step, and compute
|
||||
mean/std/min/max per metric like the old --bench JSON export did. Rows
|
||||
keyed by wall time rather than step (``step: null``) are not per-step and
|
||||
are skipped.
|
||||
"""
|
||||
per_step: dict[int, dict] = {}
|
||||
with open(metrics_path) as f:
|
||||
for line in f:
|
||||
row = json.loads(line)
|
||||
if row.get("step") is not None:
|
||||
per_step.setdefault(row["step"], {}).update(row)
|
||||
|
||||
steps = sorted(per_step)[1:] # Exclude first warmup step
|
||||
columns = {
|
||||
"perf/mfu": "mfu",
|
||||
"perf/throughput": "throughput",
|
||||
"time/step": "step_time",
|
||||
"perf/peak_memory": "peak_memory",
|
||||
}
|
||||
series = {name: [per_step[step][key] for step in steps] for key, name in columns.items()}
|
||||
|
||||
def stats(values: list[float]) -> dict:
|
||||
return {
|
||||
"mean": statistics.mean(values),
|
||||
"std": statistics.stdev(values) if len(values) > 1 else 0.0,
|
||||
"min": min(values),
|
||||
"max": max(values),
|
||||
}
|
||||
|
||||
total_memory_gib = torch.cuda.mem_get_info()[1] / 1024**3
|
||||
peak_memory_gib = statistics.mean(series["peak_memory"])
|
||||
return {
|
||||
"mfu": stats(series["mfu"]),
|
||||
"throughput": stats(series["throughput"]),
|
||||
"step_time": stats(series["step_time"]),
|
||||
"peak_memory": {
|
||||
"gib": peak_memory_gib,
|
||||
"pct": peak_memory_gib / total_memory_gib * 100,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def run_benchmark(config: BenchmarkConfig) -> None:
|
||||
"""Run a single benchmark and write results to output path."""
|
||||
output_dir = Path(tempfile.mkdtemp(prefix="benchmark-run-"))
|
||||
cmd = build_command(config, output_dir)
|
||||
cmd = build_command(config)
|
||||
print(f"Running: {' '.join(cmd)}")
|
||||
|
||||
if config.dry_run:
|
||||
return
|
||||
|
||||
# The SFT entrypoint writes to output_dir/<run.name>, the RL trainer to output_dir directly
|
||||
run_dir = output_dir / "bench" if config.type == "sft" else output_dir
|
||||
metrics_path = get_file_monitor_dir(run_dir) / "metrics.jsonl"
|
||||
|
||||
start_time = time.perf_counter()
|
||||
try:
|
||||
config.output.parent.mkdir(parents=True, exist_ok=True)
|
||||
@@ -277,13 +221,14 @@ def run_benchmark(config: BenchmarkConfig) -> None:
|
||||
config.success = False
|
||||
config.error_reason = extract_oom_error_reason(output) or f"Non-zero exit code: {result.returncode}"
|
||||
print(f"Process exited with code {result.returncode}: {output}")
|
||||
if not metrics_path.exists():
|
||||
if not config.output.exists():
|
||||
config.success = False
|
||||
config.error_reason = config.error_reason or extract_oom_error_reason(output) or "No metrics.jsonl written"
|
||||
config.error_reason = config.error_reason or extract_oom_error_reason(output) or "No JSON output written"
|
||||
print(f"Process exited with code {result.returncode}: {output}")
|
||||
print("Benchmark completed but no metrics.jsonl was written")
|
||||
print("Benchmark completed but no JSON output was written")
|
||||
else:
|
||||
metrics = aggregate_metrics(metrics_path)
|
||||
with open(config.output) as f:
|
||||
metrics = json.load(f)
|
||||
lines = output.splitlines()
|
||||
print("\n".join(lines))
|
||||
except subprocess.TimeoutExpired:
|
||||
|
||||
+1
-18
@@ -1,20 +1,3 @@
|
||||
# Configs
|
||||
|
||||
Configurations for running prime-rl.
|
||||
|
||||
- **[`advanced/`](advanced)** — frontier-model training configs without launch walkthroughs:
|
||||
`minimax-m2.5` (swe), `nemotron-3-super` (swe), `deepseek-v4-flash` (sft + a standalone
|
||||
vLLM serving pre-flight). For the tutorialized equivalents, see
|
||||
[`examples/advanced/`](../examples/advanced).
|
||||
- **`ci/`** — integration and nightly configs used by CI.
|
||||
- **`debug/`** — throwaway configs for developing the framework itself: `algo/`
|
||||
(per-algorithm smokes), `fake/` (fake-data trainer/SFT smokes), and
|
||||
`eval/` (`uv run eval` smokes against Prime Inference, one per shape: `single-turn`
|
||||
(gsm8k), `multi-turn` (terminal-bench-2 fix-git in sandboxes against a local vLLM deployment with the adaptive band), `resume`, `multi-env`).
|
||||
Not guaranteed functional or up to date.
|
||||
|
||||
```bash
|
||||
uv run rl @ configs/debug/algo/<algo>.toml
|
||||
uv run sft @ configs/debug/fake/sft.toml
|
||||
uv run eval @ configs/debug/eval/<shape>.toml
|
||||
```
|
||||
This directory contains configurations for internal experiments. We do not guarantee that these configurations are functional or up-to-date.
|
||||
@@ -1,35 +0,0 @@
|
||||
# Standalone vLLM serving pre-flight: does this cluster's vLLM serve the real DeepSeek V4 Flash
|
||||
# checkpoint at all, independent of the trainer? Uses vLLM's own native DeepSeek V4 support, not
|
||||
# this repo's trainer port. Run directly on one allocated 8xH200 node (no [slurm] block):
|
||||
#
|
||||
# uv run inference @ examples/advanced/deepseek-v4-flash/inference.toml
|
||||
#
|
||||
# Then check /health and a /v1/chat/completions request from another shell on the same node, and
|
||||
# confirm a coherent response before trusting the model for a real run.
|
||||
#
|
||||
# Reference: https://recipes.vllm.ai/deepseek-ai/DeepSeek-V4-Flash
|
||||
|
||||
# Mandatory for the fp8 checkpoint, not an optimization: without it the UE8M0-scaled fp8 weights
|
||||
# route to a CUTLASS kernel that crashes on boot. That crash was observed during SM120 bring-up and
|
||||
# has not been re-tested on Hopper, but the vLLM recipe sets the flag on every NVIDIA configuration.
|
||||
# The mHC pre-norm GEMM does not need it on H200: measured there, the TileLang fallback matches the
|
||||
# reference to 1.3e-06 relative at every token count, including the >= 1024 block-M kernel.
|
||||
use_deep_gemm = true
|
||||
|
||||
[server]
|
||||
port = 8000
|
||||
|
||||
[vllm]
|
||||
model = "deepseek-ai/DeepSeek-V4-Flash-0731"
|
||||
tensor_parallel_size = 8
|
||||
enable_expert_parallel = true
|
||||
gpu_memory_utilization = 0.85
|
||||
max_model_len = 8192
|
||||
# Required, not a tuning choice. Every DeepSeek V4 attention class sets
|
||||
# `use_fp8_ds_mla_layout = True`, and the sparse-MLA layout then asserts
|
||||
# "DeepseekV4 fp8_ds_mla layout only supports fp8 kv-cache" against the `auto` default. The vLLM
|
||||
# recipe sets it on every vendor and every architecture.
|
||||
kv_cache_dtype = "fp8"
|
||||
# Recipe-derived rather than measured here: every NVIDIA configuration in the vLLM recipe pairs
|
||||
# the fp8 KV cache with this block size.
|
||||
block_size = 256
|
||||
@@ -1,62 +0,0 @@
|
||||
# Real-data SFT for deepseek-ai/DeepSeek-V4-Flash-0731 at full depth (all 43 layers, no
|
||||
# `debug.num_layers` truncation) on 4 train nodes. Trainer only: no online eval, no inference
|
||||
# node, and so no weight broadcast. Tested on 8xH200.
|
||||
#
|
||||
# uv run sft @ examples/advanced/deepseek-v4-flash/sft.toml --run.name ds-v4-sft-torch-4node
|
||||
#
|
||||
# Note: on 4 8xH200 nodes, this config is near the memory limit, using ~94%+ GPU memory.
|
||||
#
|
||||
# `dist_timeout_seconds = 14400` is needed on any run that has to build the HF -> prime-rl
|
||||
# conversion cache, which takes far longer than the 3600s default.
|
||||
#
|
||||
# To buy memory back for quicker testing on fewer nodes, set `full_offload = true` under `[model]`,
|
||||
# which keeps the fp32 masters, moments and gradients in CPU RAM and needs `optim_cpu_offload =
|
||||
# false` and `optim.max_norm = "None"` set alongside it; the lighter `optim_cpu_offload = true` is
|
||||
# already the default here.
|
||||
#
|
||||
# There is no `[ckpt]` block. The trainer saves unconditionally at the last step, and a 43-layer
|
||||
# checkpoint (fp32 master weights plus two fp32 AdamW moments) is ~3 TiB. Add one with
|
||||
# `ckpt.output_dir` pointed at a volume that can hold it if you need the trained weights.
|
||||
|
||||
dist_timeout_seconds = 14400
|
||||
max_steps = 20
|
||||
|
||||
[model]
|
||||
name = "deepseek-ai/DeepSeek-V4-Flash-0731"
|
||||
impl = "custom"
|
||||
ep = 8
|
||||
|
||||
# Torch all-to-all, not DeepEP. At full depth DeepEP dies on the first backward with
|
||||
# "RuntimeError: Autograd not support dtype: Byte", raised from `Tensor.float()` in
|
||||
# `DeepEPTokenDispatcher.combine` while the activation-checkpoint recompute replays through a
|
||||
# `__torch_dispatch__` mode that hands back a uint8 tensor. Reproduced deterministically on 4
|
||||
# nodes against the same weights and conversion cache this config trains on.
|
||||
[model.moe.dispatch]
|
||||
type = "torch"
|
||||
|
||||
[model.ac]
|
||||
freq = 1
|
||||
|
||||
[model.ac_offloading]
|
||||
max_inflight_activations = 5
|
||||
|
||||
[data]
|
||||
name = "PrimeIntellect/Reverse-Text-SFT"
|
||||
seq_len = 2048
|
||||
batch_size = 32
|
||||
|
||||
[optim]
|
||||
lr = 1e-5
|
||||
|
||||
[monitors.wandb]
|
||||
project = "deepseek-v4-flash"
|
||||
name = "deepseek-v4-flash-sft"
|
||||
|
||||
# `num_infer_nodes` defaults to 0, so this allocates 4 nodes and runs only the trainer.
|
||||
[deployment]
|
||||
type = "multi_node"
|
||||
num_train_nodes = 4
|
||||
|
||||
[slurm]
|
||||
job_name = "ds-v4-sft"
|
||||
partition = "all"
|
||||
@@ -1,114 +0,0 @@
|
||||
max_steps = 1000
|
||||
# 131k context requires 4 train nodes on the optim-offload profile (on 2 nodes the params/grads
|
||||
# baseline stays on GPU and long contexts OOM).
|
||||
seq_len = 131072
|
||||
|
||||
[env_vars]
|
||||
PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
|
||||
|
||||
[slurm]
|
||||
job_name = "nemotron-3-super-swe"
|
||||
partition = "prod"
|
||||
# Nemotron-H needs the mamba-ssm kernels; sync that group, then clear this run's orphaned sandboxes.
|
||||
pre_run_command = 'uv sync --all-extras --all-packages --group mamba-ssm ; timeout 120 prime sandbox delete --label "nemotron-3-super-swe" -y || true'
|
||||
|
||||
[deployment]
|
||||
type = "multi_node"
|
||||
num_train_nodes = 4
|
||||
num_infer_nodes = 1
|
||||
num_infer_replicas = 4
|
||||
|
||||
[monitors.wandb]
|
||||
project = "nemotron-3-super"
|
||||
name = "nemotron-3-super-swe"
|
||||
|
||||
[weight_broadcast]
|
||||
type = "nccl"
|
||||
timeout = 3600
|
||||
|
||||
[ckpt]
|
||||
interval = 50
|
||||
keep_last = 1
|
||||
|
||||
[resume]
|
||||
|
||||
[model]
|
||||
name = "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16"
|
||||
|
||||
[trainer]
|
||||
dist_timeout_seconds = 3600
|
||||
enable_router_replay = true
|
||||
|
||||
[trainer.model]
|
||||
impl = "custom"
|
||||
attn = "flash_attention_3"
|
||||
# Hybrid-Mamba model: ring CP is unsupported, so use ulysses (capped at 8 by n_groups).
|
||||
cp = 8
|
||||
cp_style = "ulysses"
|
||||
ep = 8
|
||||
fused_lm_head_token_chunk_size = 1024
|
||||
|
||||
[trainer.model.ac]
|
||||
|
||||
[trainer.model.ac_offloading]
|
||||
max_inflight_activations = 1
|
||||
|
||||
[trainer.model.compile]
|
||||
|
||||
[trainer.ckpt]
|
||||
skip_optimizer = true
|
||||
|
||||
[trainer.optim]
|
||||
type = "adamw"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
initial_inflight = 1536
|
||||
max_inflight = 1536
|
||||
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.train.algo.length_penalty]
|
||||
type = "linear"
|
||||
num_output_tokens_weight = 0.0
|
||||
num_input_tokens_weight = 0.1
|
||||
num_turns_weight = 0.1
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "nemotron-3"
|
||||
truncate_history_thinking = false
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "scaleswe"
|
||||
env.taskset.id = "scaleswe"
|
||||
env.agent.harness.id = "rlm"
|
||||
env.agent.harness.compaction.summarize_at_tokens = 98304
|
||||
env.agent.runtime.labels = ["nemotron-3-super-swe"]
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 20
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "swebench-verified"
|
||||
env.taskset.id = "swebench-verified"
|
||||
env.agent.harness.id = "rlm"
|
||||
env.agent.harness.compaction.summarize_at_tokens = 98304
|
||||
env.agent.runtime.labels = ["nemotron-3-super-swe"]
|
||||
env.agent.timeout.rollout = 3600
|
||||
|
||||
[inference]
|
||||
# vLLM disables prefix caching by default for hybrid-Mamba models; SWE turns share long prefixes.
|
||||
|
||||
[inference.vllm]
|
||||
max_model_len = 131072
|
||||
tensor_parallel_size = 8
|
||||
enable_prefix_caching = true
|
||||
enable_expert_parallel = true
|
||||
enable_return_routed_experts = true
|
||||
@@ -0,0 +1,36 @@
|
||||
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]]
|
||||
id = "alphabet-sort"
|
||||
name = "alphabet-sort"
|
||||
args = { min_turns = 2, max_turns = 2 }
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 50
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
id = "alphabet-sort"
|
||||
name = "alphabet-sort"
|
||||
num_examples = 50
|
||||
group_size = 4
|
||||
args = { min_turns = 2, max_turns = 2 }
|
||||
|
||||
[trainer]
|
||||
|
||||
[inference]
|
||||
@@ -17,27 +17,15 @@ lr = 1e-5
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 384
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
[[orchestrator.train.env]]
|
||||
id = "alphabet-sort"
|
||||
name = "alphabet-sort"
|
||||
env.taskset.id = "alphabet-sort"
|
||||
env.taskset.min_turns = 2
|
||||
env.taskset.max_turns = 2
|
||||
env.taskset.min_names_per_turn = 1
|
||||
env.taskset.max_names_per_turn = 3
|
||||
env.taskset.task.similarity_power = 4
|
||||
env.taskset.task.power_per_turn = false
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
args = { min_turns = 2, max_turns = 2, min_names_per_turn = 1, max_names_per_turn = 3, similarity_power = 4, power_per_turn = false }
|
||||
|
||||
[inference]
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
# CI eval smoke: gsm8k with the null harness in a local subprocess runtime against
|
||||
# Prime Inference — the eval path end to end without a GPU or sandbox.
|
||||
dashboard = false
|
||||
|
||||
[select]
|
||||
limit = 4
|
||||
|
||||
[sampling]
|
||||
max_completion_tokens = 8192
|
||||
|
||||
[[source]]
|
||||
env.taskset.id = "gsm8k"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
@@ -1,47 +0,0 @@
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[ckpt]
|
||||
|
||||
[resume]
|
||||
step = 15
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 5e-5
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 8
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[orchestrator.model.lora]
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[inference]
|
||||
|
||||
# PrimeIntellect Qwen3 fine-tune - select its renderer explicitly (the -SFT
|
||||
# suffix misses the MODEL_RENDERER_MAP exact match).
|
||||
|
||||
[inference.vllm]
|
||||
enable_lora = true
|
||||
gpu_memory_utilization = 0.7
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
@@ -1,44 +0,0 @@
|
||||
max_steps = 15
|
||||
seq_len = 2048
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 5e-5
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 8
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[orchestrator.model.lora]
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[inference]
|
||||
|
||||
# PrimeIntellect Qwen3 fine-tune - select its renderer explicitly (the -SFT
|
||||
# suffix misses the MODEL_RENDERER_MAP exact match).
|
||||
|
||||
[inference.vllm]
|
||||
enable_lora = true
|
||||
gpu_memory_utilization = 0.7
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
@@ -1,21 +0,0 @@
|
||||
max_steps = 6
|
||||
|
||||
[ckpt]
|
||||
skip_optimizer = true
|
||||
skip_scheduler = true
|
||||
|
||||
[resume]
|
||||
step = 5
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B"
|
||||
optim_cpu_offload = false
|
||||
full_offload = true
|
||||
|
||||
[optim]
|
||||
lr = 0.0
|
||||
|
||||
[data]
|
||||
name = "PrimeIntellect/Reverse-Text-SFT"
|
||||
batch_size = 4
|
||||
seq_len = 1024
|
||||
+5
-16
@@ -8,9 +8,7 @@ seq_len = 2048
|
||||
type = "filesystem"
|
||||
|
||||
[ckpt]
|
||||
|
||||
[resume]
|
||||
step = 15
|
||||
resume_step = 15
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
@@ -20,25 +18,16 @@ lr = 3e-6
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[inference]
|
||||
|
||||
# PrimeIntellect Qwen3 fine-tune - select its renderer explicitly (the -SFT
|
||||
# suffix misses the MODEL_RENDERER_MAP exact match).
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
name = "default"
|
||||
+4
-13
@@ -17,25 +17,16 @@ lr = 3e-6
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[inference]
|
||||
|
||||
# PrimeIntellect Qwen3 fine-tune - select its renderer explicitly (the -SFT
|
||||
# suffix misses the MODEL_RENDERER_MAP exact match).
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
name = "default"
|
||||
@@ -0,0 +1,38 @@
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[ckpt]
|
||||
resume_step = 15
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 5e-5
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 8
|
||||
|
||||
[trainer.ckpt.weights]
|
||||
save_adapter_separately = true
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.model.lora]
|
||||
name = "r8-1e-4"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[inference]
|
||||
enable_lora = true
|
||||
gpu_memory_utilization = 0.7
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
@@ -0,0 +1,37 @@
|
||||
max_steps = 15
|
||||
seq_len = 2048
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 5e-5
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 8
|
||||
|
||||
[trainer.ckpt.weights]
|
||||
save_adapter_separately = true
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.model.lora]
|
||||
name = "r8-1e-4"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[inference]
|
||||
enable_lora = true
|
||||
gpu_memory_utilization = 0.7
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
+7
-13
@@ -20,26 +20,20 @@ impl = "custom"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
max_model_len = 2048
|
||||
gpu_memory_utilization = 0.7
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 2048
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
@@ -0,0 +1,13 @@
|
||||
# Inference config for multi-run RL integration test
|
||||
enable_lora = true
|
||||
max_lora_rank = 8
|
||||
max_loras = 4
|
||||
gpu_memory_utilization = 0.7
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
max_model_len = 2048
|
||||
|
||||
[weight_broadcast]
|
||||
type = "filesystem"
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# Orchestrator config for multi-run RL integration test
|
||||
# model.lora.name and output_dir are set via CLI
|
||||
batch_size = 128
|
||||
group_size = 16
|
||||
seq_len = 2048
|
||||
max_steps = 20
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[optim]
|
||||
lr = 3e-5
|
||||
|
||||
[train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[ckpt]
|
||||
interval = 10
|
||||
resume_step = -1
|
||||
|
||||
[weight_broadcast]
|
||||
type = "filesystem"
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
[renderer]
|
||||
name = "default"
|
||||
@@ -0,0 +1,21 @@
|
||||
# Trainer config for multi-run RL integration test
|
||||
max_concurrent_runs = 2
|
||||
enable_token_export = true
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
seq_len = 65536
|
||||
fused_lm_head_token_chunk_size = 8192
|
||||
optim_cpu_offload = false
|
||||
|
||||
[model.lora]
|
||||
rank = 8
|
||||
|
||||
[model.ac]
|
||||
freq = 1
|
||||
|
||||
[model.compile]
|
||||
fullgraph = false
|
||||
|
||||
[weight_broadcast]
|
||||
type = "filesystem"
|
||||
+11
-26
@@ -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
|
||||
@@ -16,57 +16,42 @@ type = "filesystem"
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[monitors.wandb]
|
||||
[wandb]
|
||||
project = "reverse-text-ci"
|
||||
name = "ci-rl-opd"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[orchestrator.train.algo]
|
||||
[orchestrator.algo]
|
||||
type = "opd"
|
||||
|
||||
[orchestrator.train.algo.teacher]
|
||||
[orchestrator.algo.teacher]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = "http://localhost:8001/v1"
|
||||
base_url = ["http://localhost:8001/v1"]
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
name = "qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
|
||||
[orchestrator.eval.select]
|
||||
limit = 16
|
||||
num_examples = 16
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.eval.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
gpu_memory_utilization = 0.4
|
||||
+16
-30
@@ -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
|
||||
@@ -16,63 +16,49 @@ type = "filesystem"
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[monitors.wandb]
|
||||
[wandb]
|
||||
project = "reverse-text-ci"
|
||||
name = "ci-rl-sft"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[orchestrator.train.algo]
|
||||
[orchestrator.algo]
|
||||
type = "sft"
|
||||
|
||||
# sft's teacher IS the model it samples from.
|
||||
[orchestrator.train.algo.sampling.source]
|
||||
[orchestrator.algo.sampling.source]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = "http://localhost:8001/v1"
|
||||
base_url = ["http://localhost:8001/v1"]
|
||||
|
||||
# The student's renderer tokenizes the teacher's messages into the student's
|
||||
# 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).
|
||||
# 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.
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
name = "default"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
|
||||
[orchestrator.eval.select]
|
||||
limit = 16
|
||||
num_examples = 16
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.eval.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
gpu_memory_utilization = 0.4
|
||||
+1
-3
@@ -1,9 +1,7 @@
|
||||
max_steps = 10
|
||||
|
||||
[ckpt]
|
||||
|
||||
[resume]
|
||||
step = 5
|
||||
resume_step = 5
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B"
|
||||
+3
-2
@@ -1,9 +1,10 @@
|
||||
max_steps = 10
|
||||
|
||||
[ckpt]
|
||||
resume_step = 5
|
||||
|
||||
[resume]
|
||||
step = 5
|
||||
[ckpt.weights]
|
||||
save_adapter_separately = true
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B"
|
||||
+3
@@ -2,6 +2,9 @@ max_steps = 5
|
||||
|
||||
[ckpt]
|
||||
|
||||
[ckpt.weights]
|
||||
save_adapter_separately = true
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B"
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
max_steps = 200
|
||||
seq_len = 2048
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 4
|
||||
num_infer_gpus = 4
|
||||
|
||||
[monitors.wandb]
|
||||
project = "alphabet-sort"
|
||||
name = "alphabet-sort"
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "alphabet-sort"
|
||||
env.taskset.id = "alphabet-sort"
|
||||
env.taskset.min_turns = 3
|
||||
env.taskset.max_turns = 5
|
||||
env.taskset.task.power_per_turn = false
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 768
|
||||
|
||||
[trainer]
|
||||
|
||||
[inference.vllm]
|
||||
data_parallel_size = 4
|
||||
@@ -1,55 +0,0 @@
|
||||
max_steps = 5000
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 4
|
||||
num_infer_gpus = 4
|
||||
|
||||
[monitors.wandb]
|
||||
project = "hendrycks-sanity"
|
||||
name = "hendrycks-sanity"
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
seq_len = 8192
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "hendrycks-math"
|
||||
env.taskset.id = "math-env"
|
||||
env.taskset.dataset_name = "mikasenghaas/Sanity-Test-R1D-1.5B"
|
||||
env.taskset.dataset_subset = "default"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 50
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "aime2024"
|
||||
group_size = 32
|
||||
env.taskset.id = "aime24"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[trainer]
|
||||
|
||||
[trainer.model]
|
||||
seq_len = 16384
|
||||
attn = "flash_attention_2"
|
||||
|
||||
[inference.vllm]
|
||||
max_model_len = 8192
|
||||
data_parallel_size = 4
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
reasoning_parser = "think"
|
||||
@@ -1,40 +0,0 @@
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 1
|
||||
num_infer_gpus = 1
|
||||
|
||||
[monitors.wandb]
|
||||
project = "reverse-text"
|
||||
name = "reverse-text"
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[trainer]
|
||||
|
||||
[inference]
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
@@ -1,40 +0,0 @@
|
||||
max_steps = 200
|
||||
seq_len = 4096
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 4
|
||||
num_infer_gpus = 4
|
||||
|
||||
[monitors.wandb]
|
||||
project = "wiki-search"
|
||||
name = "wiki-search"
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
initial_inflight = 128
|
||||
max_inflight = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "wiki-search"
|
||||
env.taskset.id = "wiki-search"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 512
|
||||
|
||||
[trainer]
|
||||
|
||||
[inference.vllm]
|
||||
tool_call_parser = "hermes"
|
||||
data_parallel_size = 4
|
||||
@@ -1,40 +0,0 @@
|
||||
max_steps = 200
|
||||
seq_len = 8192
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 2
|
||||
num_infer_gpus = 6
|
||||
|
||||
[monitors.wandb]
|
||||
project = "wordle"
|
||||
name = "wordle"
|
||||
|
||||
[ckpt]
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-1.7B-Wordle-SFT"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "wordle"
|
||||
env.taskset.id = "wordle"
|
||||
env.player.harness.id = "null"
|
||||
env.player.runtime.type = "subprocess"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 1024
|
||||
|
||||
[trainer]
|
||||
|
||||
[inference.vllm]
|
||||
data_parallel_size = 6
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
@@ -1,4 +1,4 @@
|
||||
# Based on configs/debug/multimodal.toml but tuned for CI.
|
||||
# Based on configs/multimodal/rl_color_codeword.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.5-4B"
|
||||
name = "Qwen/Qwen3-VL-4B-Instruct"
|
||||
|
||||
[model.vlm]
|
||||
vision_encoder_attr = "model.visual"
|
||||
@@ -15,27 +15,19 @@ language_model_attr = "model.language_model"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 64
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
[[orchestrator.train.env]]
|
||||
name = "color-codeword"
|
||||
env.taskset.id = "color-codeword"
|
||||
env.taskset.images_per_turn = 1
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
taskset = { id = "color-codeword-v1", images_per_turn = 1 }
|
||||
harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer]
|
||||
|
||||
[trainer.model]
|
||||
impl = "custom"
|
||||
optimization_dtype = "bfloat16"
|
||||
reduce_dtype = "bfloat16"
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
# 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"
|
||||
@@ -1,51 +0,0 @@
|
||||
# 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/algo/echo.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 4096
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[monitors.wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-echo"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 4
|
||||
|
||||
# alphabet-sort's feedback arrives as user messages, so train the user role
|
||||
# instead of echo's tool default.
|
||||
[orchestrator.train.algo]
|
||||
type = "echo"
|
||||
|
||||
[orchestrator.train.algo.roles.user]
|
||||
alpha = 0.1
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "alphabet-sort"
|
||||
env.taskset.id = "alphabet-sort"
|
||||
env.taskset.min_turns = 3
|
||||
env.taskset.max_turns = 5
|
||||
env.taskset.task.power_per_turn = false
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 512
|
||||
|
||||
# Fine-tune inherits the PrimeIntellect Qwen3 template byte-for-byte.
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-6
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -1,72 +0,0 @@
|
||||
# Mixed per-env algorithms in one run: a GRPO env and an OPD env, both on
|
||||
# reverse-text. Exercises heterogeneous train batches — OPD samples ship
|
||||
# ref_logprobs, GRPO samples don't, and both pack into the same micro batches.
|
||||
# Start the frozen reference server first (on a separate GPU):
|
||||
# CUDA_VISIBLE_DEVICES=1 uv run inference \
|
||||
# --vllm.model PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL \
|
||||
# --server.port 8001 --vllm.gpu-memory-utilization 0.5 --vllm.enforce-eager
|
||||
# Then:
|
||||
# uv run rl @ configs/debug/algo/mixed_grpo_opd.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[monitors.wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-mixed-grpo-opd"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text-grpo"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text-opd"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
algo.type = "opd"
|
||||
algo.teacher.name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
algo.teacher.base_url = "http://localhost:8001/v1"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 5
|
||||
|
||||
[orchestrator.eval.select]
|
||||
limit = 128
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -1,59 +0,0 @@
|
||||
max_steps = 20
|
||||
seq_len = 4096
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-0.6B"
|
||||
|
||||
[monitors.wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-rae"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 1
|
||||
|
||||
[orchestrator.train.algo]
|
||||
type = "rae"
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 512
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "kuhn-poker"
|
||||
env.taskset.id = "kuhn-poker"
|
||||
env.player0.harness.id = "null"
|
||||
env.player0.runtime.type = "subprocess"
|
||||
env.player1.harness.id = "null"
|
||||
env.player1.runtime.type = "subprocess"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
|
||||
[orchestrator.eval.select]
|
||||
limit = 16
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 512
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "kuhn-poker"
|
||||
env.taskset.id = "kuhn-poker"
|
||||
env.player0.harness.id = "null"
|
||||
env.player0.runtime.type = "subprocess"
|
||||
env.player1.harness.id = "null"
|
||||
env.player1.runtime.type = "subprocess"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[ckpt]
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -1,72 +0,0 @@
|
||||
# Start the frozen reference server first (on a separate GPU):
|
||||
# CUDA_VISIBLE_DEVICES=1 uv run inference \
|
||||
# --vllm.model PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL \
|
||||
# --server.port 8001 --vllm.gpu-memory-utilization 0.5 --vllm.enforce-eager
|
||||
# Then:
|
||||
# uv run rl @ configs/debug/algo/sft_distill.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[monitors.wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-sft"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 4
|
||||
|
||||
[orchestrator.train.algo]
|
||||
type = "sft"
|
||||
|
||||
# sft's teacher IS the model it samples from.
|
||||
[orchestrator.train.algo.sampling.source]
|
||||
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 `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 = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
|
||||
[orchestrator.eval.select]
|
||||
limit = 128
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[ckpt]
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -1,75 +0,0 @@
|
||||
# Start the frozen reference server first (on a separate GPU):
|
||||
# CUDA_VISIBLE_DEVICES=1 uv run inference \
|
||||
# --vllm.model PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL \
|
||||
# --server.port 8001 --vllm.gpu-memory-utilization 0.5 --vllm.enforce-eager
|
||||
# Then:
|
||||
# uv run rl @ configs/debug/algo/sft_distill_lora.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[monitors.wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-sft-lora"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 4
|
||||
|
||||
[orchestrator.train.algo]
|
||||
type = "sft"
|
||||
|
||||
# sft's teacher IS the model it samples from.
|
||||
[orchestrator.train.algo.sampling.source]
|
||||
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 `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 = "prime-qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
|
||||
[orchestrator.eval.select]
|
||||
limit = 128
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-4
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 8
|
||||
|
||||
[ckpt]
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -16,7 +16,7 @@ Minimal end-to-end configs for the algorithms against bundled verifiers envs, us
|
||||
|
||||
The policy inference server is auto-launched on GPU 0 at `http://localhost:8000/v1` with `gpu_memory_utilization=0.5`. The local frozen model (used by `opd*.toml`, `sft_distill.toml` / `sft_distill_lora.toml`, and `mixed_grpo_opd.toml`) is **not** auto-launched — start it manually on GPU 1.
|
||||
|
||||
Frozen models are declared inline on the algorithm, named where the model is used — `[orchestrator.train.algo.teacher]` for `opd`, `[orchestrator.train.algo.sampling.source]` for `sft` — with `name` + `base_url`. `opsd` declares none (it self-distills against the live policy). prime-rl never hosts them; only the trainable policy's server is managed by the `rl` entrypoint.
|
||||
Frozen models are declared inline on the algorithm, named where the model is used — `[orchestrator.algo.teacher]` for `opd`, `[orchestrator.algo.sampling.source]` for `sft` — with `name` + `base_url`. `opsd` declares none (it self-distills against the live policy). prime-rl never hosts them; only the trainable policy's server is managed by the `rl` entrypoint.
|
||||
|
||||
## Start the local frozen model
|
||||
|
||||
@@ -24,39 +24,39 @@ Needed for `opd*.toml`, `sft_distill.toml` / `sft_distill_lora.toml`, and `mixed
|
||||
|
||||
```bash
|
||||
CUDA_VISIBLE_DEVICES=1 uv run inference \
|
||||
--vllm.model PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL \
|
||||
--model.name PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL \
|
||||
--server.port 8001 \
|
||||
--vllm.gpu-memory-utilization 0.5 \
|
||||
--vllm.enforce-eager
|
||||
--gpu-memory-utilization 0.5 \
|
||||
--model.enforce-eager
|
||||
```
|
||||
|
||||
## Run the debug configs
|
||||
|
||||
Every config writes to the default `outputs/` directory, so running two back-to-back — or re-running one — fails with `FileExistsError`. Pass a distinct `--output-dir outputs/<algo>` per config (recommended for a sweep) or `--clean` to wipe and restart.
|
||||
Every config writes to the default `outputs/` directory, so running two back-to-back — or re-running one — fails with `FileExistsError`. Pass a distinct `--output-dir outputs/<algo>` per config (recommended for a sweep) or `--clean-output-dir` to wipe and restart.
|
||||
|
||||
```bash
|
||||
# GRPO (no frozen model)
|
||||
uv run rl @ configs/debug/algo/grpo.toml --output-dir outputs/grpo
|
||||
uv run rl @ configs/debug/algorithms/grpo.toml --output-dir outputs/grpo
|
||||
|
||||
# MaxRL (no frozen model)
|
||||
uv run rl @ configs/debug/algo/max_rl.toml --output-dir outputs/max_rl
|
||||
uv run rl @ configs/debug/algorithms/max_rl.toml --output-dir outputs/max_rl
|
||||
|
||||
# OPD (needs the frozen model on port 8001)
|
||||
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
|
||||
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
|
||||
|
||||
# SFT distillation (needs the frozen model on port 8001)
|
||||
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
|
||||
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
|
||||
|
||||
# Self-distillation against the live policy (no frozen model)
|
||||
uv run rl @ configs/debug/algo/self_distill.toml --output-dir outputs/self_distill
|
||||
uv run rl @ configs/debug/algorithms/self_distill.toml --output-dir outputs/self_distill
|
||||
|
||||
# ECHO (no frozen model; multi-turn env)
|
||||
uv run rl @ configs/debug/algo/echo.toml --output-dir outputs/echo
|
||||
uv run rl @ configs/debug/algorithms/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/algo/mixed_grpo_opd.toml --output-dir outputs/mixed_grpo_opd
|
||||
uv run rl @ configs/debug/algorithms/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.
|
||||
@@ -0,0 +1,50 @@
|
||||
# ECHO on the multi-turn alphabet-sort env (bundled with verifiers): GRPO on
|
||||
# action tokens + weighted CE on the env's observation tokens.
|
||||
# uv run rl @ configs/debug/algorithms/echo.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 4096
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-echo"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 32
|
||||
group_size = 4
|
||||
|
||||
# alphabet-sort's feedback arrives as user messages, so train the user role
|
||||
# instead of echo's tool default.
|
||||
[orchestrator.algo]
|
||||
type = "echo"
|
||||
|
||||
[orchestrator.algo.roles.user]
|
||||
alpha = 0.1
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
id = "alphabet-sort"
|
||||
args = { min_turns = 3, max_turns = 5, power_per_turn = false }
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 512
|
||||
|
||||
# ECHO learns from observation tokens even when the GRPO advantage collapses
|
||||
# to zero — keep zero-advantage rollouts in the batch.
|
||||
[[orchestrator.post_batch_filters]]
|
||||
type = "zero_advantage"
|
||||
enforce = false
|
||||
|
||||
# Qwen3 finetune with the standard PI template patch; always re-emits prior
|
||||
# <think> blocks, matched by renderer thinking_retention.
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
thinking_retention = "all"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-6
|
||||
|
||||
[inference]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -4,45 +4,35 @@ seq_len = 2048
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[monitors.wandb]
|
||||
[wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-rl"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.algo]
|
||||
[orchestrator.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
name = "qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
|
||||
[orchestrator.eval.select]
|
||||
limit = 128
|
||||
num_examples = 128
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.eval.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
@@ -50,6 +40,4 @@ lr = 3e-6
|
||||
[ckpt]
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -4,45 +4,35 @@ seq_len = 2048
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[monitors.wandb]
|
||||
[wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-max-rl"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.algo]
|
||||
[orchestrator.algo]
|
||||
type = "max_rl"
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
name = "qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
|
||||
[orchestrator.eval.select]
|
||||
limit = 128
|
||||
num_examples = 128
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.eval.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
@@ -50,6 +40,4 @@ lr = 3e-6
|
||||
[ckpt]
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -0,0 +1,63 @@
|
||||
# Mixed per-env algorithms in one run: a GRPO env and an OPD env, both on
|
||||
# reverse-text. Exercises heterogeneous train batches — OPD samples ship
|
||||
# ref_logprobs, GRPO samples don't, and both pack into the same micro batches.
|
||||
# Start the frozen reference server first (on a separate GPU):
|
||||
# CUDA_VISIBLE_DEVICES=1 uv run inference \
|
||||
# --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
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-mixed-grpo-opd"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
name = "reverse-text-grpo"
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
name = "reverse-text-opd"
|
||||
|
||||
[orchestrator.train.env.algo]
|
||||
type = "opd"
|
||||
|
||||
[orchestrator.train.env.algo.teacher]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = ["http://localhost:8001/v1"]
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 5
|
||||
num_examples = 128
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[inference]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -1,9 +1,9 @@
|
||||
# Start the frozen reference server first (on a separate GPU):
|
||||
# CUDA_VISIBLE_DEVICES=1 uv run inference \
|
||||
# --vllm.model PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL \
|
||||
# --server.port 8001 --vllm.gpu-memory-utilization 0.5 --vllm.enforce-eager
|
||||
# --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/algo/opd.toml
|
||||
# uv run rl @ configs/debug/algorithms/opd.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
@@ -11,50 +11,40 @@ seq_len = 2048
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[monitors.wandb]
|
||||
[wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-opd"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.algo]
|
||||
[orchestrator.algo]
|
||||
type = "opd"
|
||||
|
||||
[orchestrator.train.algo.teacher]
|
||||
[orchestrator.algo.teacher]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = "http://localhost:8001/v1"
|
||||
base_url = ["http://localhost:8001/v1"]
|
||||
|
||||
# Teacher rolls out over plain chat-completions (no tokens); the renderer backfills them.
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
name = "qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
|
||||
[orchestrator.eval.select]
|
||||
limit = 128
|
||||
num_examples = 128
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.eval.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
@@ -62,6 +52,4 @@ lr = 3e-6
|
||||
[ckpt]
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -1,9 +1,9 @@
|
||||
# Start the frozen reference server first (on a separate GPU):
|
||||
# CUDA_VISIBLE_DEVICES=1 uv run inference \
|
||||
# --vllm.model PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL \
|
||||
# --server.port 8001 --vllm.gpu-memory-utilization 0.5 --vllm.enforce-eager
|
||||
# --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/algo/opd_lora.toml
|
||||
# uv run rl @ configs/debug/algorithms/opd_lora.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
@@ -11,50 +11,40 @@ seq_len = 2048
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[monitors.wandb]
|
||||
[wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-opd-lora"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.algo]
|
||||
[orchestrator.algo]
|
||||
type = "opd"
|
||||
|
||||
[orchestrator.train.algo.teacher]
|
||||
[orchestrator.algo.teacher]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = "http://localhost:8001/v1"
|
||||
base_url = ["http://localhost:8001/v1"]
|
||||
|
||||
# Teacher rolls out over plain chat-completions (no tokens); the renderer backfills them.
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
name = "qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
|
||||
[orchestrator.eval.select]
|
||||
limit = 128
|
||||
num_examples = 128
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.eval.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-4
|
||||
@@ -62,9 +52,10 @@ lr = 1e-4
|
||||
[trainer.model.lora]
|
||||
rank = 8
|
||||
|
||||
[trainer.ckpt.weights]
|
||||
save_adapter_separately = true
|
||||
|
||||
[ckpt]
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -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/algo/self_distill.toml
|
||||
# uv run rl @ configs/debug/algorithms/self_distill.toml
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
@@ -10,52 +10,40 @@ seq_len = 2048
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[monitors.wandb]
|
||||
[wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-self-distill"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 1
|
||||
|
||||
# reverse-text's demo lives in the "answer" column.
|
||||
[orchestrator.train.algo]
|
||||
[orchestrator.algo]
|
||||
type = "opsd"
|
||||
demo_key = "answer"
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
name = "qwen3"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
|
||||
[orchestrator.eval.select]
|
||||
limit = 128
|
||||
num_examples = 128
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "reverse-text"
|
||||
env.taskset.id = "reverse-text"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
[[orchestrator.eval.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -0,0 +1,60 @@
|
||||
# Start the frozen reference server first (on a separate GPU):
|
||||
# CUDA_VISIBLE_DEVICES=1 uv run inference \
|
||||
# --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
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-sft"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 4
|
||||
|
||||
[orchestrator.algo]
|
||||
type = "sft"
|
||||
|
||||
# sft's teacher IS the model it samples from.
|
||||
[orchestrator.algo.sampling.source]
|
||||
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.
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
num_examples = 128
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[ckpt]
|
||||
|
||||
[inference]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -0,0 +1,66 @@
|
||||
# Start the frozen reference server first (on a separate GPU):
|
||||
# CUDA_VISIBLE_DEVICES=1 uv run inference \
|
||||
# --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
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[wandb]
|
||||
project = "algorithms-debug"
|
||||
name = "debug-sft-lora"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 4
|
||||
|
||||
[orchestrator.algo]
|
||||
type = "sft"
|
||||
|
||||
# sft's teacher IS the model it samples from.
|
||||
[orchestrator.algo.sampling.source]
|
||||
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.
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 1
|
||||
num_examples = 128
|
||||
|
||||
[orchestrator.eval.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
id = "reverse-text"
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-4
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 8
|
||||
|
||||
[trainer.ckpt.weights]
|
||||
save_adapter_separately = true
|
||||
|
||||
[ckpt]
|
||||
|
||||
[inference]
|
||||
gpu_memory_utilization = 0.5
|
||||
@@ -1,16 +0,0 @@
|
||||
# AIME 2026 at avg@16: every problem 16 times with the null harness (one chat
|
||||
# completion per rollout) against Prime Inference. The math tasksets forbid the
|
||||
# agent any network, and only the sandboxed runtimes enforce that policy, so the
|
||||
# rollouts run in prime sandboxes (PRIME_API_KEY) rather than as subprocesses.
|
||||
# Competition math needs room to reason, so the completion budget is generous.
|
||||
#
|
||||
# uv run eval @ configs/debug/eval/aime2026.toml
|
||||
|
||||
group_size = 16
|
||||
|
||||
[sampling]
|
||||
max_completion_tokens = 32768
|
||||
|
||||
[[source]]
|
||||
env.taskset.id = "aime26"
|
||||
env.agent.harness.id = "null"
|
||||
@@ -1,21 +0,0 @@
|
||||
# Multi env: 16 terminal-bench-2 tasks under two harnesses, bash and rlm, in prime
|
||||
# sandboxes (PRIME_API_KEY authenticates sandbox creation), one rollout each with
|
||||
# a ten-minute budget, against Prime Inference on the default model. One env server
|
||||
# per source; the sources share the taskset, so each carries its own name.
|
||||
#
|
||||
# uv run eval @ configs/debug/eval/multi-env.toml
|
||||
|
||||
[select]
|
||||
limit = 16
|
||||
|
||||
[[source]]
|
||||
name = "tb2-bash"
|
||||
env.taskset.id = "terminal-bench-2"
|
||||
env.agent.harness.id = "bash"
|
||||
env.agent.timeout.rollout = 600
|
||||
|
||||
[[source]]
|
||||
name = "tb2-rlm"
|
||||
env.taskset.id = "terminal-bench-2"
|
||||
env.agent.harness.id = "rlm"
|
||||
env.agent.timeout.rollout = 600
|
||||
@@ -1,13 +0,0 @@
|
||||
# Single env, multi turn: 16 terminal-bench-2 tasks with the bash harness in
|
||||
# prime sandboxes (PRIME_API_KEY authenticates sandbox creation), one rollout
|
||||
# each, against Prime Inference on the default model.
|
||||
#
|
||||
# uv run eval @ configs/debug/eval/multi-turn.toml
|
||||
|
||||
[select]
|
||||
limit = 16
|
||||
|
||||
[[source]]
|
||||
env.taskset.id = "terminal-bench-2"
|
||||
env.agent.harness.id = "bash"
|
||||
env.agent.timeout.rollout = 3600
|
||||
@@ -1,25 +0,0 @@
|
||||
# Single env, resume: gsm8k with a low pinned concurrency so the run can be
|
||||
# interrupted partway. Relaunch with the same --run.name and --resume: the landed
|
||||
# episodes are restored from the trace stream and only the owed rollouts run.
|
||||
# Resuming a finished run restores everything and exits.
|
||||
#
|
||||
# uv run eval @ configs/debug/eval/resume.toml --run.name resume-debug
|
||||
# <Ctrl-C partway>
|
||||
# uv run eval @ configs/debug/eval/resume.toml --run.name resume-debug --resume
|
||||
|
||||
group_size = 2
|
||||
|
||||
[select]
|
||||
limit = 8
|
||||
|
||||
[concurrency]
|
||||
min_inflight = 2
|
||||
max_inflight = 2
|
||||
|
||||
[sampling]
|
||||
max_completion_tokens = 8192
|
||||
|
||||
[[source]]
|
||||
env.taskset.id = "gsm8k"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
@@ -1,17 +0,0 @@
|
||||
# Single env, single turn: gsm8k with the null harness (one chat completion per
|
||||
# task, no sandbox) against Prime Inference.
|
||||
#
|
||||
# uv run eval @ configs/debug/eval/single-turn.toml
|
||||
|
||||
group_size = 2
|
||||
|
||||
[select]
|
||||
limit = 8
|
||||
|
||||
[sampling]
|
||||
max_completion_tokens = 8192
|
||||
|
||||
[[source]]
|
||||
env.taskset.id = "gsm8k"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
@@ -1,15 +0,0 @@
|
||||
# Terminal-Bench 2 at avg@4: every task 4 times with the bash harness in prime
|
||||
# sandboxes (PRIME_API_KEY authenticates sandbox creation) against Prime Inference.
|
||||
#
|
||||
# uv run eval @ configs/debug/eval/tb2.toml
|
||||
|
||||
group_size = 4
|
||||
|
||||
[[source]]
|
||||
env.taskset.id = "terminal-bench-2"
|
||||
env.agent.harness.id = "bash"
|
||||
env.agent.timeout.rollout = 3600
|
||||
env.agent.retries.rules = [
|
||||
{type = "ProviderError", max_retries = 2},
|
||||
{type = "SandboxError", max_retries = 2},
|
||||
]
|
||||
@@ -0,0 +1,42 @@
|
||||
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"
|
||||
@@ -0,0 +1,2 @@
|
||||
[model]
|
||||
enforce_eager = true
|
||||
@@ -0,0 +1,14 @@
|
||||
max_steps = 5
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/GLM-0.5B"
|
||||
moe_use_grouped_mm = false
|
||||
impl = "custom"
|
||||
attn = "sdpa"
|
||||
|
||||
[model.compile]
|
||||
|
||||
[data]
|
||||
type = "fake"
|
||||
batch_size = 2
|
||||
seq_len = 1024
|
||||
@@ -0,0 +1,51 @@
|
||||
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]]
|
||||
id = "reverse-text"
|
||||
name = "reverse-text-train-1"
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
id = "reverse-text"
|
||||
name = "reverse-text-train-2"
|
||||
|
||||
# -- multi eval envs --
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 10
|
||||
num_examples = 16
|
||||
group_size = 4
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
id = "reverse-text"
|
||||
name = "reverse-text-eval-1"
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
id = "reverse-text"
|
||||
name = "reverse-text-eval-2"
|
||||
interval = 5
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[inference]
|
||||
gpu_memory_utilization = 0.5
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 128
|
||||
@@ -0,0 +1,76 @@
|
||||
# 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"]
|
||||
@@ -0,0 +1,6 @@
|
||||
max_steps = 5
|
||||
batch_size = 16
|
||||
|
||||
[train.sampling]
|
||||
max_completion_tokens = 16
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
# 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
|
||||
@@ -0,0 +1,54 @@
|
||||
# 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
|
||||
@@ -0,0 +1,41 @@
|
||||
# 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
|
||||
@@ -0,0 +1,55 @@
|
||||
# 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"
|
||||
@@ -0,0 +1,84 @@
|
||||
# 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
|
||||
@@ -0,0 +1,41 @@
|
||||
# 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
|
||||
@@ -0,0 +1,118 @@
|
||||
# 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
|
||||
@@ -0,0 +1,17 @@
|
||||
# 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
|
||||
```
|
||||
@@ -0,0 +1,46 @@
|
||||
# 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]]
|
||||
id = "alphabet-sort"
|
||||
name = "alphabet-sort"
|
||||
args = { min_turns = 3, max_turns = 5, power_per_turn = false }
|
||||
@@ -0,0 +1,30 @@
|
||||
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
|
||||
+14
-14
@@ -9,7 +9,7 @@ type = "multi_node"
|
||||
num_train_nodes = 1
|
||||
num_infer_nodes = 1
|
||||
|
||||
[monitors.wandb]
|
||||
[wandb]
|
||||
project = "general-agent-debug"
|
||||
name = "qwen3-30b-a3b-rlm"
|
||||
|
||||
@@ -32,22 +32,22 @@ freq = 1
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
rollouts_per_example = 16
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
[[orchestrator.train.env]]
|
||||
taskset = { id = "general-agent-v1", task = { tools = { colocated = true } } }
|
||||
harness = { id = "null", runtime = { type = "modal" } }
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
env.taskset.id = "general-agent"
|
||||
env.taskset.min_tier = 1
|
||||
env.taskset.task.tools.colocated = true
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "modal"
|
||||
[orchestrator.train.env.args]
|
||||
min_tier = 1
|
||||
|
||||
[inference]
|
||||
|
||||
[inference.vllm]
|
||||
max_model_len = 32768
|
||||
data_parallel_size = 2
|
||||
tensor_parallel_size = 4
|
||||
gpu_memory_utilization = 0.85
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 32768
|
||||
|
||||
[inference.parallel]
|
||||
dp = 2
|
||||
tp = 4
|
||||
@@ -0,0 +1,45 @@
|
||||
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
|
||||
@@ -21,7 +21,7 @@ num_train_nodes = 2
|
||||
num_infer_nodes = 1
|
||||
num_infer_replicas = 4
|
||||
|
||||
[monitors.wandb]
|
||||
[wandb]
|
||||
project = "search-ablations"
|
||||
name = "glm45air-search"
|
||||
|
||||
@@ -32,8 +32,7 @@ timeout = 3600
|
||||
[ckpt]
|
||||
interval = 50
|
||||
keep_last = 1
|
||||
|
||||
[resume]
|
||||
resume_step = -1
|
||||
|
||||
[model]
|
||||
name = "zai-org/GLM-4.5-Air"
|
||||
@@ -47,9 +46,10 @@ enable_router_replay = true
|
||||
[trainer.model]
|
||||
impl = "custom"
|
||||
attn = "flash_attention_3"
|
||||
cp = 4
|
||||
cp = 8
|
||||
cp_style = "ulysses"
|
||||
fused_lm_head_token_chunk_size = 1024
|
||||
optim_cpu_offload = true
|
||||
|
||||
[trainer.model.ac]
|
||||
|
||||
@@ -59,6 +59,7 @@ max_inflight_activations = 1
|
||||
[trainer.model.compile]
|
||||
|
||||
[trainer.ckpt]
|
||||
skip_gather_master_weights = true
|
||||
skip_optimizer = true
|
||||
|
||||
[trainer.optim]
|
||||
@@ -68,43 +69,38 @@ type = "muon"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
initial_inflight = 256
|
||||
max_inflight = 512
|
||||
max_off_policy_steps = 32
|
||||
max_inflight_rollouts = 512
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "glm-4.5"
|
||||
thinking_retention = "all"
|
||||
|
||||
[orchestrator.train.algo]
|
||||
[orchestrator.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.train.algo.length_penalty]
|
||||
[orchestrator.algo.length_penalty]
|
||||
type = "linear"
|
||||
num_output_tokens_weight = 0.0
|
||||
num_input_tokens_weight = 0.1
|
||||
num_turns_weight = 0.0
|
||||
|
||||
[orchestrator.prime_monitor]
|
||||
|
||||
# --- Train: the search envs with usable training data (rlm `search` skill, prime sandbox) ---
|
||||
|
||||
# openseeker/redsearcher pre-plug a `reference` judge; declaring `judges` here replaces that
|
||||
# entry wholesale (keep `name`/`question_field`/`choices` in sync with the taskset defaults —
|
||||
# the plugged BC-style prompt is replaced by the reference judge's stock prompt).
|
||||
[[orchestrator.train.source]]
|
||||
[[orchestrator.train.env]]
|
||||
name = "openseeker"
|
||||
env.agent.harness.id = "rlm"
|
||||
env.agent.harness.skills = ["search"]
|
||||
env.agent.harness.forward_env = ["SERPER_API_KEY"]
|
||||
env.agent.harness.compaction.summarize_at_tokens = 98304
|
||||
env.agent.runtime.labels = ["glm45air-search"]
|
||||
env.taskset.id = "openseeker"
|
||||
harness = { id = "rlm", skills = ["search"], forward_env = ["SERPER_API_KEY"], summarize_at_tokens = [65536, 131072], runtime = { type = "prime", vm = true, idle_timeout = "None", labels = ["glm45air-search"] } }
|
||||
|
||||
[[orchestrator.train.source.env.taskset.task.judges]]
|
||||
[orchestrator.train.env.taskset]
|
||||
id = "openseeker-v1"
|
||||
|
||||
[[orchestrator.train.env.taskset.task.judges]]
|
||||
id = "reference"
|
||||
name = "correct"
|
||||
model = "Qwen/Qwen3-235B-A22B-Instruct-2507"
|
||||
@@ -112,23 +108,21 @@ question_field = "question"
|
||||
choices = ["A", "B"]
|
||||
|
||||
# # Metric-only monitor (weight 0): rlm harness-mechanics rubric, judged by GLM-5.2.
|
||||
# [[orchestrator.train.source.env.taskset.task.judges]]
|
||||
# [[orchestrator.train.env.taskset.task.judges]]
|
||||
# id = "rubric"
|
||||
# name = "rlm"
|
||||
# path = "deps/prime-envs/rubrics/rlm.toml"
|
||||
# path = "deps/research-environments/rubrics/rlm.toml"
|
||||
# model = "zai-org/GLM-5.2"
|
||||
# weight = 0.0
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
[[orchestrator.train.env]]
|
||||
name = "redsearcher"
|
||||
env.agent.harness.id = "rlm"
|
||||
env.agent.harness.skills = ["search"]
|
||||
env.agent.harness.forward_env = ["SERPER_API_KEY"]
|
||||
env.agent.harness.compaction.summarize_at_tokens = 98304
|
||||
env.agent.runtime.labels = ["glm45air-search"]
|
||||
env.taskset.id = "redsearcher" # optional `difficulty` filter (easy/medium/hard)
|
||||
harness = { id = "rlm", skills = ["search"], forward_env = ["SERPER_API_KEY"], summarize_at_tokens = [65536, 131072], runtime = { type = "prime", vm = true, idle_timeout = "None", labels = ["glm45air-search"] } }
|
||||
|
||||
[[orchestrator.train.source.env.taskset.task.judges]]
|
||||
[orchestrator.train.env.taskset]
|
||||
id = "redsearcher-v1" # optional `difficulty` filter (easy/medium/hard)
|
||||
|
||||
[[orchestrator.train.env.taskset.task.judges]]
|
||||
id = "reference"
|
||||
name = "correct"
|
||||
model = "Qwen/Qwen3-235B-A22B-Instruct-2507"
|
||||
@@ -136,10 +130,10 @@ question_field = "question"
|
||||
choices = ["A", "B"]
|
||||
|
||||
# # Metric-only monitor (weight 0): rlm harness-mechanics rubric, judged by GLM-5.2.
|
||||
# [[orchestrator.train.source.env.taskset.task.judges]]
|
||||
# [[orchestrator.train.env.taskset.task.judges]]
|
||||
# id = "rubric"
|
||||
# name = "rlm"
|
||||
# path = "deps/prime-envs/rubrics/rlm.toml"
|
||||
# path = "deps/research-environments/rubrics/rlm.toml"
|
||||
# model = "zai-org/GLM-5.2"
|
||||
# weight = 0.0
|
||||
|
||||
@@ -148,36 +142,36 @@ choices = ["A", "B"]
|
||||
[orchestrator.eval]
|
||||
interval = 20
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
[[orchestrator.eval.env]]
|
||||
name = "browsecomp"
|
||||
select.limit = 500 # full set is 1266; cap eval at 500
|
||||
env.agent.harness.id = "rlm"
|
||||
env.agent.harness.skills = ["search"]
|
||||
env.agent.harness.forward_env = ["SERPER_API_KEY"]
|
||||
env.agent.harness.compaction.summarize_at_tokens = 98304
|
||||
env.agent.runtime.labels = ["glm45air-search"]
|
||||
env.agent.timeout.rollout = 3600
|
||||
env.taskset.id = "browsecomp"
|
||||
env.taskset.task.judge.model = "Qwen/Qwen3-235B-A22B-Instruct-2507"
|
||||
num_examples = 500 # full set is 1266; cap eval at 500
|
||||
harness = { id = "rlm", skills = ["search"], forward_env = ["SERPER_API_KEY"], summarize_at_tokens = 98304, runtime = { type = "prime", vm = true, idle_timeout = "None", labels = ["glm45air-search"] } }
|
||||
timeout = { rollout = 3600 }
|
||||
|
||||
[orchestrator.eval.env.taskset]
|
||||
id = "browsecomp-v1"
|
||||
task = { judge = { model = "Qwen/Qwen3-235B-A22B-Instruct-2507" } }
|
||||
|
||||
# # Metric-only monitor (weight 0): rlm harness-mechanics rubric, judged by GLM-5.2.
|
||||
# [[orchestrator.eval.source.env.taskset.task.judges]]
|
||||
# [[orchestrator.eval.env.taskset.task.judges]]
|
||||
# id = "rubric"
|
||||
# name = "rlm"
|
||||
# path = "deps/prime-envs/rubrics/rlm.toml"
|
||||
# path = "deps/research-environments/rubrics/rlm.toml"
|
||||
# model = "zai-org/GLM-5.2"
|
||||
# weight = 0.0
|
||||
|
||||
# --- Inference ---
|
||||
|
||||
[inference]
|
||||
enable_return_routed_experts = true
|
||||
|
||||
# vLLM + FlashInfer caches on node-local /tmp.
|
||||
[inference.env_vars]
|
||||
VLLM_CACHE_ROOT = "/tmp/.vllm-cache"
|
||||
FLASHINFER_WORKSPACE_BASE = "/tmp/.flashinfer-cache"
|
||||
|
||||
[inference.vllm]
|
||||
[inference.model]
|
||||
max_model_len = 131072
|
||||
tensor_parallel_size = 8
|
||||
enable_return_routed_experts = true
|
||||
|
||||
[inference.parallel]
|
||||
tp = 8
|
||||
@@ -0,0 +1,133 @@
|
||||
# v1 RL: GLM-4.5-Air (100B MoE) on the v1 `scaleswe-v1` SWE taskset, rlm harness on a prime sandbox
|
||||
# runtime; eval on SWE-Bench Verified. Router replay is enabled (trainer.enable_router_replay replays
|
||||
# the routed-expert decisions returned by inference via enable_return_routed_experts) — GLM-4.5-Air is
|
||||
# a glm4_moe model, which supports routed_experts.
|
||||
#
|
||||
# GRPO uses the linear length penalty with the input-token and turns coefficients set to 0.1. Each
|
||||
# term is pass_rate-scaled and normalized by the group's own max before the GRPO baseline
|
||||
# subtraction.
|
||||
#
|
||||
# 2 train + 4 infer nodes. Trainer uses cp=8 (ulysses) plus
|
||||
# the memory improvements from the GLM-5.1 prod run (research-prod rlm5/prod.toml): LM-head token
|
||||
# chunking, activation checkpointing (freq=1) + activation offloading (max_inflight=1), optimizer
|
||||
# CPU offload, and skip-gather / skip-optimizer checkpointing. Derived from
|
||||
# configs/debug/v1/scaleswe.toml + GLM-4.5-Air model settings from the int5 opencode configs.
|
||||
|
||||
max_steps = 1000
|
||||
seq_len = 131072
|
||||
|
||||
# Redirect compile/JIT caches to node-local /tmp (per user + job) to avoid
|
||||
# slow/contended shared-FS caches and FS lock deadlocks.
|
||||
[env_vars]
|
||||
TRITON_CACHE_DIR = "/tmp/.triton-cache"
|
||||
|
||||
[slurm]
|
||||
job_name = "glm45air-swe"
|
||||
partition = "all"
|
||||
# Clean up this run's orphaned prime sandboxes before launch (hardcoded label, matches the harness labels below).
|
||||
pre_run_command = 'timeout 120 prime sandbox delete --label "glm45air-swe" -y || true'
|
||||
|
||||
[deployment]
|
||||
type = "multi_node"
|
||||
num_train_nodes = 2
|
||||
num_infer_nodes = 1
|
||||
num_infer_replicas = 4
|
||||
|
||||
[wandb]
|
||||
project = "swe-ablations"
|
||||
name = "glm45air-scaleswe"
|
||||
|
||||
[weight_broadcast]
|
||||
type = "nccl"
|
||||
timeout = 3600
|
||||
|
||||
[ckpt]
|
||||
interval = 50
|
||||
keep_last = 1
|
||||
resume_step = -1
|
||||
|
||||
[model]
|
||||
name = "zai-org/GLM-4.5-Air"
|
||||
|
||||
# --- Trainer ---
|
||||
|
||||
[trainer]
|
||||
dist_timeout_seconds = 3600
|
||||
enable_router_replay = true
|
||||
|
||||
[trainer.model]
|
||||
impl = "custom"
|
||||
attn = "flash_attention_3"
|
||||
cp = 8
|
||||
cp_style = "ulysses"
|
||||
fused_lm_head_token_chunk_size = 1024
|
||||
optim_cpu_offload = true
|
||||
|
||||
[trainer.model.ac]
|
||||
|
||||
[trainer.model.ac_offloading]
|
||||
max_inflight_activations = 1
|
||||
|
||||
[trainer.model.compile]
|
||||
|
||||
[trainer.ckpt]
|
||||
skip_gather_master_weights = true
|
||||
skip_optimizer = true
|
||||
|
||||
[trainer.optim]
|
||||
type = "muon"
|
||||
|
||||
# --- Orchestrator ---
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
group_size = 16
|
||||
max_off_policy_steps = 32
|
||||
max_inflight_rollouts = 512
|
||||
|
||||
[orchestrator.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.algo.length_penalty]
|
||||
type = "linear"
|
||||
num_output_tokens_weight = 0.0
|
||||
num_input_tokens_weight = 0.1
|
||||
num_turns_weight = 0.1
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "glm-4.5"
|
||||
thinking_retention = "all"
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "scaleswe"
|
||||
taskset = { id = "scaleswe-v1", use_prime_registry = true }
|
||||
harness = { id = "rlm", summarize_at_tokens = [65536, 131072], runtime = { type = "prime", vm = true, idle_timeout = "None", labels = ["glm45air-swe"] } }
|
||||
|
||||
[orchestrator.prime_monitor]
|
||||
|
||||
# --- Eval: SWE-Bench Verified at step 0 + 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", summarize_at_tokens = 98304, runtime = { type = "prime", vm = true, idle_timeout = "None", labels = ["glm45air-swe"] } }
|
||||
timeout = { rollout = 3600 }
|
||||
|
||||
# --- Inference ---
|
||||
|
||||
[inference]
|
||||
enable_return_routed_experts = true
|
||||
|
||||
# vLLM + FlashInfer caches on node-local /tmp (see [env_vars]).
|
||||
[inference.env_vars]
|
||||
VLLM_CACHE_ROOT = "/tmp/.vllm-cache"
|
||||
FLASHINFER_WORKSPACE_BASE = "/tmp/.flashinfer-cache"
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 131072
|
||||
|
||||
[inference.parallel]
|
||||
tp = 8
|
||||
@@ -22,7 +22,7 @@ num_train_nodes = 2
|
||||
num_infer_nodes = 1
|
||||
num_infer_replicas = 4
|
||||
|
||||
[monitors.wandb]
|
||||
[wandb]
|
||||
project = "terminal-ablations"
|
||||
name = "glm45air-terminal"
|
||||
|
||||
@@ -33,8 +33,7 @@ timeout = 3600
|
||||
[ckpt]
|
||||
interval = 50
|
||||
keep_last = 1
|
||||
|
||||
[resume]
|
||||
resume_step = -1
|
||||
|
||||
[model]
|
||||
name = "zai-org/GLM-4.5-Air"
|
||||
@@ -48,9 +47,10 @@ enable_router_replay = true
|
||||
[trainer.model]
|
||||
impl = "custom"
|
||||
attn = "flash_attention_3"
|
||||
cp = 4
|
||||
cp = 8
|
||||
cp_style = "ulysses"
|
||||
fused_lm_head_token_chunk_size = 1024
|
||||
optim_cpu_offload = true
|
||||
|
||||
[trainer.model.ac]
|
||||
|
||||
@@ -60,6 +60,7 @@ max_inflight_activations = 1
|
||||
[trainer.model.compile]
|
||||
|
||||
[trainer.ckpt]
|
||||
skip_gather_master_weights = true
|
||||
skip_optimizer = true
|
||||
|
||||
[trainer.optim]
|
||||
@@ -69,49 +70,46 @@ type = "muon"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
initial_inflight = 256
|
||||
max_inflight = 512
|
||||
max_off_policy_steps = 32
|
||||
max_inflight_rollouts = 512
|
||||
|
||||
[orchestrator.renderer]
|
||||
name = "glm-4.5"
|
||||
thinking_retention = "all"
|
||||
|
||||
[orchestrator.train.algo]
|
||||
[orchestrator.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.train.algo.length_penalty]
|
||||
[orchestrator.algo.length_penalty]
|
||||
type = "linear"
|
||||
num_output_tokens_weight = 0.0
|
||||
num_input_tokens_weight = 0.1
|
||||
num_turns_weight = 0.1
|
||||
|
||||
[orchestrator.prime_monitor]
|
||||
|
||||
# --- Train: tmax (per-task Docker image in a prime sandbox, rlm ipython) ---
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
[[orchestrator.train.env]]
|
||||
name = "tmax"
|
||||
env.agent.harness.id = "rlm"
|
||||
env.agent.harness.compaction.summarize_at_tokens = 98304
|
||||
env.agent.runtime.labels = ["glm45air-terminal"]
|
||||
env.taskset.id = "tmax"
|
||||
harness = { id = "rlm", summarize_at_tokens = [65536, 131072], runtime = { type = "prime", vm = true, idle_timeout = "None", labels = ["glm45air-terminal"] } }
|
||||
|
||||
[orchestrator.train.env.taskset]
|
||||
id = "tmax-v1"
|
||||
|
||||
# # Metric-only monitors (weight 0): rlm harness-mechanics + swe code-usage rubrics, judged by GLM-5.2.
|
||||
# [[orchestrator.train.source.env.taskset.judges]]
|
||||
# [[orchestrator.train.env.taskset.judges]]
|
||||
# id = "rubric"
|
||||
# name = "rlm"
|
||||
# path = "deps/prime-envs/rubrics/rlm.toml"
|
||||
# path = "deps/research-environments/rubrics/rlm.toml"
|
||||
# model = "zai-org/GLM-5.2"
|
||||
# weight = 0.0
|
||||
|
||||
# [[orchestrator.train.source.env.taskset.judges]]
|
||||
# [[orchestrator.train.env.taskset.judges]]
|
||||
# id = "rubric"
|
||||
# name = "swe"
|
||||
# path = "deps/prime-envs/rubrics/swe.toml"
|
||||
# path = "deps/research-environments/rubrics/swe.toml"
|
||||
# model = "zai-org/GLM-5.2"
|
||||
# weight = 0.0
|
||||
|
||||
@@ -120,59 +118,64 @@ env.taskset.id = "tmax"
|
||||
[orchestrator.eval]
|
||||
interval = 20
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
[[orchestrator.eval.env]]
|
||||
name = "swebench-verified"
|
||||
env.agent.harness.id = "rlm"
|
||||
env.agent.harness.compaction.summarize_at_tokens = 98304
|
||||
env.agent.runtime.labels = ["glm45air-terminal"]
|
||||
env.agent.timeout.rollout = 3600
|
||||
env.taskset.id = "swebench-verified"
|
||||
# [[orchestrator.eval.source.env.taskset.judges]]
|
||||
harness = { id = "rlm", summarize_at_tokens = 98304, runtime = { type = "prime", vm = true, idle_timeout = "None", labels = ["glm45air-terminal"] } }
|
||||
timeout = { rollout = 3600 }
|
||||
|
||||
[orchestrator.eval.env.taskset]
|
||||
id = "swebench-verified-v1"
|
||||
use_prime_registry = true
|
||||
|
||||
# [[orchestrator.eval.env.taskset.judges]]
|
||||
# id = "rubric"
|
||||
# name = "rlm"
|
||||
# path = "deps/prime-envs/rubrics/rlm.toml"
|
||||
# model = "zai-org/GLM-5.2"
|
||||
# weight = 0.0
|
||||
# [[orchestrator.eval.source.env.taskset.judges]]
|
||||
# id = "rubric"
|
||||
# name = "swe"
|
||||
# path = "deps/prime-envs/rubrics/swe.toml"
|
||||
# path = "deps/research-environments/rubrics/rlm.toml"
|
||||
# model = "zai-org/GLM-5.2"
|
||||
# weight = 0.0
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
# [[orchestrator.eval.env.taskset.judges]]
|
||||
# id = "rubric"
|
||||
# name = "swe"
|
||||
# path = "deps/research-environments/rubrics/swe.toml"
|
||||
# model = "zai-org/GLM-5.2"
|
||||
# weight = 0.0
|
||||
|
||||
[[orchestrator.eval.env]]
|
||||
name = "terminal-bench-2"
|
||||
group_size = 4 # avg@4
|
||||
env.agent.harness.id = "rlm"
|
||||
env.agent.harness.compaction.summarize_at_tokens = 98304
|
||||
env.agent.runtime.labels = ["glm45air-terminal"]
|
||||
env.agent.timeout.rollout = 3600
|
||||
env.taskset.id = "terminal-bench-2"
|
||||
harness = { id = "rlm", summarize_at_tokens = 98304, runtime = { type = "prime", vm = true, idle_timeout = "None", labels = ["glm45air-terminal"] } }
|
||||
timeout = { rollout = 3600 }
|
||||
|
||||
# [[orchestrator.eval.source.env.taskset.judges]]
|
||||
[orchestrator.eval.env.taskset]
|
||||
id = "terminal-bench-2-v1"
|
||||
|
||||
# [[orchestrator.eval.env.taskset.judges]]
|
||||
# id = "rubric"
|
||||
# name = "rlm"
|
||||
# path = "deps/prime-envs/rubrics/rlm.toml"
|
||||
# path = "deps/research-environments/rubrics/rlm.toml"
|
||||
# model = "zai-org/GLM-5.2"
|
||||
# weight = 0.0
|
||||
|
||||
# [[orchestrator.eval.source.env.taskset.judges]]
|
||||
# [[orchestrator.eval.env.taskset.judges]]
|
||||
# id = "rubric"
|
||||
# name = "swe"
|
||||
# path = "deps/prime-envs/rubrics/swe.toml"
|
||||
# path = "deps/research-environments/rubrics/swe.toml"
|
||||
# model = "zai-org/GLM-5.2"
|
||||
# weight = 0.0
|
||||
|
||||
# --- Inference ---
|
||||
|
||||
[inference]
|
||||
enable_return_routed_experts = true
|
||||
|
||||
# vLLM + FlashInfer caches on node-local /tmp.
|
||||
[inference.env_vars]
|
||||
VLLM_CACHE_ROOT = "/tmp/.vllm-cache"
|
||||
FLASHINFER_WORKSPACE_BASE = "/tmp/.flashinfer-cache"
|
||||
|
||||
[inference.vllm]
|
||||
[inference.model]
|
||||
max_model_len = 131072
|
||||
tensor_parallel_size = 8
|
||||
enable_return_routed_experts = true
|
||||
|
||||
[inference.parallel]
|
||||
tp = 8
|
||||
+20
-36
@@ -2,13 +2,26 @@
|
||||
# Step 3 / goal target. Topology mirrors the proven original glm5.1_llmd_inference
|
||||
# (job 348 succeeded): 8 prefill nodes (4 replicas x 2) + 8 decode nodes (1 replica).
|
||||
#
|
||||
# Launch: uv run inference @ examples/advanced/glm-5.3/infer/pd-llmd.toml
|
||||
# Launch: uv run inference @ configs/glm5.2_16node_llmd/inference.toml
|
||||
|
||||
output_dir = "/shared/outputs/glm5.2-16node-llmd"
|
||||
|
||||
enable_expert_parallel = true
|
||||
gpu_memory_utilization = 0.75
|
||||
enable_eplb = false
|
||||
use_deep_gemm = true
|
||||
enable_fp32_lm_head = true
|
||||
|
||||
[model]
|
||||
name = "zai-org/GLM-5.2-FP8"
|
||||
max_model_len = 91000
|
||||
tool_call_parser = "glm47"
|
||||
reasoning_parser = "glm45"
|
||||
|
||||
[vllm_extra]
|
||||
enable_ep_weight_filter = true
|
||||
safetensors_load_strategy = "prefetch"
|
||||
|
||||
[kv_cache_offload]
|
||||
type = "mooncake"
|
||||
device_name = "mlx5_0,mlx5_3,mlx5_4,mlx5_5,mlx5_6,mlx5_9,mlx5_10,mlx5_11"
|
||||
@@ -22,45 +35,16 @@ prefill_nodes_per_replica = 2
|
||||
num_prefill_replicas = 4
|
||||
decode_nodes_per_replica = 8
|
||||
num_decode_replicas = 1
|
||||
prefill_env_vars = {"VLLM_ENABLE_MOE_DP_CHUNK"="0", "VLLM_DEEP_GEMM_WARMUP"="skip", "UCX_RCACHE_MAX_UNRELEASED"="1024"}
|
||||
decode_env_vars = {"VLLM_DEEP_GEMM_WARMUP"="skip", "UCX_RCACHE_MAX_UNRELEASED"="1024"}
|
||||
|
||||
[deployment.prefill_env_vars]
|
||||
# vLLM >= 0.29 auto-enables breakable CUDA graphs for GLM-5 (GlmMoeDsaForCausalLM); capturing
|
||||
# the DeepEP high-throughput prefill dispatch then fails ("DeepEP error: timeout (dispatch CPU)").
|
||||
"VLLM_USE_BREAKABLE_CUDAGRAPH" = "0"
|
||||
"VLLM_ENABLE_MOE_DP_CHUNK" = "0"
|
||||
"VLLM_DEEP_GEMM_WARMUP" = "skip"
|
||||
"UCX_RCACHE_MAX_UNRELEASED" = "1024"
|
||||
|
||||
[deployment.decode_env_vars]
|
||||
"VLLM_DEEP_GEMM_WARMUP" = "skip"
|
||||
"UCX_RCACHE_MAX_UNRELEASED" = "1024"
|
||||
|
||||
[router]
|
||||
[deployment.router]
|
||||
type = "llm-d"
|
||||
scorers = { "prefix-cache-scorer" = 3.0 }
|
||||
prefill_scorer_overrides = { "queue-scorer" = 4.0, "active-request-scorer" = 5.0 }
|
||||
decode_scorer_overrides = { "active-request-scorer" = 5.0, "kv-cache-utilization-scorer" = 4.0, "queue-scorer" = 3.0 }
|
||||
non_cached_tokens = 128
|
||||
|
||||
[router.scorers]
|
||||
"prefix-cache-scorer" = 3.0
|
||||
|
||||
[router.prefill_scorer_overrides]
|
||||
"queue-scorer" = 4.0
|
||||
"active-request-scorer" = 5.0
|
||||
|
||||
[router.decode_scorer_overrides]
|
||||
"active-request-scorer" = 5.0
|
||||
"kv-cache-utilization-scorer" = 4.0
|
||||
"queue-scorer" = 3.0
|
||||
|
||||
[slurm]
|
||||
job_name = "glm5.2-16node-llmd"
|
||||
partition = "all"
|
||||
|
||||
[vllm]
|
||||
model = "zai-org/GLM-5.2-FP8"
|
||||
max_model_len = 91000
|
||||
tool_call_parser = "glm47"
|
||||
reasoning_parser = "glm45"
|
||||
gpu_memory_utilization = 0.75
|
||||
enable_expert_parallel = true
|
||||
enable_eplb = false
|
||||
safetensors_load_strategy = "prefetch"
|
||||
+8
-13
@@ -1,4 +1,12 @@
|
||||
enable_expert_parallel = true
|
||||
enable_eplb = false
|
||||
use_deep_gemm = true
|
||||
gpu_memory_utilization = 0.85
|
||||
|
||||
[model]
|
||||
name = "zai-org/GLM-5-FP8"
|
||||
tool_call_parser = "auto"
|
||||
reasoning_parser = "glm45"
|
||||
|
||||
[deployment]
|
||||
type = "disaggregated"
|
||||
@@ -6,19 +14,6 @@ prefill_nodes_per_replica = 4
|
||||
decode_nodes_per_replica = 2
|
||||
gpus_per_node = 8
|
||||
|
||||
[deployment.prefill_env_vars]
|
||||
# vLLM >= 0.29 auto-enables breakable CUDA graphs for GLM-5 (GlmMoeDsaForCausalLM); capturing
|
||||
# the DeepEP high-throughput prefill dispatch then fails ("DeepEP error: timeout (dispatch CPU)").
|
||||
"VLLM_USE_BREAKABLE_CUDAGRAPH" = "0"
|
||||
|
||||
[slurm]
|
||||
job_name = "glm5"
|
||||
partition = "cluster"
|
||||
|
||||
[vllm]
|
||||
model = "zai-org/GLM-5-FP8"
|
||||
tool_call_parser = "auto"
|
||||
reasoning_parser = "glm45"
|
||||
gpu_memory_utilization = 0.85
|
||||
enable_expert_parallel = true
|
||||
enable_eplb = false
|
||||
@@ -0,0 +1,83 @@
|
||||
# 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
|
||||
|
||||
Install the environment:
|
||||
|
||||
```bash
|
||||
prime env install primeintellect/math-env
|
||||
```
|
||||
|
||||
Verify installation:
|
||||
|
||||
```bash
|
||||
uv run python -c "import math_env"
|
||||
```
|
||||
|
||||
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 math-env \
|
||||
-a '{"dataset_name": "openai/gsm8k", "dataset_subset": "main"}' \
|
||||
-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 math-env \
|
||||
-a '{"dataset_name": "openai/gsm8k", "dataset_subset": "main"}' \
|
||||
-m <user>/Qwen3-0.6B-GSM8K-RL \
|
||||
-b http://localhost:8000/v1 \
|
||||
-n 20 \
|
||||
-t 2048
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user