Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b878abdb8e | ||
|
|
abb8a2a996 | ||
|
|
6f7f8c0b2a | ||
|
|
560cf1a86b |
@@ -1 +0,0 @@
|
||||
../skills
|
||||
@@ -1,12 +0,0 @@
|
||||
.git
|
||||
**/.git
|
||||
outputs
|
||||
**/.venv
|
||||
**/__pycache__
|
||||
**/*.py[cod]
|
||||
**/.pytest_cache
|
||||
**/.ruff_cache
|
||||
**/.mypy_cache
|
||||
.claude
|
||||
.vscode
|
||||
*.ipynb
|
||||
@@ -0,0 +1,252 @@
|
||||
name: Trainer Benchmarks
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
set_baselines:
|
||||
description: "Save results as new baselines"
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
image:
|
||||
description: "Docker image to use for benchmarks"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-matrix:
|
||||
name: Build benchmark matrix
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.build.outputs.matrix }}
|
||||
steps:
|
||||
- name: Build matrix
|
||||
id: build
|
||||
run: |
|
||||
matrix='{"include":[
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xa6000","num_gpus":1,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xa6000","num_gpus":1,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_3","ac":"Offload","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xa6000","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xa6000","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Offload","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xa6000","num_gpus":1,"type":"sft","lora_rank":null,"seq_len":8192,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"sft","lora_rank":null,"seq_len":8192,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"sft","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"1xa6000","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Offload","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Offload","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"sft","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"sft","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"sft","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"sft","lora_rank":null,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":2,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":4,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":8,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"sft","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"sft","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
|
||||
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Offload","cp":1,"ep":1,"timeout_minutes":60},
|
||||
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":60},
|
||||
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":60},
|
||||
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_2","ac":"Offload","cp":1,"ep":1,"timeout_minutes":60},
|
||||
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Offload","cp":1,"ep":1,"timeout_minutes":60},
|
||||
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_2","ac":"Offload","cp":1,"ep":1,"timeout_minutes":60},
|
||||
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":60},
|
||||
{"model":"Qwen/Qwen3-235B-A22B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":120},
|
||||
{"model":"Qwen/Qwen3-235B-A22B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Offload","cp":1,"ep":1,"timeout_minutes":120},
|
||||
{"model":"Qwen/Qwen3-235B-A22B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":2,"ep":1,"timeout_minutes":120},
|
||||
{"model":"Qwen/Qwen3-235B-A22B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":2,"timeout_minutes":120}
|
||||
]}'
|
||||
echo "matrix=$(echo "$matrix" | jq -c .)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
get-image-digest:
|
||||
name: Get image digest
|
||||
runs-on: 1xa6000
|
||||
outputs:
|
||||
image_with_digest: ${{ steps.digest.outputs.image_with_digest }}
|
||||
steps:
|
||||
- name: Get image digest
|
||||
id: digest
|
||||
run: |
|
||||
docker pull "${{ inputs.image }}"
|
||||
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' "${{ inputs.image }}")
|
||||
echo "image_with_digest=${DIGEST}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
run-benchmark:
|
||||
name: "${{ matrix.model }} (${{ matrix.type }}${{ matrix.lora_rank && format(' r={0}', matrix.lora_rank) || '' }}) on ${{ matrix.runner }}"
|
||||
needs: [build-matrix, get-image-digest]
|
||||
runs-on: ${{ matrix.runner }}
|
||||
container:
|
||||
image: ${{ needs.get-image-digest.outputs.image_with_digest }}
|
||||
options: --gpus all --shm-size=16g --user root --entrypoint bash -v huggingface_cache:/huggingface_cache
|
||||
env:
|
||||
HF_HOME: /huggingface_cache
|
||||
PYTORCH_CUDA_ALLOC_CONF: expandable_segments:True
|
||||
PRIME_DIST__TIMEOUT__SECONDS: 3600
|
||||
defaults:
|
||||
run:
|
||||
working-directory: /app
|
||||
timeout-minutes: ${{ matrix.timeout_minutes }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJSON(needs.build-matrix.outputs.matrix) }}
|
||||
steps:
|
||||
- name: Clean HF cache locks and fix permissions
|
||||
run: |
|
||||
# Remove stale lock files from interrupted downloads
|
||||
find /huggingface_cache -name "*.lock" -type f -delete 2>/dev/null || true
|
||||
# Ensure cache directory exists and is writable
|
||||
mkdir -p /huggingface_cache/hub
|
||||
chmod -R u+rw /huggingface_cache 2>/dev/null || true
|
||||
- name: Run benchmark
|
||||
run: |
|
||||
python benchmarks/scripts/run_single_benchmark.py \
|
||||
--type "${{ matrix.type }}" \
|
||||
--num-gpus "${{ matrix.num_gpus }}" \
|
||||
--model-name "${{ matrix.model }}" \
|
||||
${{ matrix.lora_rank && format('--lora-rank {0}', matrix.lora_rank) || '' }} \
|
||||
--seq-len "${{ matrix.seq_len }}" \
|
||||
--ac "${{ matrix.ac }}" \
|
||||
--attention "${{ matrix.attention }}" \
|
||||
--cp "${{ matrix.cp }}" \
|
||||
--ep "${{ matrix.ep }}" \
|
||||
--output "/tmp/benchmark_result.json" \
|
||||
--docker-image "${{ needs.get-image-digest.outputs.image_with_digest }}" \
|
||||
--timeout $(( (${{ matrix.timeout_minutes }} - 5) * 60 ))
|
||||
- name: Set artifact name
|
||||
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@v5
|
||||
if: always()
|
||||
with:
|
||||
name: ${{ steps.artifact.outputs.name }}
|
||||
path: /tmp/benchmark_result.json
|
||||
retention-days: 30
|
||||
|
||||
aggregate-and-report:
|
||||
name: Aggregate results and create PR
|
||||
needs: run-benchmark
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout repository # We can't use the image because then no git
|
||||
uses: actions/checkout@v5
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Install dependencies
|
||||
run: uv sync
|
||||
- name: Download all benchmark artifacts
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
path: /tmp/benchmark_artifacts
|
||||
pattern: benchmark-*
|
||||
- name: Aggregate results
|
||||
id: aggregate
|
||||
run: |
|
||||
mkdir -p benchmarks/baselines
|
||||
uv run python benchmarks/scripts/aggregate_results.py \
|
||||
--artifacts-dir "/tmp/benchmark_artifacts" \
|
||||
--baselines-dir "benchmarks/baselines" \
|
||||
--output-markdown "benchmarks/results/BENCHMARKS.md" \
|
||||
--regression-threshold 0.05
|
||||
|
||||
if [ -f /tmp/prime-rl-benchmark-aggregate-has-regressions ]; then
|
||||
echo "has_regressions=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "has_regressions=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
- name: Set baselines from artifacts
|
||||
if: ${{ github.event.inputs.set_baselines == 'true' }}
|
||||
run: |
|
||||
rm -f benchmarks/baselines/*.json
|
||||
for dir in /tmp/benchmark_artifacts/*/; do
|
||||
name=$(basename "$dir")
|
||||
cp "$dir/benchmark_result.json" "benchmarks/baselines/${name}.json"
|
||||
done
|
||||
- name: Set benchmark metadata (date + unique branch)
|
||||
run: |
|
||||
BENCHMARK_DATE="$(date +%Y-%m-%d)"
|
||||
echo "BENCHMARK_DATE=${BENCHMARK_DATE}" >> "$GITHUB_ENV"
|
||||
echo "BENCHMARK_BRANCH=benchmark-results-${BENCHMARK_DATE}-${{ github.run_id }}" >> "$GITHUB_ENV"
|
||||
- name: Create PR branch and commit
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git checkout -b "$BENCHMARK_BRANCH"
|
||||
git add benchmarks/results/BENCHMARKS.md
|
||||
${{ github.event.inputs.set_baselines == 'true' && 'git add benchmarks/baselines/' || 'true' }}
|
||||
git commit -m "Update benchmark results $(date +%Y-%m-%d)" || echo "No changes to commit"
|
||||
git push origin "$BENCHMARK_BRANCH" --force
|
||||
- name: Create Pull Request
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
if [ "${{ steps.aggregate.outputs.has_regressions }}" = "true" ]; then
|
||||
WARNING="> :warning: **Performance regressions detected!** Please review the results carefully."
|
||||
else
|
||||
WARNING="> :white_check_mark: No regressions detected."
|
||||
fi
|
||||
|
||||
PR_BODY_FILE="/tmp/benchmark_pr_body.md"
|
||||
cat > "${PR_BODY_FILE}" <<EOF
|
||||
## Nightly Benchmark Results
|
||||
|
||||
**Run ID:** ${{ github.run_id }}
|
||||
**Date:** ${BENCHMARK_DATE}
|
||||
**Regression Detected:** ${{ steps.aggregate.outputs.has_regressions }}
|
||||
|
||||
${WARNING}
|
||||
|
||||
---
|
||||
## Results (\`benchmarks/results/BENCHMARKS.md\`)
|
||||
|
||||
EOF
|
||||
cat benchmarks/results/BENCHMARKS.md >> "${PR_BODY_FILE}"
|
||||
cat >> "${PR_BODY_FILE}" <<'EOF'
|
||||
|
||||
---
|
||||
*This PR was automatically generated by the nightly benchmark workflow.*
|
||||
EOF
|
||||
|
||||
gh pr create \
|
||||
--base main \
|
||||
--head "$BENCHMARK_BRANCH" \
|
||||
--title "[Benchmarks] Nightly performance results - ${BENCHMARK_DATE}" \
|
||||
--body-file "${PR_BODY_FILE}" \
|
||||
|| echo "PR already exists"
|
||||
@@ -1,6 +1,8 @@
|
||||
name: Image
|
||||
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
|
||||
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
|
||||
needs: authorize
|
||||
name: Prepare build
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -103,7 +71,7 @@ jobs:
|
||||
esac
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v5
|
||||
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
|
||||
|
||||
@@ -149,7 +114,7 @@ jobs:
|
||||
echo "platforms=${PLATFORMS}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build:
|
||||
name: Build (${{ matrix.suffix }})
|
||||
name: Build and push (${{ matrix.suffix }})
|
||||
needs: prepare
|
||||
strategy:
|
||||
fail-fast: true
|
||||
@@ -161,18 +126,12 @@ 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@v5
|
||||
with:
|
||||
ref: ${{ needs.prepare.outputs.full_sha }}
|
||||
ref: ${{ needs.prepare.outputs.ref }}
|
||||
fetch-depth: 0
|
||||
submodules: false
|
||||
|
||||
@@ -180,7 +139,7 @@ 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
|
||||
@@ -192,71 +151,17 @@ jobs:
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
with:
|
||||
# CVE-2026-93318: pin the BuildKit builder to the patched release so
|
||||
# the version is deterministic on the self-hosted runners (otherwise
|
||||
# the rolling moby/buildkit:buildx-stable-1 tag is used, and a
|
||||
# persistent runner may keep a stale local copy of it).
|
||||
driver-opts: image=moby/buildkit:v0.33.1@sha256:cec9f139f45e93c5c69c60f8b07cfad9f43f4ef6b6a6cd917527fea5ff2e3dea
|
||||
|
||||
- name: Set up uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
version: "0.11.9"
|
||||
enable-cache: false
|
||||
|
||||
- name: Resolve dependency image and package versions
|
||||
id: dependency
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
SUFFIX: ${{ matrix.suffix }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
key=$(uv run --no-project --python 3.12 scripts/docker_dependencies.py fingerprint .)
|
||||
# deps-v2: remediation epoch for CVE-2026-93318 — the fingerprint
|
||||
# hashes only Dockerfile/lock inputs, not the workflow or BuildKit
|
||||
# version, so pre-fix deps-${key} images would otherwise be reused
|
||||
# as the runtime base instead of being rebuilt by the pinned v0.33.1
|
||||
# builder.
|
||||
image="${REGISTRY}/${IMAGE_NAME}:deps-${key}-v2-${SUFFIX}"
|
||||
digest=$(uv run --no-project --python 3.12 scripts/docker_dependencies.py resolve "$image")
|
||||
echo "image=${image}" >> "$GITHUB_OUTPUT"
|
||||
echo "digest=${digest}" >> "$GITHUB_OUTPUT"
|
||||
bash scripts/docker-editable-pretend-versions.sh --github-output . >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build and push dependencies
|
||||
id: dependencies
|
||||
if: steps.dependency.outputs.digest == ''
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile.cuda
|
||||
target: dependencies
|
||||
outputs: type=image,push=true,compression=zstd,compression-level=3
|
||||
# buildcache-v2: rotated 2026-10-05 for CVE-2026-93318 — the pre-v0.33.1
|
||||
# builders (cache writers since 2026-08-16) must not be re-imported.
|
||||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dependency-buildcache-v2-${{ matrix.suffix }}
|
||||
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dependency-buildcache-v2-${{ matrix.suffix }},mode=max,image-manifest=true,oci-mediatypes=true,compression=zstd,compression-level=3
|
||||
platforms: ${{ matrix.platform }}
|
||||
tags: ${{ steps.dependency.outputs.image }}
|
||||
|
||||
- name: Build and push
|
||||
id: build
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile.cuda
|
||||
target: runtime
|
||||
build-args: |
|
||||
DEPENDENCY_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.dependencies.outputs.digest || steps.dependency.outputs.digest }}
|
||||
VERIFIERS_PRETEND_VERSION=${{ steps.dependency.outputs.verifiers }}
|
||||
RENDERERS_PRETEND_VERSION=${{ steps.dependency.outputs.renderers }}
|
||||
PYDANTIC_CONFIG_PRETEND_VERSION=${{ steps.dependency.outputs.pydantic_config }}
|
||||
outputs: type=image,push=true,compression=zstd,compression-level=3
|
||||
# buildcache-v2: rotated 2026-10-05 for CVE-2026-93318 — the pre-v0.33.1
|
||||
# builders (cache writers since 2026-08-16) must not be re-imported.
|
||||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:application-buildcache-v2-${{ matrix.suffix }}
|
||||
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:application-buildcache-v2-${{ matrix.suffix }},mode=max,image-manifest=true,oci-mediatypes=true,compression=zstd,compression-level=3
|
||||
# This experiment tag derives from the immutable current-main arm64
|
||||
# image and only bakes the pinned NVFP4 runtime. Main still uses
|
||||
# Dockerfile.cuda; this workflow change exists solely on the tag.
|
||||
file: ./Dockerfile.nvfp4-e2e-overlay
|
||||
push: true
|
||||
platforms: ${{ matrix.platform }}
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.prepare.outputs.tag }}-${{ matrix.suffix }}
|
||||
@@ -272,8 +177,6 @@ jobs:
|
||||
IMAGE_TAG: ${{ needs.prepare.outputs.tag }}
|
||||
IMAGE_SHA: ${{ needs.prepare.outputs.sha }}
|
||||
IMAGE_DIGEST: ${{ steps.build.outputs.digest }}
|
||||
DEPENDENCY_IMAGE: ${{ steps.dependency.outputs.image }}
|
||||
DEPENDENCY_DIGEST: ${{ steps.dependencies.outputs.digest || steps.dependency.outputs.digest }}
|
||||
PLATFORM: ${{ matrix.platform }}
|
||||
SUFFIX: ${{ matrix.suffix }}
|
||||
run: |
|
||||
@@ -287,11 +190,10 @@ jobs:
|
||||
echo "| **Image** | \`${REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}-${SUFFIX}\` |"
|
||||
echo "| **Commit** | \`${IMAGE_SHA}\` |"
|
||||
echo "| **Digest** | \`${IMAGE_DIGEST}\` |"
|
||||
echo "| **Dependencies** | \`${DEPENDENCY_IMAGE}@${DEPENDENCY_DIGEST}\` |"
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
manifest:
|
||||
name: Manifest
|
||||
name: Create multi-arch manifest
|
||||
needs: [prepare, build]
|
||||
if: needs.prepare.outputs.platforms == 'both'
|
||||
runs-on: ubuntu-latest
|
||||
@@ -0,0 +1,108 @@
|
||||
name: CPU Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
name: Unit tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
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: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Install dependencies
|
||||
run: uv sync --extra flash-attn --all-packages --locked
|
||||
- name: Run tests
|
||||
env:
|
||||
USERNAME_CI: CI_RUNNER
|
||||
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
|
||||
# Set WANDB_MODE to online only if WANDB_API_KEY is available, otherwise set to offline
|
||||
# This is to allow running tests on forks without WANDB_API_KEY
|
||||
WANDB_MODE: ${{ secrets.WANDB_API_KEY && 'online' || 'offline' }}
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
PRIME_API_KEY: ${{ secrets.PRIME_API_KEY }}
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||
PYTEST_OUTPUT_DIR: /tmp/outputs
|
||||
run: PYTEST_OUTPUT_DIR=/tmp/outputs uv run pytest tests/unit -m "not gpu"
|
||||
- name: Cleanup output_dir
|
||||
run: rm -rf /tmp/outputs
|
||||
|
||||
slim-configs-install:
|
||||
name: Slim install (prime-rl-configs only)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Build the slim wheel
|
||||
run: uv build --wheel ./packages/prime-rl-configs --out-dir /tmp/slim-wheel
|
||||
- name: Install slim wheel from a directory with no workspace context
|
||||
# Build the wheel and install it from /tmp so uv can't discover the
|
||||
# repo's root pyproject.toml [tool.uv.sources] and silently apply
|
||||
# them. This mirrors what an external pip-only user gets.
|
||||
run: |
|
||||
uv venv --python 3.12 /tmp/slim
|
||||
cd /tmp && uv pip install --python /tmp/slim/bin/python /tmp/slim-wheel/*.whl
|
||||
- name: Verify configs import without heavy deps
|
||||
run: |
|
||||
/tmp/slim/bin/python - <<'PY'
|
||||
import sys
|
||||
|
||||
from prime_rl.configs.rl import RLConfig
|
||||
from prime_rl.configs.sft import SFTConfig
|
||||
from prime_rl.configs.inference import InferenceConfig
|
||||
from prime_rl.configs.orchestrator import OrchestratorConfig
|
||||
from prime_rl.configs.trainer import TrainerConfig
|
||||
from prime_rl.configs.env_server import EnvServerConfig
|
||||
from prime_rl.utils.config import BaseConfig, find_package_resource, rgetattr, rsetattr
|
||||
from prime_rl.utils.validation import validate_shared_ckpt_config
|
||||
|
||||
# `verifiers` (+ its `datasets` dep) is a declared slim dep: the v1 config types
|
||||
# (EnvConfig, Task, ...) extend verifiers.v1, which is pure-pydantic and pulls no
|
||||
# GPU/ML deps. We still forbid the actual heavy training deps below.
|
||||
forbidden = ["torch", "transformers", "vllm", "wandb", "ring_flash_attn",
|
||||
"prime", "liger_kernel", "loguru"]
|
||||
leaked = [m for m in forbidden if m in sys.modules]
|
||||
if leaked:
|
||||
raise SystemExit(f"slim install leaked heavy deps into sys.modules: {leaked}")
|
||||
|
||||
# Slim wheel does not ship the templates/ data dir; resolver returns None.
|
||||
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
|
||||
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.
|
||||
for cfg_cls, args in [
|
||||
(SFTConfig, ["@", "configs/ci/slim_sft.toml"]),
|
||||
]:
|
||||
cfg = cli(cfg_cls, args=args)
|
||||
assert cfg.slurm is not None, f"expected [slurm] in {args}"
|
||||
# On slim, template_path can't be auto-resolved (heavy wheel absent) — must stay None.
|
||||
assert cfg.slurm.template_path is None, f"unexpected template_path on slim: {cfg.slurm.template_path}"
|
||||
print("slim parse OK")
|
||||
PY
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Prerelease
|
||||
name: DevX Tag
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -15,11 +15,12 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
create-dev-tag:
|
||||
name: Create .dev tag
|
||||
if: github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create next .dev tag from latest release
|
||||
uses: actions/github-script@v9
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
const { owner, repo } = context.repo;
|
||||
@@ -93,13 +94,13 @@ jobs:
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner,
|
||||
repo,
|
||||
workflow_id: "image.yml",
|
||||
workflow_id: "build_image.yaml",
|
||||
ref: "main",
|
||||
inputs: { ref: tag, tag, platforms: "both" },
|
||||
});
|
||||
core.notice(`Dispatched image.yml for ${tag}`);
|
||||
core.notice(`Dispatched build_image.yaml for ${tag}`);
|
||||
} catch (error) {
|
||||
core.setFailed(`Failed to dispatch image.yml: ${error.message}`);
|
||||
core.setFailed(`Failed to dispatch build_image.yaml: ${error.message}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
name: GPU Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [labeled]
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: >-
|
||||
${{ github.workflow }}-${{
|
||||
(github.event_name == 'pull_request'
|
||||
&& github.event.pull_request.head.repo.full_name == github.repository
|
||||
&& github.event.label.name == 'gpu-ci')
|
||||
&& format('pr-{0}', github.event.pull_request.number)
|
||||
|| format('{0}-{1}', github.event_name, github.run_id) }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
gate:
|
||||
name: Gate
|
||||
runs-on: ubuntu-latest
|
||||
if: >-
|
||||
github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||
|| (github.event.pull_request.head.repo.full_name == github.repository
|
||||
&& github.event.label.name == 'gpu-ci')
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Remove gpu-ci label
|
||||
if: github.event_name == 'pull_request'
|
||||
continue-on-error: true
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run: gh api -X DELETE "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels/gpu-ci"
|
||||
|
||||
unit-gpu:
|
||||
name: Unit (GPU)
|
||||
needs: gate
|
||||
runs-on: prime-rl-2xh200
|
||||
container:
|
||||
image: pytorch/pytorch:2.10.0-cuda13.0-cudnn9-devel
|
||||
options: --gpus all
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- name: Install Git
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y git
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
submodules: false
|
||||
- parallel:
|
||||
- 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
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras --all-packages --locked
|
||||
- name: Run unit tests
|
||||
env:
|
||||
USERNAME_CI: CI_RUNNER
|
||||
WANDB_MODE: offline
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
PRIME_API_KEY: ${{ secrets.PRIME_API_KEY }}
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||
PYTEST_OUTPUT_DIR: /tmp/outputs
|
||||
run: uv run pytest tests/unit -m gpu
|
||||
|
||||
integration:
|
||||
name: Integration / ${{ matrix.name }}
|
||||
needs: gate
|
||||
runs-on: prime-rl-2xh200
|
||||
container:
|
||||
image: pytorch/pytorch:2.10.0-cuda13.0-cudnn9-devel
|
||||
options: --gpus all
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# Bound per-PR fan-out: at most 5 integration jobs at a time (plus unit-tests),
|
||||
# i.e. 6 h200 pods per PR. Tune together with the ARC scale set maxRunners.
|
||||
max-parallel: 5
|
||||
matrix:
|
||||
include:
|
||||
- {test: reverse_text_sft, name: Reverse Text SFT}
|
||||
- {test: reverse_text_sft_lora, name: Reverse Text SFT LoRA}
|
||||
- {test: pretrain, name: Pretrain}
|
||||
- {test: reverse_text, name: Reverse Text}
|
||||
- {test: reverse_text_rl_opd, name: Reverse Text RL OPD}
|
||||
- {test: reverse_text_rl_sft, name: Reverse Text RL SFT}
|
||||
- {test: alphabet_sort, name: Alphabet Sort}
|
||||
- {test: reverse_text_lora, name: Reverse Text LoRA}
|
||||
- {test: reverse_text_moe, name: Reverse Text MoE}
|
||||
- {test: reverse_text_modelexpress, name: Reverse Text ModelExpress}
|
||||
steps:
|
||||
- name: Install Git
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y git
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
submodules: false
|
||||
- parallel:
|
||||
- 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
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras --all-packages --locked
|
||||
- name: Install ModelExpress server
|
||||
if: matrix.test == 'reverse_text_modelexpress'
|
||||
run: |
|
||||
apt-get install -y curl make gcc
|
||||
bash scripts/install_modelexpress.sh
|
||||
- name: Run integration tests
|
||||
env:
|
||||
USERNAME_CI: CI_RUNNER
|
||||
WANDB_MODE: offline
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
PRIME_API_KEY: ${{ secrets.PRIME_API_KEY }}
|
||||
PRIME_BASE_URL: ${{ secrets.PRIME_BASE_URL }}
|
||||
PRIME_TEAM_ID: ${{ secrets.PRIME_TEAM_ID }}
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||
PYTEST_OUTPUT_DIR: /tmp/outputs
|
||||
VLLM_WORKER_MULTIPROC_METHOD: spawn
|
||||
run: uv run pytest -vvs tests/integration/test_${{ matrix.test }}.py
|
||||
- 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
|
||||
@@ -0,0 +1,123 @@
|
||||
name: GPU Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
name: Unit tests
|
||||
runs-on: vm
|
||||
container:
|
||||
image: pytorch/pytorch:2.10.0-cuda13.0-cudnn9-devel
|
||||
options: --gpus all
|
||||
timeout-minutes: 45
|
||||
if: github.event_name == 'push' || github.event.pull_request.draft == false
|
||||
steps:
|
||||
- name: Install Git
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y git
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
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: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras --all-packages --locked
|
||||
- name: Run unit tests
|
||||
env:
|
||||
USERNAME_CI: CI_RUNNER
|
||||
WANDB_MODE: offline
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
PRIME_API_KEY: ${{ secrets.PRIME_API_KEY }}
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||
PYTEST_OUTPUT_DIR: /tmp/outputs
|
||||
run: uv run pytest tests/unit -m gpu
|
||||
|
||||
integration-tests:
|
||||
name: Integration tests (${{ matrix.test }})
|
||||
runs-on: ${{ matrix.runner }}
|
||||
container:
|
||||
image: pytorch/pytorch:2.10.0-cuda13.0-cudnn9-devel
|
||||
options: --gpus all
|
||||
timeout-minutes: 60
|
||||
if: github.event_name == 'push' || github.event.pull_request.draft == false
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- test: reverse_text_sft
|
||||
runner: vm
|
||||
pytest_args: "tests/integration/test_reverse_text_sft.py"
|
||||
- test: reverse_text_sft_lora
|
||||
runner: vm
|
||||
pytest_args: "tests/integration/test_reverse_text_sft_lora.py"
|
||||
- test: reverse_text
|
||||
runner: vm
|
||||
pytest_args: "tests/integration/test_reverse_text.py"
|
||||
- test: reverse_text_rl_opd
|
||||
runner: vm
|
||||
pytest_args: "tests/integration/test_reverse_text_rl_opd.py"
|
||||
- test: reverse_text_rl_sft
|
||||
runner: vm
|
||||
pytest_args: "tests/integration/test_reverse_text_rl_sft.py"
|
||||
- test: alphabet_sort
|
||||
runner: vm
|
||||
pytest_args: "tests/integration/test_alphabet_sort.py"
|
||||
- test: reverse_text_lora
|
||||
runner: vm
|
||||
pytest_args: "tests/integration/test_reverse_text_lora.py"
|
||||
- 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"
|
||||
steps:
|
||||
- name: Install Git
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y git
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
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: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras --all-packages --locked
|
||||
- name: Run integration tests
|
||||
env:
|
||||
USERNAME_CI: CI_RUNNER
|
||||
WANDB_MODE: offline
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
PRIME_API_KEY: ${{ secrets.PRIME_API_KEY }}
|
||||
PRIME_BASE_URL: ${{ secrets.PRIME_BASE_URL }}
|
||||
PRIME_TEAM_ID: ${{ secrets.PRIME_TEAM_ID }}
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||
PYTEST_OUTPUT_DIR: /tmp/outputs
|
||||
VLLM_WORKER_MULTIPROC_METHOD: spawn
|
||||
run: uv run pytest -vvs ${{ matrix.pytest_args }}
|
||||
@@ -0,0 +1,106 @@
|
||||
name: Nightly Tests
|
||||
|
||||
on:
|
||||
# Allow to manually trigger the workflow
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
test_file:
|
||||
description: "Single nightly test file to run (e.g. tests/nightly/test_my_exp.py). Leave empty to run all."
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
# Scheduled run at 3AM PST (11AM UTC)
|
||||
schedule:
|
||||
- cron: "0 11 * * *"
|
||||
|
||||
jobs:
|
||||
discover-experiments:
|
||||
name: Discover experiments
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
matrix: ${{ steps.build-matrix.outputs.matrix }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: false
|
||||
|
||||
- name: Build matrix from nightly test files
|
||||
id: build-matrix
|
||||
run: |
|
||||
# Find all nightly test files
|
||||
files=$(ls tests/nightly/test_*.py)
|
||||
|
||||
# Filter to specific test file if provided in workflow_dispatch
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.test_file }}" ]; then
|
||||
# Filter to only the specified test file
|
||||
filtered=$(echo "$files" | grep -F "${{ github.event.inputs.test_file }}" || true)
|
||||
if [ -z "$filtered" ]; then
|
||||
echo "Error: Test file '${{ github.event.inputs.test_file }}' not found"
|
||||
exit 1
|
||||
fi
|
||||
files="$filtered"
|
||||
fi
|
||||
|
||||
echo "Discovered nightly tests:"
|
||||
echo "$files"
|
||||
|
||||
# Build JSON of the form: { "test_file": ["tests/nightly/test_a.py", ...] }
|
||||
json=$(printf '%s\n' "$files" | jq -R . | jq -sc '{test_file: .}')
|
||||
|
||||
echo "matrix=$json" >> "$GITHUB_OUTPUT"
|
||||
run-experiment:
|
||||
name: Run experiment
|
||||
needs: discover-experiments
|
||||
runs-on: research-cluster
|
||||
container:
|
||||
image: pytorch/pytorch:2.10.0-cuda13.0-cudnn9-devel
|
||||
# --shm-size: vLLM V1's DP engine/API-server IPC uses POSIX shm-backed
|
||||
# MessageQueue (~160MB per queue); Docker's default 64MB /dev/shm triggers
|
||||
# SIGBUS in DP engine cores on VLM runs (mm data overflows tmpfs).
|
||||
options: --gpus all --shm-size=16g
|
||||
timeout-minutes: 1440 # 24 hours
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJSON(needs.discover-experiments.outputs.matrix) }}
|
||||
|
||||
steps:
|
||||
- name: Install Git
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y git
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
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: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras --all-packages --locked
|
||||
- name: Run experiment
|
||||
env:
|
||||
USERNAME_CI: CI_RUNNER
|
||||
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
|
||||
# Set WANDB_MODE to online only if WANDB_API_KEY is available, otherwise set to offline
|
||||
# This is to allow running tests on forks without WANDB_API_KEY
|
||||
WANDB_MODE: ${{ secrets.WANDB_API_KEY && 'online' || 'offline' }}
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
PRIME_API_KEY: ${{ secrets.PRIME_API_KEY }}
|
||||
PRIME_BASE_URL: ${{ secrets.PRIME_BASE_URL }}
|
||||
PRIME_TEAM_ID: ${{ secrets.PRIME_TEAM_ID }}
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||
run: |
|
||||
echo "Running test file: ${{ matrix.test_file }}"
|
||||
uv run pytest "${{ matrix.test_file }}"
|
||||
@@ -1,294 +0,0 @@
|
||||
name: Regression
|
||||
|
||||
# Scheduled regression suites, one job group per suite. Dispatch with `suite`
|
||||
# to run one of them.
|
||||
# parallel: test_parallel_invariance.py on the 2xH200 runners
|
||||
# eval: every configs/eval/*.toml through `uv run eval` against Prime
|
||||
# Inference, compared against baselines/eval/. reports/eval/ holds
|
||||
# the error bars of each baseline. Also runs on PRs that touch the
|
||||
# suite.
|
||||
# All paths are relative to tests/regression/.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
suite:
|
||||
description: "Suite to run"
|
||||
type: choice
|
||||
options: [all, parallel, eval]
|
||||
default: all
|
||||
eval_config:
|
||||
description: "eval: config to run, by name (e.g. gsm8k). Leave empty to run all."
|
||||
required: false
|
||||
default: ""
|
||||
eval_repeats:
|
||||
description: "eval: independent runs of each config. Use 5 to produce a new baseline."
|
||||
required: false
|
||||
default: "1"
|
||||
eval_max_parallel:
|
||||
description: "eval: most eval jobs to run at once (empty: no limit). Use it to spread a baseline's runs over time."
|
||||
required: false
|
||||
default: ""
|
||||
eval_model:
|
||||
description: "eval: model id on Prime Inference (empty: the config's model)"
|
||||
required: false
|
||||
default: ""
|
||||
eval_set_baseline:
|
||||
description: "eval: open a PR that makes these runs the new baseline (needs 2+ runs)"
|
||||
type: boolean
|
||||
default: false
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/regression.yml
|
||||
- tests/regression/**
|
||||
|
||||
# 3AM PST (11AM UTC)
|
||||
schedule:
|
||||
- cron: "0 11 * * *"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
EVAL_REPEATS: ${{ inputs.eval_repeats || '1' }}
|
||||
|
||||
jobs:
|
||||
parallel:
|
||||
name: Parallel / Invariance
|
||||
if: ${{ github.event_name != 'pull_request' && (!inputs.suite || inputs.suite == 'all' || inputs.suite == 'parallel') }}
|
||||
runs-on: prime-rl-2xh200
|
||||
container:
|
||||
image: pytorch/pytorch:2.10.0-cuda13.0-cudnn9-devel
|
||||
options: --gpus all
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- name: Install Git
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y git
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
submodules: false
|
||||
- parallel:
|
||||
- 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
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras --all-packages --locked
|
||||
- name: Run invariance test
|
||||
env:
|
||||
USERNAME_CI: CI_RUNNER
|
||||
WANDB_MODE: offline
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
PYTEST_OUTPUT_DIR: /tmp/outputs
|
||||
run: uv run pytest -vvs tests/regression/test_parallel_invariance.py
|
||||
- name: Upload run logs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: parallel-invariance-logs
|
||||
path: /tmp/outputs/**/*.log
|
||||
retention-days: 7
|
||||
if-no-files-found: ignore
|
||||
|
||||
eval-plan:
|
||||
name: Eval / Plan
|
||||
if: ${{ !inputs.suite || inputs.suite == 'all' || inputs.suite == 'eval' }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
configs: ${{ steps.plan.outputs.configs }}
|
||||
names: ${{ steps.plan.outputs.names }}
|
||||
matrix: ${{ steps.plan.outputs.matrix }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
submodules: false
|
||||
- id: plan
|
||||
env:
|
||||
CONFIG: ${{ inputs.eval_config }}
|
||||
# Display name of each config in job names and the summary. A config not listed shows its file name.
|
||||
NAMES: '{"gsm8k": "GSM8K", "pi-terminalbench2-1": "Terminal-Bench-2.1"}'
|
||||
run: |
|
||||
configs=$(ls tests/regression/configs/eval/*.toml | xargs -n1 basename | sed 's/\.toml$//')
|
||||
if [ -n "$CONFIG" ]; then
|
||||
configs=$(echo "$configs" | grep -Fx "$CONFIG" || true)
|
||||
if [ -z "$configs" ]; then
|
||||
echo "Error: eval config '$CONFIG' not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
configs=$(printf '%s\n' "$configs" | jq -R . | jq -sc .)
|
||||
# One job per config and repeat. The repeat shows in the job name only when there are several.
|
||||
names=$(jq -nc --argjson configs "$configs" --argjson names "$NAMES" '
|
||||
[$configs[] as $c | {($c): ($names[$c] // $c)}] | add')
|
||||
matrix=$(jq -nc --argjson configs "$configs" --argjson names "$names" --argjson n "$EVAL_REPEATS" '[
|
||||
$configs[] as $c | range(1; $n + 1) as $r
|
||||
| {config: $c, repeat: $r, name: (if $n > 1 then "\($names[$c]) (\($r))" else $names[$c] end)}
|
||||
]')
|
||||
echo "configs=$configs" >> "$GITHUB_OUTPUT"
|
||||
echo "names=$names" >> "$GITHUB_OUTPUT"
|
||||
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
|
||||
|
||||
eval:
|
||||
name: Eval / ${{ matrix.name }}
|
||||
needs: eval-plan
|
||||
runs-on: ubuntu-latest
|
||||
# The GitHub-hosted maximum. An agent eval caps the agent time of each rollout in its
|
||||
# config, so that it ends before this limit.
|
||||
timeout-minutes: 360
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: ${{ fromJSON(inputs.eval_max_parallel || '256') }}
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.eval-plan.outputs.matrix) }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
submodules: false
|
||||
- parallel:
|
||||
- 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
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-packages --locked
|
||||
# Harbor tasksets download their task files into ~/.cache/harbor. The prime-envs
|
||||
# commit pins every taskset's data, so it keys the cache.
|
||||
- name: Key the Harbor cache
|
||||
id: harbor
|
||||
run: echo "key=harbor-${{ matrix.config }}-$(git rev-parse HEAD:deps/prime-envs)" >> "$GITHUB_OUTPUT"
|
||||
- name: Cache Harbor tasks
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/harbor
|
||||
key: ${{ steps.harbor.outputs.key }}
|
||||
- name: Run eval
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
PRIME_API_KEY: ${{ secrets.PRIME_API_KEY }}
|
||||
PRIME_TEAM_ID: ${{ secrets.PRIME_TEAM_ID }}
|
||||
MODEL: ${{ inputs.eval_model }}
|
||||
CONFIG: ${{ matrix.config }}
|
||||
REPEAT: ${{ matrix.repeat }}
|
||||
run: |
|
||||
start=$(date +%s)
|
||||
uv run eval @ "tests/regression/configs/eval/$CONFIG.toml" ${MODEL:+-m "$MODEL"} \
|
||||
--no-monitors.prime --run.name "$CONFIG-$REPEAT" --output-dir outputs
|
||||
mkdir -p "results/$CONFIG"
|
||||
python3 tests/regression/scripts/eval.py collect "outputs/$CONFIG-$REPEAT" \
|
||||
--repeat "$REPEAT" --wall-s "$(( $(date +%s) - start ))" --out "results/$CONFIG/$REPEAT.json"
|
||||
- name: Upload result
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: eval-result-${{ matrix.config }}-${{ matrix.repeat }}
|
||||
path: |
|
||||
results
|
||||
outputs/${{ matrix.config }}-${{ matrix.repeat }}/logs
|
||||
outputs/${{ matrix.config }}-${{ matrix.repeat }}/monitors/file/metrics.jsonl
|
||||
outputs/${{ matrix.config }}-${{ matrix.repeat }}/monitors/file/traces/stream.index.jsonl
|
||||
if-no-files-found: ignore
|
||||
retention-days: 30
|
||||
# Each config posts its own message when its eval ends, so a long eval does not delay
|
||||
# the others. Only nightly and manual runs of one repeat post. Runs for a new baseline
|
||||
# report in the summary only. always(), because a job that hits its timeout ends as
|
||||
# cancelled, and that eval must still report.
|
||||
- name: Post to Slack
|
||||
if: ${{ always() && github.event_name != 'pull_request' && env.EVAL_REPEATS == '1' }}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
CONFIG: ${{ matrix.config }}
|
||||
NAME: ${{ matrix.name }}
|
||||
run: |
|
||||
if [ -z "$SLACK_WEBHOOK_URL" ]; then
|
||||
echo "SLACK_WEBHOOK_URL is not set. Skipped."
|
||||
exit 0
|
||||
fi
|
||||
python3 tests/regression/scripts/eval.py summarize --name "$NAME" \
|
||||
$(find results -path "results/$CONFIG/*.json" 2>/dev/null) \
|
||||
--expected 1 --baseline "tests/regression/baselines/eval/$CONFIG.json" \
|
||||
--slack slack.json > /dev/null || true
|
||||
curl -fsS -X POST -H "Content-Type: application/json" --data @slack.json "$SLACK_WEBHOOK_URL"
|
||||
|
||||
eval-summary:
|
||||
name: Eval / Summary
|
||||
needs: [eval-plan, eval]
|
||||
if: ${{ !cancelled() && needs.eval.result != 'skipped' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
submodules: false
|
||||
- name: Download results
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
path: artifacts
|
||||
pattern: eval-result-*
|
||||
- name: Compare against baselines
|
||||
env:
|
||||
CONFIGS: ${{ needs.eval-plan.outputs.configs }}
|
||||
NAMES: ${{ needs.eval-plan.outputs.names }}
|
||||
run: |
|
||||
# A single downloaded artifact lands in artifacts/ itself, several land in subdirectories.
|
||||
status=0
|
||||
: > summary.md
|
||||
for config in $(echo "$CONFIGS" | jq -r '.[]'); do
|
||||
name=$(echo "$NAMES" | jq -r --arg c "$config" '.[$c]')
|
||||
python3 tests/regression/scripts/eval.py summarize --name "$name" \
|
||||
$(find artifacts -path "*/results/$config/*.json") \
|
||||
--expected "$EVAL_REPEATS" --baseline "tests/regression/baselines/eval/$config.json" \
|
||||
>> summary.md || status=1
|
||||
done
|
||||
tee -a "$GITHUB_STEP_SUMMARY" < summary.md
|
||||
exit $status
|
||||
- name: Open baseline PR
|
||||
if: ${{ !cancelled() && inputs.eval_set_baseline && needs.eval.result == 'success' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
CONFIGS: ${{ needs.eval-plan.outputs.configs }}
|
||||
run: |
|
||||
configs=$(echo "$CONFIGS" | jq -r 'join(", ")')
|
||||
branch="regression/eval-baseline-${{ github.run_id }}"
|
||||
for config in $(echo "$CONFIGS" | jq -r '.[]'); do
|
||||
python3 tests/regression/scripts/eval.py baseline $(find artifacts -path "*/results/$config/*.json") \
|
||||
--out "tests/regression/baselines/eval/$config.json" \
|
||||
--report "tests/regression/reports/eval/$config.md"
|
||||
done
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git checkout -b "$branch"
|
||||
git add tests/regression/baselines/eval tests/regression/reports/eval
|
||||
git commit -m "Refresh eval regression baselines: $configs"
|
||||
git push origin "$branch"
|
||||
{
|
||||
echo "## Summary"
|
||||
echo
|
||||
echo "- Refresh the eval regression baselines of $configs from [this run]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)."
|
||||
echo
|
||||
cat summary.md
|
||||
} > body.md
|
||||
gh pr create --base main --head "$branch" --body-file body.md \
|
||||
--title "chore: refresh eval regression baselines"
|
||||
@@ -9,27 +9,23 @@ on:
|
||||
# This will trigger the workflow for pull requests to any branch
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
ruff:
|
||||
name: Ruff
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v5
|
||||
# Submodules are excluded from ruff via pyproject.toml; no need to fetch them.
|
||||
with:
|
||||
submodules: false
|
||||
- name: Run ruff
|
||||
uses: astral-sh/ruff-action@v4.1.0
|
||||
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
|
||||
with:
|
||||
version: "0.15.14"
|
||||
version: "0.13.0"
|
||||
args: "format --check --config=pyproject.toml"
|
||||
@@ -1,16 +1,18 @@
|
||||
name: Docs
|
||||
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@v5
|
||||
|
||||
- name: Validate mint.json pages exist
|
||||
run: |
|
||||
@@ -1,11 +1,11 @@
|
||||
name: Release
|
||||
name: Tag and Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
# Stable release tags only. `.dev` tags are created by `prerelease.yml`
|
||||
# Stable release tags only. `.dev` tags are created by `devx_tag.yaml`
|
||||
# via GITHUB_TOKEN (which does not retrigger workflows), so they would
|
||||
# not arrive here anyway — this exclusion is defensive for manual pushes.
|
||||
- 'v*'
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
version: ${{ steps.tag.outputs.version }}
|
||||
steps:
|
||||
- name: Checkout main
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -119,8 +119,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
# Needed to dispatch image.yml 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 image.yml --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@v5
|
||||
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@v5
|
||||
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 image.yml 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 image.yml --repo "$GITHUB_REPOSITORY" -f ref="$TAG"
|
||||
@@ -1,194 +0,0 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
unit-cpu:
|
||||
name: Unit (CPU)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
submodules: false
|
||||
- parallel:
|
||||
- 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
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-extras --all-packages --locked
|
||||
- name: Run tests
|
||||
env:
|
||||
USERNAME_CI: CI_RUNNER
|
||||
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
|
||||
# Set WANDB_MODE to online only if WANDB_API_KEY is available, otherwise set to offline
|
||||
# This is to allow running tests on forks without WANDB_API_KEY
|
||||
WANDB_MODE: ${{ secrets.WANDB_API_KEY && 'online' || 'offline' }}
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
PRIME_API_KEY: ${{ secrets.PRIME_API_KEY }}
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||
PYTEST_OUTPUT_DIR: /tmp/outputs
|
||||
run: PYTEST_OUTPUT_DIR=/tmp/outputs uv run pytest tests/unit -m "not gpu"
|
||||
- name: Cleanup output_dir
|
||||
run: rm -rf /tmp/outputs
|
||||
|
||||
slim:
|
||||
name: Slim install
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
- name: Build the slim wheel
|
||||
run: uv build --wheel ./packages/prime-rl-configs --out-dir /tmp/slim-wheel
|
||||
- name: Install slim wheel from a directory with no workspace context
|
||||
# Build the wheel and install it from /tmp so uv can't discover the
|
||||
# repo's root pyproject.toml [tool.uv.sources] and silently apply
|
||||
# them. This mirrors what an external pip-only user gets.
|
||||
run: |
|
||||
uv venv --python 3.12 /tmp/slim
|
||||
cd /tmp && uv pip install --python /tmp/slim/bin/python /tmp/slim-wheel/*.whl
|
||||
- name: Verify configs import without heavy deps
|
||||
run: |
|
||||
/tmp/slim/bin/python - <<'PY'
|
||||
import sys
|
||||
|
||||
from prime_rl.configs.rl import RLConfig
|
||||
from prime_rl.configs.sft import SFTConfig
|
||||
from prime_rl.configs.inference import InferenceConfig
|
||||
from prime_rl.configs.orchestrator import OrchestratorConfig
|
||||
from prime_rl.configs.trainer import TrainerConfig
|
||||
from prime_rl.configs.env_worker_pool import EnvWorkerPoolConfig
|
||||
from prime_rl.utils.config import BaseConfig, find_package_resource, rgetattr, rsetattr
|
||||
from prime_rl.utils.validation import propagate_shared_fields
|
||||
|
||||
# `verifiers` (+ its `datasets` dep) is a declared slim dep: the v1 config types
|
||||
# (EnvConfig, Task, ...) extend verifiers.v1, which is pure-pydantic and pulls no
|
||||
# GPU/ML deps. We still forbid the actual heavy training deps below.
|
||||
forbidden = ["torch", "transformers", "vllm", "wandb",
|
||||
"prime", "liger_kernel", "loguru"]
|
||||
leaked = [m for m in forbidden if m in sys.modules]
|
||||
if leaked:
|
||||
raise SystemExit(f"slim install leaked heavy deps into sys.modules: {leaked}")
|
||||
|
||||
# Slim wheel does not ship the templates/ data dir; resolver returns None.
|
||||
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
|
||||
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.
|
||||
for cfg_cls, args in [
|
||||
(SFTConfig, ["@", "configs/ci/slim_sft.toml"]),
|
||||
]:
|
||||
cfg = cli(cfg_cls, args=args)
|
||||
assert cfg.slurm is not None, f"expected [slurm] in {args}"
|
||||
# On slim, template_path can't be auto-resolved (heavy wheel absent) — must stay None.
|
||||
assert cfg.slurm.template_path is None, f"unexpected template_path on slim: {cfg.slurm.template_path}"
|
||||
print("slim parse OK")
|
||||
PY
|
||||
|
||||
changes:
|
||||
name: Changes
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
|
||||
permissions:
|
||||
pull-requests: read
|
||||
outputs:
|
||||
eval: ${{ github.event_name != 'pull_request' || steps.filter.outputs.eval == 'true' }}
|
||||
steps:
|
||||
- uses: dorny/paths-filter@v4
|
||||
id: filter
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
filters: |
|
||||
eval:
|
||||
- &runtime
|
||||
- '.github/workflows/tests.yml'
|
||||
- '{pyproject.toml,uv.lock,.python-version,.gitmodules}'
|
||||
- 'deps/**'
|
||||
- 'packages/**/pyproject.toml'
|
||||
- 'packages/prime-rl-configs/src/prime_rl/configs/{trainer,shared,__init__}.py'
|
||||
- 'packages/prime-rl-configs/src/prime_rl/utils/**'
|
||||
- 'src/prime_rl/*.py'
|
||||
- 'src/prime_rl/{trainer,multimodal,transports,utils}/**'
|
||||
- 'tests/{__init__.py,conftest.py,utils.py}'
|
||||
- 'tests/integration/{__init__.py,conftest.py}'
|
||||
- 'packages/prime-rl-configs/src/prime_rl/configs/{eval,orchestrator,inference,env_worker_pool,algorithm,monitors}.py'
|
||||
- 'src/prime_rl/{control,eval,orchestrator,monitors}/**'
|
||||
- 'src/prime_rl/entrypoints/{eval,env_worker_pool}.py'
|
||||
- 'tests/integration/test_gsm8k_eval.py'
|
||||
- 'configs/ci/integration/gsm8k-eval.toml'
|
||||
|
||||
integration-eval:
|
||||
name: Integration / GSM8K Eval
|
||||
needs: changes
|
||||
if: needs.changes.outputs.eval == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
submodules: false
|
||||
- parallel:
|
||||
- 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
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v10.0.1
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
# Runs the eval without torch; --all-packages would install it (via bfcl-v3).
|
||||
- name: Install dependencies
|
||||
run: uv sync --locked --package prime-rl --package gsm8k
|
||||
- name: Run eval tests
|
||||
env:
|
||||
USERNAME_CI: CI_RUNNER
|
||||
WANDB_MODE: offline
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
PRIME_API_KEY: ${{ secrets.PRIME_API_KEY }}
|
||||
PRIME_BASE_URL: ${{ secrets.PRIME_BASE_URL }}
|
||||
PRIME_TEAM_ID: ${{ secrets.PRIME_TEAM_ID }}
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||
PYTEST_OUTPUT_DIR: /tmp/outputs
|
||||
run: uv run pytest -vvs tests/integration/test_gsm8k_eval.py
|
||||
- name: Upload run logs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: gsm8k_eval-logs
|
||||
path: /tmp/outputs/**/*.log
|
||||
retention-days: 7
|
||||
if-no-files-found: ignore
|
||||
+20
-4
@@ -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_*
|
||||
@@ -144,8 +157,9 @@ celerybeat.pid
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
/ENV/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
@@ -187,4 +201,6 @@ cython_debug/
|
||||
debug_I2_zero_band
|
||||
.idea
|
||||
|
||||
outputs/
|
||||
|
||||
third_party/
|
||||
|
||||
+4
-8
@@ -3,14 +3,10 @@
|
||||
url = git@github.com:PrimeIntellect-ai/verifiers.git
|
||||
[submodule "renderers"]
|
||||
path = deps/renderers
|
||||
url = ../renderers.git
|
||||
branch = trinity-dsv41
|
||||
[submodule "prime-envs"]
|
||||
path = deps/prime-envs
|
||||
url = git@github.com:PrimeIntellect-ai/prime-envs.git
|
||||
url = git@github.com:PrimeIntellect-ai/renderers.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
|
||||
|
||||
@@ -61,6 +59,5 @@ Write tests as plain functions with pytest fixtures. Don't use class-based tests
|
||||
## GitHub
|
||||
|
||||
- **Draft PRs**: always create PRs as drafts (`gh pr create --draft`) to avoid triggering CI unnecessarily.
|
||||
- **GPU CI is opt-in**: pushes to a PR don't run GPU tests. The full GPU suite runs on the PR's current commit when someone applies the `gpu-ci` label. Only when the user asks, request a run with `gh pr edit <num> --add-label gpu-ci`. The workflow removes the label, so re-add it after new pushes.
|
||||
- **Pull requests**: do not include a "test plan" section in PR descriptions unless you actually ran tests to verify the changes or the user explicitly asked for one.
|
||||
- **Keep PR descriptions in sync**: every time you push commits to a PR, also update the PR description (`gh pr edit <num> --body-file ...`) so it reflects the current state of the branch — not just what was true when the PR was opened. Preserve any auto-generated blocks (e.g. `<!-- CURSOR_SUMMARY -->`).
|
||||
|
||||
+87
-138
@@ -1,27 +1,7 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG DEPENDENCY_IMAGE=dependencies
|
||||
|
||||
FROM ghcr.io/astral-sh/uv:0.11.9@sha256:6b6fa841d71a48fbc9e2c55651c5ad570e01104d7a7d701f57b2b22c0f58e9b1 AS uv
|
||||
|
||||
FROM ubuntu:24.04@sha256:a853f94d226358a79c740cfc7bce0c289748f3fe3488d921d038ccd752c61b60 AS python-builder
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates python3.12 python3.12-venv \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=uv /uv /uvx /usr/local/bin/
|
||||
ENV UV_PYTHON_PREFERENCE=only-system UV_LINK_MODE=copy
|
||||
|
||||
# Every pyproject.toml + uv.lock, so the dependency sync below caches
|
||||
# independently of source edits.
|
||||
FROM python-builder AS manifests
|
||||
COPY . /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/
|
||||
#inspired from https://github.com/astral-sh/uv-docker-example/blob/main/multistage.Dockerfile
|
||||
|
||||
# Build stage - multi-arch base (supports amd64 + arm64)
|
||||
FROM nvidia/cuda:13.0.1-cudnn-devel-ubuntu24.04@sha256:8b2705ea7a8653ad3451b46ab835eced92d77b44e671b9cf3ad4f95fbb2efe5e AS builder
|
||||
FROM nvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04 AS builder
|
||||
LABEL maintainer="prime intellect"
|
||||
LABEL repository="prime-rl"
|
||||
|
||||
@@ -78,59 +58,84 @@ RUN git clone --depth 1 --branch v${UCX_VERSION} https://github.com/openucx/ucx.
|
||||
&& make install \
|
||||
&& rm -rf /tmp/ucx
|
||||
|
||||
COPY --from=uv /uv /uvx /usr/local/bin/
|
||||
# Download the latest installer
|
||||
ADD https://astral.sh/uv/install.sh /uv-installer.sh
|
||||
|
||||
# Set install dir to location accessible to non-root users
|
||||
RUN INSTALLER_NO_MODIFY_PATH=1 UV_INSTALL_DIR="/usr/local/bin" sh /uv-installer.sh && rm /uv-installer.sh
|
||||
ENV PATH="/usr/local/bin:$PATH"
|
||||
# Build .venv against the system CPython, so the venv's recorded interpreter
|
||||
# matches the runtime interpreter and no bin/python relink is needed at runtime.
|
||||
ENV UV_PYTHON_PREFERENCE=only-system
|
||||
ENV UV_CACHE_DIR="/usr/local/share/uv/cache"
|
||||
# Explicity set venv dir inside /app so to ensure it gets copied over during
|
||||
# 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
|
||||
|
||||
# The runtime dependency image contains no first-party source or editable installs.
|
||||
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 --locked --no-dev \
|
||||
--no-install-local
|
||||
COPY pyproject.toml /app/pyproject.toml
|
||||
COPY uv.lock /app/uv.lock
|
||||
COPY README.md /app/README.md
|
||||
COPY src/ /app/src/
|
||||
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
|
||||
COPY scripts/patch-vllm-nvfp4-writable-scales.py /app/scripts/patch-vllm-nvfp4-writable-scales.py
|
||||
|
||||
# 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
|
||||
# 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.
|
||||
ARG VERIFIERS_PRETEND_VERSION
|
||||
ARG RENDERERS_PRETEND_VERSION
|
||||
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 \
|
||||
&& \
|
||||
eval "$(bash /app/scripts/docker-editable-pretend-versions.sh --shell /app)" \
|
||||
&& \
|
||||
if [ -L /app/.git/modules ]; then rm /app/.git/modules && rmdir /app/.git 2>/dev/null || true; fi \
|
||||
&& \
|
||||
sed -i "s/fallback-version = \"0.0.0\"/fallback-version = \"${VERIFIERS_PRETEND_VERSION}\"/" /app/deps/verifiers/pyproject.toml \
|
||||
&& \
|
||||
sed -i "s/fallback-version = \"0.0.0\"/fallback-version = \"${RENDERERS_PRETEND_VERSION}\"/" /app/deps/renderers/pyproject.toml \
|
||||
&& \
|
||||
uv sync --all-packages --extra flash-attn --extra flash-attn-3 --extra flash-attn-cute --extra disagg --extra gpt-oss --extra quack --group mamba-ssm --locked --no-dev \
|
||||
&& \
|
||||
/app/.venv/bin/python -c 'from importlib.metadata import version; [version(name) for name in ("deep-ep", "deep-gemm", "mamba-ssm", "nixl", "quack-kernels", "vllm", "vllm-router")]' \
|
||||
&& \
|
||||
/app/.venv/bin/python /app/scripts/patch-vllm-nvfp4-writable-scales.py
|
||||
|
||||
# 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
|
||||
@@ -138,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@sha256:f8ef28f579ea42a44b415d2c5d46f788e6a9b395c6c83f2929416e1fc192c143 AS dependencies
|
||||
FROM nvidia/cuda:12.8.1-base-ubuntu24.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
@@ -175,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
|
||||
|
||||
@@ -223,38 +214,19 @@ RUN userdel -r ubuntu 2>/dev/null || true; \
|
||||
echo "appuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
||||
|
||||
# Install uv for development use
|
||||
COPY --from=uv /uv /uvx /usr/local/bin/
|
||||
|
||||
# The platform installs Hub environments with `uv run --no-sync prime env install`.
|
||||
# The CLI gets its own tool venv so its dependencies stay out of prime-rl's lock;
|
||||
# `prime env install` still installs into the project venv (/app/.venv).
|
||||
ARG PRIME_CLI_VERSION=0.19.2
|
||||
RUN UV_TOOL_DIR=/opt/uv-tools UV_TOOL_BIN_DIR=/usr/local/bin \
|
||||
uv tool install --no-cache --python /usr/bin/python3.12 "prime==${PRIME_CLI_VERSION}" \
|
||||
&& prime --version
|
||||
ADD https://astral.sh/uv/install.sh /uv-installer.sh
|
||||
RUN INSTALLER_NO_MODIFY_PATH=1 UV_INSTALL_DIR="/usr/local/bin" sh /uv-installer.sh && rm /uv-installer.sh
|
||||
|
||||
USER appuser
|
||||
ENV PATH="/usr/local/bin:$PATH"
|
||||
WORKDIR /app
|
||||
# Split the largest dependency trees so compression and pulls can run in parallel.
|
||||
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 --from=builder --chown=appuser:appuser \
|
||||
--exclude=lib/python3.12/site-packages/nvidia \
|
||||
--exclude=lib/python3.12/site-packages/torch \
|
||||
--exclude=lib/python3.12/site-packages/vllm \
|
||||
--exclude=lib/python3.12/site-packages/flash_attn \
|
||||
--exclude=lib/python3.12/site-packages/flash_attn_2_cuda*.so \
|
||||
/app/.venv /app/.venv
|
||||
RUN /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")]' \
|
||||
&& if [ "$(uname -m)" = "x86_64" ]; then \
|
||||
/app/.venv/bin/python -c 'from importlib.metadata import version; version("flash-mla")'; \
|
||||
fi
|
||||
# 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
|
||||
|
||||
# Place executables in the environment at the front of the path
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
@@ -265,29 +237,6 @@ ENV LD_LIBRARY_PATH="/opt/ucx/lib:/opt/ucx/lib/ucx${LD_LIBRARY_PATH:+:${LD_LIBRA
|
||||
ENV HF_HUB_ETAG_TIMEOUT=500
|
||||
ENV HF_HUB_DOWNLOAD_TIMEOUT=300
|
||||
|
||||
FROM python-builder AS application-builder
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml uv.lock README.md /app/
|
||||
COPY src /app/src
|
||||
COPY packages /app/packages
|
||||
COPY deps /app/deps
|
||||
COPY configs /app/configs
|
||||
COPY examples /app/examples
|
||||
COPY scripts/docker-editable-pretend-versions.sh /app/scripts/docker-editable-pretend-versions.sh
|
||||
COPY scripts/docker_application.py /build/docker_application.py
|
||||
ARG VERIFIERS_PRETEND_VERSION
|
||||
ARG RENDERERS_PRETEND_VERSION
|
||||
ARG PYDANTIC_CONFIG_PRETEND_VERSION
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
eval "$(bash /app/scripts/docker-editable-pretend-versions.sh --shell /app)" \
|
||||
&& uv run --no-project --python /usr/bin/python3.12 /build/docker_application.py /app /out/app
|
||||
|
||||
# COPY --link and numeric ownership let source builds reuse dependency blobs without unpacking them.
|
||||
FROM ${DEPENDENCY_IMAGE} AS runtime
|
||||
ARG USER_ID=1000
|
||||
ARG GROUP_ID=1000
|
||||
COPY --link --from=application-builder --chown=${USER_ID}:${GROUP_ID} /out/app /app
|
||||
# Preserve the executable Git mode; --chmod disables BuildKit's linked-copy optimization.
|
||||
COPY --link --chown=${USER_ID}:${GROUP_ID} scripts/docker-entrypoint.sh /app/docker-entrypoint.sh
|
||||
# Use entrypoint for setup (ulimit, etc) but default to sleep infinity for K8s
|
||||
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
ARG BASE_IMAGE=ghcr.io/primeintellect-ai/prime-rl@sha256:a86004b9b44d43c8018633283ec0267c3339c0dac0e35a9957f48f0a6b56153c
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
USER root
|
||||
|
||||
COPY pyproject.toml /app/pyproject.toml
|
||||
COPY uv.lock /app/uv.lock
|
||||
COPY scripts/patch-vllm-nvfp4-writable-scales.py /app/scripts/patch-vllm-nvfp4-writable-scales.py
|
||||
COPY k8s/experiments/run_nvfp4_inference.sh /app/k8s/experiments/run_nvfp4_inference.sh
|
||||
|
||||
RUN uv --no-config pip install \
|
||||
--python /app/.venv/bin/python \
|
||||
--upgrade \
|
||||
--no-deps \
|
||||
'https://wheels.vllm.ai/910cc8543a6907c9cc87c417f8f2420969278bf5/vllm-0.23.1rc1.dev1392%2Bg910cc8543-cp38-abi3-manylinux_2_28_aarch64.whl' \
|
||||
'https://github.com/flashinfer-ai/flashinfer/releases/download/v0.6.15.post1/flashinfer_python-0.6.15.post1-py3-none-any.whl' \
|
||||
'https://github.com/flashinfer-ai/flashinfer/releases/download/v0.6.15.post1/flashinfer_cubin-0.6.15.post1-py3-none-any.whl' \
|
||||
&& /app/.venv/bin/python /app/scripts/patch-vllm-nvfp4-writable-scales.py \
|
||||
&& /app/.venv/bin/python -c 'from importlib.metadata import version; expected={"vllm":"0.23.1rc1.dev1392+g910cc8543","flashinfer-python":"0.6.15.post1","flashinfer-cubin":"0.6.15.post1"}; actual={name:version(name) for name in expected}; assert actual == expected, (actual, expected)'
|
||||
|
||||
USER appuser
|
||||
@@ -0,0 +1,19 @@
|
||||
ARG BASE_IMAGE=ghcr.io/primeintellect-ai/prime-rl@sha256:823eea93b07b5adbaaafddacdc00a7d0f7384c65696b952b92ff28b5790af6b7
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
USER root
|
||||
|
||||
# Keep Prime main and the pinned NVFP4 runtime from the immutable dev2 image.
|
||||
# This layer only adapts Prime to vLLM's scale-out package move and fixes the
|
||||
# persistent-cache wrapper; it does not install or compile anything.
|
||||
COPY --chown=appuser:appuser \
|
||||
src/prime_rl/inference/vllm/serving_tokens.py \
|
||||
/app/src/prime_rl/inference/vllm/serving_tokens.py
|
||||
COPY --chown=appuser:appuser \
|
||||
src/prime_rl/utils/client.py \
|
||||
/app/src/prime_rl/utils/client.py
|
||||
COPY --chown=appuser:appuser \
|
||||
k8s/experiments/run_nvfp4_inference.sh \
|
||||
/app/k8s/experiments/run_nvfp4_inference.sh
|
||||
|
||||
USER appuser
|
||||
@@ -16,11 +16,14 @@ prime-rl: Async RL Training at Scale
|
||||
|
||||
</br>
|
||||
<p align="center">
|
||||
<a href="https://github.com/PrimeIntellect-ai/prime-rl/actions/workflows/style.yml">
|
||||
<img src="https://github.com/PrimeIntellect-ai/prime-rl/actions/workflows/style.yml/badge.svg" alt="Style" />
|
||||
<a href="https://github.com/PrimeIntellect-ai/prime-rl/actions/workflows/style.yaml">
|
||||
<img src="https://github.com/PrimeIntellect-ai/prime-rl/actions/workflows/style.yaml/badge.svg" alt="Style" />
|
||||
</a>
|
||||
<a href="https://github.com/PrimeIntellect-ai/prime-rl/actions/workflows/tests.yml">
|
||||
<img src="https://github.com/PrimeIntellect-ai/prime-rl/actions/workflows/tests.yml/badge.svg" alt="Tests" />
|
||||
<a href="https://github.com/PrimeIntellect-ai/prime-rl/actions/workflows/cpu_tests.yaml">
|
||||
<img src="https://github.com/PrimeIntellect-ai/prime-rl/actions/workflows/cpu_tests.yaml/badge.svg" alt="Test" />
|
||||
</a>
|
||||
<a href="https://github.com/PrimeIntellect-ai/prime-rl/actions/workflows/gpu_tests.yaml">
|
||||
<img src="https://github.com/PrimeIntellect-ai/prime-rl/actions/workflows/gpu_tests.yaml/badge.svg" alt="Test" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@@ -32,32 +35,33 @@ prime-rl is a framework for large-scale reinforcement learning. It is designed t
|
||||
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.
|
||||
3. Native integration with [`verifiers`](https://github.com/PrimeIntellect-ai/verifiers) environments through the [Environments Hub](https://app.primeintellect.ai/dashboard/environments?ex_sort=most_stars), including built-in support for SWE and agentic environments.
|
||||
4. End-to-end post-training: SFT, RL training, and evals.
|
||||
5. Multi-node deployment with Slurm support.
|
||||
6. Multimodal support for Qwen3.5 and Qwen3.8 VLMs, with [image RL and SFT examples](examples/extra/vlm/README.md).
|
||||
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/advanced/glm-5.2/).
|
||||
|
||||
|
||||
## Models support
|
||||
|
||||
|
||||
The trainer runs the PrimeRL model implementations under `src/prime_rl/trainer/models/`: dense Llama, Qwen3 and Qwen3.5, plus the families in the table below, with expert parallelism (EP) for MoE layers, context parallelism (CP) for long sequences, and additional kernels like [quack-kernels](https://github.com/quack-kernels/quack-kernels). Other architectures fail at trainer setup.
|
||||
The trainer works with both Hugging Face and Prime custom `ModelForCausalLM` out of the box. For selected families (especially large MoE) we also ship highly optimized training code under `src/prime_rl/trainer/models/`, including expert parallelism (EP) for MoE layers and context parallelism (CP) for long sequences (see the table), and additional kernels like [quack-kernels](https://github.com/quack-kernels/quack-kernels).
|
||||
|
||||
With `[model] impl = "auto"` (the default), the trainer selects that custom stack when the Hugging Face config type is registered.
|
||||
|
||||
| Family | Example IDs | MoE | EP | CP |
|
||||
|--------|-------------|-----|----|-----|
|
||||
| GLM-5 (`glm_moe_dsa`) | `zai-org/GLM-5`, `zai-org/GLM-5-FP8` | yes | ✅ | ✅ |
|
||||
| GLM-5.3 Flash, text only (`glm5_next`) | `zai-org/GLM-5.3-Flash-BF16` | yes | ✅ | ✅ |
|
||||
| Qwen3 MoE (`qwen3_moe`) | `Qwen/Qwen3-30B-A3B`, … | yes | ✅ | ✅ |
|
||||
| Qwen3.5 MoE (`qwen3_5_moe`) | `Qwen/Qwen3.5-35B-A3B`, … | yes | ✅ | ✅ |
|
||||
| Qwen3.5 VLMs | see [advanced.md](docs/advanced.md#multimodal-training) (`qwen3_5`, `qwen3_5_moe`) | MoE only on MoE VLMs | MoE only | ✅ |
|
||||
| Qwen3.8 Flash Next VLM (`qwen4_exp`) | `Qwen/Qwen3.8-Flash-Next` | 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 | ❌ |
|
||||
| Poolside Laguna (`laguna`) | `poolside/Laguna-XS.2` | yes | ✅ | ✅ |
|
||||
| MiniMax M2 (`minimax_m2`) | `MiniMax/MiniMax-M2` | yes | ✅ | ✅ |
|
||||
| Muse Glimmer, text only (`muse_glimmer`) | `meta-models/Muse-Glimmer-30B` | no | — | ✅ |
|
||||
| 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
|
||||
|
||||
@@ -91,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/)
|
||||
@@ -109,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>
|
||||
@@ -135,16 +157,22 @@ uv run python -c "import flash_attn"
|
||||
uv run sft @ configs/debug/fake/sft.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/fake/rl.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 --model.name Qwen/Qwen3-0.6B
|
||||
```
|
||||
|
||||
6. Check that the full RL stack (inference + orchestrator + trainer) runs end-to-end (*this requires 2 GPUs*)
|
||||
|
||||
```bash
|
||||
uv run rl @ configs/basic/reverse-text/rl.toml
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -176,16 +204,19 @@ Follow this guide to learn the basics of prime-rl. You can train your own models
|
||||
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 `Qwen3-1.7B` using a subset of MATH filtered to problems that `DeepSeek-R1-Distill-Qwen-1.5B` partially solves (20-80%). Useful for algorithm ablations.
|
||||
5. [**Hendrycks Sanity**](examples/basic/hendrycks-sanity/README.md): Run a sanity check experiment on `DeepSeek-R1-Distill-Qwen-1.5B` using a filtered subset of MATH where the model already partially solves 20-80% of problems. Useful for algorithm ablations.
|
||||
|
||||
### Advanced Training: 32 - 2048 GPUs:
|
||||
|
||||
Follow this guide to train large models on hard reasoning and agentic tasks.
|
||||
These guides are designed to be run from a Slurm cluster.
|
||||
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.
|
||||
3. [**Nemotron-3-Super**](examples/advanced/nemotron-3-super/): Train the `Nemotron-3-Super-120B` hybrid-Mamba MoE on SWE at 131k context.
|
||||
4. [**MiniMax-M2.5 SWE**](examples/advanced/minimax-m2.5/): Train `MiniMax-M2.5` on agentic SWE tasks.
|
||||
5. [**INTELLECT-3.1**](examples/advanced/intellect-3.1/): Reproduce our `INTELLECT-3.1` training run.
|
||||
6. [**High-throughput GLM-5**](examples/advanced/glm-5.2/): Large-scale `GLM-5`/`GLM-5.2` inference with P/D disaggregation, the `llm-d` router, and FP8.
|
||||
|
||||
## Docs
|
||||
|
||||
@@ -193,11 +224,10 @@ 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 training and staleness, the AIPO loss, advantage and filter plugins, trajectory merging
|
||||
- [**Advanced**](docs/advanced.md) - Custom modeling, multimodal training, LoRA
|
||||
- [**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, multi-tenant training
|
||||
- [**Development**](docs/development.md) - Test suite, pre-commit hooks, adding a new model
|
||||
|
||||
## Contributing
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA RTX A6000",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:07:14.032743+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 110.89856401001452
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 6.25326518008405,
|
||||
"std": 1.1088767048821218,
|
||||
"min": 5.042813758258495,
|
||||
"max": 7.220033506991957
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 2414.13793444897,
|
||||
"std": 428.09336255378895,
|
||||
"min": 1946.8305980283696,
|
||||
"max": 2787.3688825375607
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 9.231287551335603,
|
||||
"std": 0.08240427237252125,
|
||||
"min": 9.138645098020788,
|
||||
"max": 9.296410266979365
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 5.087890625,
|
||||
"pct": 10.733540123945605
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA RTX A6000",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:09:42.402759+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 323.0761482360249
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 15.980779848317193,
|
||||
"std": 0.016794587683451167,
|
||||
"min": 15.96452617710017,
|
||||
"max": 15.9980675684045
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 1994.95423828766,
|
||||
"std": 2.096545612755065,
|
||||
"min": 1992.9252177648882,
|
||||
"max": 1997.1123438861257
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 65.7679032223338,
|
||||
"std": 0.13193422188415097,
|
||||
"min": 65.63013747497462,
|
||||
"max": 65.89310738901258
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 11.453125,
|
||||
"pct": 24.161796271330914
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA RTX A6000",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:20:58.816045+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 69.12897840799997
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 10.888337274160449,
|
||||
"std": 0.1146035522747722,
|
||||
"min": 10.756101312551046,
|
||||
"max": 10.958838408729708
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 3687.3357954776216,
|
||||
"std": 38.810496952046634,
|
||||
"min": 3642.5540824929494,
|
||||
"max": 3711.211007144323
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 7.457733287660328,
|
||||
"std": 0.06480044847570422,
|
||||
"min": 7.398152031993959,
|
||||
"max": 7.526724088995252
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 12.469401041666666,
|
||||
"pct": 26.30575738885863
|
||||
}
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"ep": 1,
|
||||
"cp": 1,
|
||||
"docker_image": null,
|
||||
"device_name": "NVIDIA RTX A6000",
|
||||
"commit_sha": "c88d08fdf",
|
||||
"timestamp": "2026-06-24T22:50:40+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 276.12556480802596
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 20.802552047875178,
|
||||
"std": 0.16199364988631793,
|
||||
"min": 20.664358307416567,
|
||||
"max": 20.98082222151257
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 2484.411208996455,
|
||||
"std": 19.346608946709658,
|
||||
"min": 2467.9069802355616,
|
||||
"max": 2505.7016937694384
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 52.79691480938345,
|
||||
"std": 0.4071756223542672,
|
||||
"min": 52.35017399210483,
|
||||
"max": 53.14720633160323
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 11.728515625,
|
||||
"pct": 24.742767157118376
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "sft",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": null,
|
||||
"seq_len": 8192,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA RTX A6000",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:15:16.344492+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 37.26451032201294
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 13.534357307187642,
|
||||
"std": 0.11591312542586621,
|
||||
"min": 13.432546913664385,
|
||||
"max": 13.660507673056479
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 6603.696328150197,
|
||||
"std": 56.55644101790505,
|
||||
"min": 6554.020905326831,
|
||||
"max": 6665.2477331393675
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 2.458166876322745,
|
||||
"std": 0.01111478049147262,
|
||||
"min": 2.4491563979827333,
|
||||
"max": 2.4705870889883954
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 31.21484375,
|
||||
"pct": 65.85160777769623
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA RTX A6000",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:03:16.754400+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 189.08276393299457
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 13.593108190460633,
|
||||
"std": 0.6113375543806666,
|
||||
"min": 12.9129464707711,
|
||||
"max": 14.096800271491071
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 1232.6245823189486,
|
||||
"std": 55.4361583139007,
|
||||
"min": 1170.947440940054,
|
||||
"max": 1278.299436980461
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 24.43446325266268,
|
||||
"std": 0.05958367621622373,
|
||||
"min": 24.387022126989905,
|
||||
"max": 24.501337252993835
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 23.302734375,
|
||||
"pct": 49.160025803760085
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Offload",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:45:06.153019+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 101.25457232699955
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 24.720617400371953,
|
||||
"std": 0.0059618599726984295,
|
||||
"min": 24.716927952372927,
|
||||
"max": 24.727495488498064
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 9782.187433962441,
|
||||
"std": 2.359165661739719,
|
||||
"min": 9780.727483700286,
|
||||
"max": 9784.909159967388
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 13.400609701333451,
|
||||
"std": 0.011325855757257303,
|
||||
"min": 13.389435630000662,
|
||||
"max": 13.412081471999954
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 7.91796875,
|
||||
"pct": 10.000107919270219
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:47:00.758560+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 54.114448966000054
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 10.902290160145071,
|
||||
"std": 0.011717783508844587,
|
||||
"min": 10.889823370330753,
|
||||
"max": 10.91307776345264
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 13341.807441650146,
|
||||
"std": 14.33977714053646,
|
||||
"min": 13326.551059121803,
|
||||
"max": 13355.008899689909
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 2.4532590479999876,
|
||||
"std": 0.004686582604909462,
|
||||
"min": 2.449214012000084,
|
||||
"max": 2.4583948149993375
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 5.146484375,
|
||||
"pct": 6.499823474907999
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:29:24.218730+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 97.12500511000053
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 25.186637106124792,
|
||||
"std": 0.01564156074320041,
|
||||
"min": 25.176655080716063,
|
||||
"max": 25.20466375456501
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 9966.595939452507,
|
||||
"std": 6.189516890762853,
|
||||
"min": 9962.645955439677,
|
||||
"max": 9973.729258616522
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 13.155961893666548,
|
||||
"std": 0.013725280074692658,
|
||||
"min": 13.141330864999873,
|
||||
"max": 13.168553112999689
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 11.453125,
|
||||
"pct": 14.464882298618786
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Offload",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:35:09.475885+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 72.44658932200036
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 26.354162261984143,
|
||||
"std": 0.2016890980989746,
|
||||
"min": 26.126549197344954,
|
||||
"max": 26.510662024401086
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 9976.949543004863,
|
||||
"std": 76.35385769823057,
|
||||
"min": 9890.78159584497,
|
||||
"max": 10036.195980725191
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 12.462525163000464,
|
||||
"std": 0.012756092294355367,
|
||||
"min": 12.452715442000226,
|
||||
"max": 12.476945533000617
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 16.083984375,
|
||||
"pct": 20.31349006294777
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:31:15.062827+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 28.47874303699973
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 11.081739629278019,
|
||||
"std": 0.19889239779611573,
|
||||
"min": 10.855698631694322,
|
||||
"max": 11.229935211006715
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 11895.994753646642,
|
||||
"std": 213.50645294640813,
|
||||
"min": 11653.344897999395,
|
||||
"max": 12055.079330773913
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 1.9923289040001084,
|
||||
"std": 0.00613332391088384,
|
||||
"min": 1.9878587729999708,
|
||||
"max": 1.9993211860000883
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 12.527994791666666,
|
||||
"pct": 15.822403937717219
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:27:13.470591+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 85.34243606500058
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 26.804595710779356,
|
||||
"std": 0.06729310221031364,
|
||||
"min": 26.729508818984065,
|
||||
"max": 26.85945477435236
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 10147.471062392868,
|
||||
"std": 25.47528844477991,
|
||||
"min": 10119.045262956117,
|
||||
"max": 10168.239171194939
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 12.175553453000248,
|
||||
"std": 0.01538792877423435,
|
||||
"min": 12.158267948000685,
|
||||
"max": 12.187759467999967
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 19.560546875,
|
||||
"pct": 24.704262657003266
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "sft",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:32:30.606234+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 23.356497423999826
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 23.741677026845252,
|
||||
"std": 0.04651049464446475,
|
||||
"min": 23.70207542828724,
|
||||
"max": 23.792894559815245
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 25486.148818001486,
|
||||
"std": 49.92795524795279,
|
||||
"min": 25443.637405132922,
|
||||
"max": 25541.12967153968
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 1.2819336799996865,
|
||||
"std": 0.0006079202348362681,
|
||||
"min": 1.2813300379993962,
|
||||
"max": 1.2825457899998582
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 52.83984375,
|
||||
"pct": 66.7348099772907
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "sft",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:28:52.686902+00:00",
|
||||
"success": false,
|
||||
"error_reason": "[rank0]: torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 37.09 GiB. GPU 0 has a total capacity of 79.18 GiB of which 34.48 GiB is free. Including non-PyTorch memory, this process has 44.69 GiB memory in use. Of the allocated memory 43.38 GiB is allocated by PyTorch, and 103.94 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)",
|
||||
"time_taken": 17.978304365999975
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 0,
|
||||
"pct": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "sft",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": null,
|
||||
"seq_len": 8192,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:31:56.529860+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 20.62643332300013
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 16.81390538290134,
|
||||
"std": 0.05651510665525934,
|
||||
"min": 16.751081970567313,
|
||||
"max": 16.860609944501103
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 26005.173345163068,
|
||||
"std": 87.40891016818526,
|
||||
"min": 25908.007714057374,
|
||||
"max": 26077.408806987827
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 0.6225078416667505,
|
||||
"std": 0.007687299084230651,
|
||||
"min": 0.617841731000226,
|
||||
"max": 0.6313804020001044
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 31.7421875,
|
||||
"pct": 40.089233819432565
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Offload",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:33:07.297136+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 108.76686536699981
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 20.708341728583434,
|
||||
"std": 0.004926960367148572,
|
||||
"min": 20.702702202532606,
|
||||
"max": 20.711810912813448
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 5952.495445170788,
|
||||
"std": 1.4162268291871345,
|
||||
"min": 5950.874395374987,
|
||||
"max": 5953.492642512722
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 5.503622571999888,
|
||||
"std": 0.0020800783397258095,
|
||||
"min": 5.501920187999531,
|
||||
"max": 5.505941123000412
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 20.568359375,
|
||||
"pct": 25.977093364044073
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Offload",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:41:29.404702+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 203.20685914300066
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 36.28241994221462,
|
||||
"std": 0.022193678051459942,
|
||||
"min": 36.26066970131873,
|
||||
"max": 36.3050319536981
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 4042.514189268571,
|
||||
"std": 2.4727749300619926,
|
||||
"min": 4040.0908212136933,
|
||||
"max": 4045.0335740674755
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 32.442406444666936,
|
||||
"std": 0.03856478525322434,
|
||||
"min": 32.40275257099984,
|
||||
"max": 32.47978104200047
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 31.056640625,
|
||||
"pct": 39.22341293150364
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:36:35.591532+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 80.70320002000062
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 21.67106712168685,
|
||||
"std": 0.0011546935789889254,
|
||||
"min": 21.66976201051341,
|
||||
"max": 21.671955962863645
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 6229.22540223386,
|
||||
"std": 0.3319101239291823,
|
||||
"min": 6228.850255425044,
|
||||
"max": 6229.480894591757
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 5.260317135999685,
|
||||
"std": 0.0009800976196505141,
|
||||
"min": 5.25973307699951,
|
||||
"max": 5.261448657999608
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 23.302734375,
|
||||
"pct": 29.430510011054018
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 1,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:38:09.656407+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 186.07668963200013
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 37.373497733547545,
|
||||
"std": 0.030793764694046207,
|
||||
"min": 37.350622380323436,
|
||||
"max": 37.40851070666222
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 4164.079880313542,
|
||||
"std": 3.430979270813021,
|
||||
"min": 4161.531154508035,
|
||||
"max": 4167.980955292829
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 31.492112124332987,
|
||||
"std": 0.048781656532353834,
|
||||
"min": 31.43624878099945,
|
||||
"max": 31.526298007999685
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 41.994140625,
|
||||
"pct": 53.037079519543404
|
||||
}
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 4,
|
||||
"model_name": "Qwen/Qwen3-0.6B",
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"ep": 1,
|
||||
"cp": 1,
|
||||
"docker_image": null,
|
||||
"device_name": "NVIDIA RTX A6000",
|
||||
"commit_sha": "c88d08fdf",
|
||||
"timestamp": "2026-06-24T22:55:54+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 291.91085167229176
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 17.217465998339005,
|
||||
"std": 0.02905058130694137,
|
||||
"min": 17.19503698271855,
|
||||
"max": 17.250282374540514
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 8225.003435798719,
|
||||
"std": 13.877833769765575,
|
||||
"min": 8214.288808538377,
|
||||
"max": 8240.68023789224
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 63.90305413212627,
|
||||
"std": 0.11015530079183487,
|
||||
"min": 63.77801387012005,
|
||||
"max": 63.985770548693836
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 6.298828125,
|
||||
"pct": 13.288163877053583
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "PrimeIntellect/INTELLECT-3",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Offload",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 3300,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:26:32.539787+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 1020.7996206080006
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 5.687602748221284,
|
||||
"std": 0.018745865227927518,
|
||||
"min": 5.676304894379825,
|
||||
"max": 5.709241557476678
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 5036.226163028962,
|
||||
"std": 16.598982223051312,
|
||||
"min": 5026.222203606826,
|
||||
"max": 5055.386772890979
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 207.41716993466676,
|
||||
"std": 2.02401520618876,
|
||||
"min": 205.080392803,
|
||||
"max": 208.62080098299975
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 131.494140625,
|
||||
"pct": 73.72330763876674
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "PrimeIntellect/INTELLECT-3",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 3300,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:12:47.559188+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 809.163406182
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 2.490786315088448,
|
||||
"std": 0.033110540270011306,
|
||||
"min": 2.4542463835991133,
|
||||
"max": 2.5187996340566254
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 4775.430825821454,
|
||||
"std": 63.48079468206003,
|
||||
"min": 4705.375071078247,
|
||||
"max": 4829.139032793618
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 54.28342847499971,
|
||||
"std": 1.2435951181078917,
|
||||
"min": 53.43692385699978,
|
||||
"max": 55.71122110999977
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 90.44466145833333,
|
||||
"pct": 50.70856822428712
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "PrimeIntellect/INTELLECT-3",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 3300,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:15:30.364274+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 984.287366173
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 5.827906818358083,
|
||||
"std": 0.022833943391300654,
|
||||
"min": 5.807295619326128,
|
||||
"max": 5.8524522502693515
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 5160.461813808787,
|
||||
"std": 20.21887044561124,
|
||||
"min": 5142.211126408267,
|
||||
"max": 5182.196163383928
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 202.34163654333315,
|
||||
"std": 1.810525756526242,
|
||||
"min": 200.36271737700008,
|
||||
"max": 203.91497343799983
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 153.607421875,
|
||||
"pct": 86.12130673399314
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-235B-A22B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Offload",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 6900,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:59:19.508644+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 549.3317680299988
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 4.168587169086432,
|
||||
"std": 0.01943333057040498,
|
||||
"min": 4.148011530875203,
|
||||
"max": 4.186629771954931
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 4127.532530653436,
|
||||
"std": 19.241939979838868,
|
||||
"min": 4107.159533133892,
|
||||
"max": 4145.397439615796
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 63.236984533667055,
|
||||
"std": 0.5393767880164467,
|
||||
"min": 62.76671389400144,
|
||||
"max": 63.82576015599989
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 150.33528645833334,
|
||||
"pct": 84.28675619955848
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-235B-A22B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Offload",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 6900,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:55:26.218741+00:00",
|
||||
"success": false,
|
||||
"error_reason": "[rank4]: torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 8.00 GiB. GPU 4 has a total capacity of 178.36 GiB of which 7.20 GiB is free. Including non-PyTorch memory, this process has 171.05 GiB memory in use. Of the allocated memory 168.36 GiB is allocated by PyTorch, and 418.92 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)",
|
||||
"time_taken": 1187.6552004240002
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 0,
|
||||
"pct": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-235B-A22B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 6900,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:37:50.660932+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 537.6964168579998
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 4.1765827538888205,
|
||||
"std": 0.051049197538156864,
|
||||
"min": 4.120994785084703,
|
||||
"max": 4.221362139742245
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 4135.449370348717,
|
||||
"std": 50.54643574807943,
|
||||
"min": 4080.408863758512,
|
||||
"max": 4179.787743115238
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 62.716718792332664,
|
||||
"std": 1.346972230949721,
|
||||
"min": 61.699117662999925,
|
||||
"max": 64.24419503999889
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 161.52018229166666,
|
||||
"pct": 90.55766311989025
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-235B-A22B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 6900,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-16T00:08:44.717309+00:00",
|
||||
"success": false,
|
||||
"error_reason": "Non-zero exit code: 1",
|
||||
"time_taken": 3980.190812207
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 0,
|
||||
"pct": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:32:10.654918+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 244.50675971500004
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 1.8819492849425725,
|
||||
"std": 0.018657004256960857,
|
||||
"min": 1.8647429725679725,
|
||||
"max": 1.9017792358057817
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 9266.367565195435,
|
||||
"std": 91.86361210349598,
|
||||
"min": 9181.646889574527,
|
||||
"max": 9364.006547801635
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 28.328965114333794,
|
||||
"std": 0.6755728629253066,
|
||||
"min": 27.88586488400142,
|
||||
"max": 29.106523622000168
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 32.041666666666664,
|
||||
"pct": 17.96443277014256
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:51:34.679404+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 449.1452536000015
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 6.946321930899347,
|
||||
"std": 0.04943793567535021,
|
||||
"min": 6.907147510672552,
|
||||
"max": 7.001869300686485
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 13225.618902255133,
|
||||
"std": 94.1285622896153,
|
||||
"min": 13151.031810296197,
|
||||
"max": 13331.379670491255
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 79.47065850533363,
|
||||
"std": 1.170419801192356,
|
||||
"min": 78.65436104000037,
|
||||
"max": 80.81161287000032
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 64.82161458333333,
|
||||
"pct": 36.34278919847233
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:36:31.593391+00:00",
|
||||
"success": false,
|
||||
"error_reason": "Non-zero exit code: 1",
|
||||
"time_taken": 63.58203920199958
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 0,
|
||||
"pct": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:43:48.864376+00:00",
|
||||
"success": false,
|
||||
"error_reason": "Non-zero exit code: 1",
|
||||
"time_taken": 210.35651835000044
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 0,
|
||||
"pct": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "sft",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:54:09.465200+00:00",
|
||||
"success": false,
|
||||
"error_reason": "Non-zero exit code: 1",
|
||||
"time_taken": 60.86861479300023
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 0,
|
||||
"pct": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:10:45.595226+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 106.1217524460003
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 8.808826116109998,
|
||||
"std": 0.004229053216833396,
|
||||
"min": 8.80401218210114,
|
||||
"max": 8.811943308874014
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 46083.769889207404,
|
||||
"std": 22.1244820507199,
|
||||
"min": 46058.58557699578,
|
||||
"max": 46100.0776233077
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 5.686930948999968,
|
||||
"std": 0.005284924202613482,
|
||||
"min": 5.680966203000025,
|
||||
"max": 5.691029913999955
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 10.216796875,
|
||||
"pct": 5.728134010521928
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:47:04.725977+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 254.2014976369992
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 12.348302496931252,
|
||||
"std": 0.006805052347726637,
|
||||
"min": 12.34074166489301,
|
||||
"max": 12.353936045871244
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 25040.256927943043,
|
||||
"std": 13.799488572419822,
|
||||
"min": 25024.924846721864,
|
||||
"max": 25051.680806885804
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 41.85612941899914,
|
||||
"std": 0.03884213222620387,
|
||||
"min": 41.831036413999755,
|
||||
"max": 41.90087012999902
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 28.810546875,
|
||||
"pct": 16.152877994496077
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:52:34.912968+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 77.61734246100059
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 6.465139069561914,
|
||||
"std": 0.04130725425852038,
|
||||
"min": 6.418776595758626,
|
||||
"max": 6.498024945638078
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 27541.81564064197,
|
||||
"std": 175.970968167648,
|
||||
"min": 27344.3091844938,
|
||||
"max": 27681.911116752446
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 4.634802302666685,
|
||||
"std": 0.08513574433508829,
|
||||
"min": 4.565404164000029,
|
||||
"max": 4.72980078099954
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 17.037109375,
|
||||
"pct": 9.552000186156143
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:09:40.928786+00:00",
|
||||
"success": false,
|
||||
"error_reason": "Non-zero exit code: 1",
|
||||
"time_taken": 45.902424454000084
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 0,
|
||||
"std": 0,
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 0,
|
||||
"pct": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "sft",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:51:22.159961+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 55.56085521700061
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 16.045704463732047,
|
||||
"std": 0.3669414038018912,
|
||||
"min": 15.635441903073977,
|
||||
"max": 16.34253889185774
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 68355.50317006244,
|
||||
"std": 1563.188724278261,
|
||||
"min": 66607.76415187177,
|
||||
"max": 69620.03267318218
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 3.743108587333154,
|
||||
"std": 0.11113779012396933,
|
||||
"min": 3.6789139749998867,
|
||||
"max": 3.8714394489998085
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 54.59375,
|
||||
"pct": 30.60844998319804
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "sft",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA B200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:47:34.969809+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 210.73784957300086
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 14.166913779062327,
|
||||
"std": 0.03189668324825658,
|
||||
"min": 14.133844861170086,
|
||||
"max": 14.19749221907924
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 26394.914306925668,
|
||||
"std": 59.42792016262459,
|
||||
"min": 26333.30235194374,
|
||||
"max": 26451.886158132867
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 39.612902531999985,
|
||||
"std": 0.12892289776828222,
|
||||
"min": 39.48159200600003,
|
||||
"max": 39.739297179999994
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 171.52994791666666,
|
||||
"pct": 96.16972330033852
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:29:07.316579+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 140.79688516900023
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 15.293682809246896,
|
||||
"std": 0.0014841779556249671,
|
||||
"min": 15.292477098886133,
|
||||
"max": 15.29534040662252
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 33099.95928339881,
|
||||
"std": 3.2121909754006244,
|
||||
"min": 33097.34977695445,
|
||||
"max": 33103.54680422854
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 7.918505162999888,
|
||||
"std": 0.0025994999660927214,
|
||||
"min": 7.915530807999858,
|
||||
"max": 7.920342067999627
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 31.6484375,
|
||||
"pct": 39.970830962963646
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:17:11.459622+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 624.2448271570001
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 27.942932963415544,
|
||||
"std": 0.014498147027639258,
|
||||
"min": 27.930455687231994,
|
||||
"max": 27.958837751284484
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 23385.51075359203,
|
||||
"std": 12.133535648026946,
|
||||
"min": 23375.068489827237,
|
||||
"max": 23398.821510491805
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 44.85819833366653,
|
||||
"std": 0.03992741859460502,
|
||||
"min": 44.812667397999576,
|
||||
"max": 44.887240678000126
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 63.6796875,
|
||||
"pct": 80.42514025650868
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:31:45.516492+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 253.7607040289995
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 2.9033962435015255,
|
||||
"std": 0.06185211772693289,
|
||||
"min": 2.8333683904138596,
|
||||
"max": 2.9505657988343432
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 6113.178662139965,
|
||||
"std": 130.23129279813597,
|
||||
"min": 5965.733139259937,
|
||||
"max": 6212.4954260190325
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 8.173900715999784,
|
||||
"std": 0.030643063802763774,
|
||||
"min": 8.154543812000156,
|
||||
"max": 8.20923029000005
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 74.587890625,
|
||||
"pct": 94.20180595190192
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:07:58.431560+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 118.56876047700007
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 21.186359822422222,
|
||||
"std": 0.0008420584654773224,
|
||||
"min": 21.185637325200606,
|
||||
"max": 21.187284596349986
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 48719.19229289033,
|
||||
"std": 1.9363594617136561,
|
||||
"min": 48717.53087104316,
|
||||
"max": 48721.31886107815
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 5.380075431333201,
|
||||
"std": 0.0007378815620199924,
|
||||
"min": 5.379241290999744,
|
||||
"max": 5.3806429229998685
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 10.255859375,
|
||||
"pct": 12.95277915246372
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:13:31.235946+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 202.00237810199997
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 36.80129006524934,
|
||||
"std": 0.038682209837297775,
|
||||
"min": 36.760663305779815,
|
||||
"max": 36.83767867963716
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 32802.60523065393,
|
||||
"std": 34.479151586600146,
|
||||
"min": 32766.39281662397,
|
||||
"max": 32835.03999993886
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 32.001040753666835,
|
||||
"std": 0.07306682405527636,
|
||||
"min": 31.934163717000047,
|
||||
"max": 32.07902539700035
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 28.849609375,
|
||||
"pct": 36.43601235213133
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:36:16.464322+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 73.39023454399921
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 13.898604576898995,
|
||||
"std": 0.09860944703652262,
|
||||
"min": 13.786370142108543,
|
||||
"max": 13.971346979414989
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 26025.535138303083,
|
||||
"std": 184.64901383576387,
|
||||
"min": 25815.37294466665,
|
||||
"max": 26161.747370419624
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 4.687673982000281,
|
||||
"std": 0.09089959338883277,
|
||||
"min": 4.6215637490004156,
|
||||
"max": 4.7913323130005665
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 17.095703125,
|
||||
"pct": 21.591254222341448
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:10:14.248139+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 179.18628272199976
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 35.369152588637945,
|
||||
"std": 0.05330515137907955,
|
||||
"min": 35.316299078746994,
|
||||
"max": 35.422898183835194
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 28965.660342784828,
|
||||
"std": 43.65439362726316,
|
||||
"min": 28922.37582213965,
|
||||
"max": 29009.675439032973
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 30.286332981666572,
|
||||
"std": 0.06468944241064038,
|
||||
"min": 30.22071294999978,
|
||||
"max": 30.350049833999947
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 36.104817708333336,
|
||||
"pct": 45.59907785553104
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "sft",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H100 80GB HBM3",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:27:53.996296+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 56.04371451099996
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 26.55059850068127,
|
||||
"std": 0.9214643188212911,
|
||||
"min": 25.52123970895786,
|
||||
"max": 27.298541372653315
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 49716.756124637475,
|
||||
"std": 1725.46832852818,
|
||||
"min": 47789.25230540903,
|
||||
"max": 51117.300574136076
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 5.014559059999859,
|
||||
"std": 0.12068159290123663,
|
||||
"min": 4.944470342999921,
|
||||
"max": 5.153909341999679
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 54.6328125,
|
||||
"pct": 68.99926460725865
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "PrimeIntellect/INTELLECT-3",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Offload",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 3300,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:40:32.097857+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 850.1089639260008
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 16.183996593923855,
|
||||
"std": 0.0037561429610161526,
|
||||
"min": 16.181544055966448,
|
||||
"max": 16.18832083048134
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 6299.056753540347,
|
||||
"std": 1.4619477672614645,
|
||||
"min": 6298.102188597488,
|
||||
"max": 6300.73981194519
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 166.49029159400015,
|
||||
"std": 0.06453865622834476,
|
||||
"min": 166.42061012799968,
|
||||
"max": 166.54801481200047
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 130.34765625,
|
||||
"pct": 93.23810509247556
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "PrimeIntellect/INTELLECT-3",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Offload",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 3300,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:27:51.581711+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 218.2948968770006
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 19.1682663627078,
|
||||
"std": 0.005302549001711897,
|
||||
"min": 19.16325925051159,
|
||||
"max": 19.173821745555
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 16153.725429668006,
|
||||
"std": 4.46863159297824,
|
||||
"min": 16149.50577234049,
|
||||
"max": 16158.407132617673
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 16.231846535000233,
|
||||
"std": 0.008343797303602548,
|
||||
"min": 16.22289656399971,
|
||||
"max": 16.239410609000515
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 84.234375,
|
||||
"pct": 60.253124103633404
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "PrimeIntellect/INTELLECT-3",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Offload",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 3300,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:56:15.445296+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 610.8198953759993
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 25.072133344311208,
|
||||
"std": 0.006226456419567391,
|
||||
"min": 25.0676110733694,
|
||||
"max": 25.079234992016517
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 9758.45428238915,
|
||||
"std": 2.4234312045658766,
|
||||
"min": 9756.694146000587,
|
||||
"max": 9761.21835130623
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 107.47203745833303,
|
||||
"std": 0.043855674302782005,
|
||||
"min": 107.42230272799952,
|
||||
"max": 107.50516088899985
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 128.84375,
|
||||
"pct": 92.16235603015416
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "PrimeIntellect/INTELLECT-3",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 3300,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:20:31.633435+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 1182.043570376
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 19.80122443240109,
|
||||
"std": 0.009098784296829253,
|
||||
"min": 19.79363619148072,
|
||||
"max": 19.811311550992613
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 16687.13991133496,
|
||||
"std": 7.667843324668441,
|
||||
"min": 16680.745052352813,
|
||||
"max": 16695.64065631736
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 15.714851607333307,
|
||||
"std": 0.012174909467773673,
|
||||
"min": 15.700846749000448,
|
||||
"max": 15.722915346000264
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 89.72265625,
|
||||
"pct": 64.17890964275439
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:21:23.241794+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 140.92812991700066
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 16.987738215725667,
|
||||
"std": 0.003842547228315253,
|
||||
"min": 16.9834062123014,
|
||||
"max": 16.990735168068667
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 36766.385851652594,
|
||||
"std": 8.316385162955287,
|
||||
"min": 36757.01014151481,
|
||||
"max": 36772.87212456442
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 7.128945582333472,
|
||||
"std": 0.00330733605842928,
|
||||
"min": 7.1251666289999775,
|
||||
"max": 7.131312663000244
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 31.6484375,
|
||||
"pct": 22.638230916696244
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:07:39.365493+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 537.1643096139996
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 29.16920060446058,
|
||||
"std": 0.022125997715458492,
|
||||
"min": 29.15022260355039,
|
||||
"max": 29.19350299028142
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 24411.777221181026,
|
||||
"std": 18.517303039959025,
|
||||
"min": 24395.894484571094,
|
||||
"max": 24432.115948890652
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 42.98113733000006,
|
||||
"std": 0.05581546205591432,
|
||||
"min": 42.91741776500021,
|
||||
"max": 43.021377362000294
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 63.6796875,
|
||||
"pct": 45.550288867437935
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:06:44.350139+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 249.35987513700002
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 2.8224020757175636,
|
||||
"std": 0.003054514902315025,
|
||||
"min": 2.819748382689604,
|
||||
"max": 2.8257410097727513
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 5942.643269541411,
|
||||
"std": 6.431363051397209,
|
||||
"min": 5937.055847696838,
|
||||
"max": 5949.6734847475345
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 7.401247934666874,
|
||||
"std": 0.02254675077815527,
|
||||
"min": 7.380187235000449,
|
||||
"max": 7.425033139000334
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 74.587890625,
|
||||
"pct": 53.352962261028935
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:14:27.917821+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 397.24606492099974
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 15.397168832361032,
|
||||
"std": 0.06657191378906012,
|
||||
"min": 15.321655222551161,
|
||||
"max": 15.447379181165193
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 12748.349255622132,
|
||||
"std": 55.11935452798206,
|
||||
"min": 12685.82647095371,
|
||||
"max": 12789.921772606987
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 42.89128534700012,
|
||||
"std": 0.5558737978726181,
|
||||
"min": 42.567282986000464,
|
||||
"max": 43.533143310000014
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 105.353515625,
|
||||
"pct": 75.35971450737547
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "sft",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:25:54.085658+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 98.99489516799986
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 16.63549253820368,
|
||||
"std": 0.819573259617385,
|
||||
"min": 15.705104680132697,
|
||||
"max": 17.25063363475304
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 35026.47571662118,
|
||||
"std": 1725.63347974548,
|
||||
"min": 33067.51912769404,
|
||||
"max": 36321.671793990135
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 7.173170910666461,
|
||||
"std": 0.6337301307519424,
|
||||
"min": 6.712108918000013,
|
||||
"max": 7.895820040999752
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 106.423828125,
|
||||
"pct": 76.12531254133928
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:24:02.574320+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 93.59855710200009
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 22.77780543062047,
|
||||
"std": 0.0042322790783645555,
|
||||
"min": 22.774391607679817,
|
||||
"max": 22.782540798115665
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 52378.80844495008,
|
||||
"std": 9.732357044068635,
|
||||
"min": 52370.95817252511,
|
||||
"max": 52389.69768130354
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 5.005079579333445,
|
||||
"std": 0.0016031840898894046,
|
||||
"min": 5.003228462999687,
|
||||
"max": 5.006020153000463
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 10.255859375,
|
||||
"pct": 7.336049774350283
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": 16,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:16:54.365807+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 199.22786494399998
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 37.50498548642796,
|
||||
"std": 0.08614247168198098,
|
||||
"min": 37.43500175224926,
|
||||
"max": 37.601192001603245
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 33429.839848315816,
|
||||
"std": 76.78256624065938,
|
||||
"min": 33367.46027410088,
|
||||
"max": 33515.59293828403
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 31.42467853866674,
|
||||
"std": 0.12039063430338016,
|
||||
"min": 31.285738278999816,
|
||||
"max": 31.498099366000133
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 28.849609375,
|
||||
"pct": 20.636219999414973
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:05:47.581338+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 94.38669985200022
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 14.6522948792678,
|
||||
"std": 0.09331446034479328,
|
||||
"min": 14.548699267346166,
|
||||
"max": 14.72975492212209
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 27436.841815830994,
|
||||
"std": 174.73399960250234,
|
||||
"min": 27242.856065439788,
|
||||
"max": 27581.887964598303
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 4.415443519999826,
|
||||
"std": 0.08516777230844812,
|
||||
"min": 4.348332472000038,
|
||||
"max": 4.51125360099968
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 17.095703125,
|
||||
"pct": 12.228612392856222
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "rl",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 65536,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_3",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T23:11:11.497803+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 178.26785598200058
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 36.07478778767836,
|
||||
"std": 0.045382177103142095,
|
||||
"min": 36.02410276426409,
|
||||
"max": 36.11165476465475
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 29543.54214105793,
|
||||
"std": 37.16585304924738,
|
||||
"min": 29502.033508104272,
|
||||
"max": 29573.734448614276
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 29.889196768666807,
|
||||
"std": 0.03833519915834691,
|
||||
"min": 29.858544257000176,
|
||||
"max": 29.932179942999937
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 36.104817708333336,
|
||||
"pct": 25.825894263704924
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"config": {
|
||||
"type": "sft",
|
||||
"num_gpus": 8,
|
||||
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
|
||||
"lora_rank": null,
|
||||
"seq_len": 16384,
|
||||
"ac": "Recompute",
|
||||
"attention": "flash_attention_2",
|
||||
"output": "/tmp/benchmark_result.json",
|
||||
"dry_run": false,
|
||||
"timeout": 1500,
|
||||
"micro_batches": 2,
|
||||
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
|
||||
"device_name": "NVIDIA H200",
|
||||
"commit_sha": "unknown",
|
||||
"timestamp": "2026-01-15T22:55:02.193975+00:00",
|
||||
"success": true,
|
||||
"error_reason": null,
|
||||
"time_taken": 55.37509840599978
|
||||
},
|
||||
"metrics": {
|
||||
"mfu": {
|
||||
"mean": 28.37954151134585,
|
||||
"std": 0.9404399349147221,
|
||||
"min": 27.327257024240104,
|
||||
"max": 29.13795577178809
|
||||
},
|
||||
"throughput": {
|
||||
"mean": 53141.50429461707,
|
||||
"std": 1761.000713141191,
|
||||
"min": 51171.07145417345,
|
||||
"max": 54561.65671893574
|
||||
},
|
||||
"step_time": {
|
||||
"mean": 4.706847163666983,
|
||||
"std": 0.10895631514583606,
|
||||
"min": 4.640467990000616,
|
||||
"max": 4.832593936000194
|
||||
},
|
||||
"peak_memory": {
|
||||
"gib": 54.6328125,
|
||||
"pct": 39.079029573057724
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,185 +0,0 @@
|
||||
"""Benchmark prime-mega-moe's fused Mega MoE kernels (bf16 forward + backward) against prime-rl's
|
||||
bf16 EP path (``TorchTokenDispatcher`` + ``BF16ExpertCompute``) for the same routed-expert
|
||||
workload, weights, and token counts, and check the gradients agree.
|
||||
|
||||
Requires >=2 SM90+ GPUs, PyTorch >= 2.9 (CUDA symmetric memory), and the prime-mega-moe
|
||||
``deep_gemm`` wheel from Prime Intellect installed over the public one. ``NCCL_MAX_CTAS`` defaults to half
|
||||
the SMs Mega MoE reserves for NCCL (16). ``--hidden`` must be a multiple of 256 and ``--intermediate`` a
|
||||
multiple of 128.
|
||||
|
||||
Usage:
|
||||
torchrun --nproc_per_node=8 benchmarks/mega_moe/bench_mega_moe.py \
|
||||
--num-experts 128 --top-k 8 --hidden 2048 --intermediate 1024 --tokens-per-rank 2048
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
|
||||
import torch
|
||||
import torch.distributed as dist
|
||||
|
||||
from prime_rl.trainer.distributed.token_dispatcher import FusedTokenDispatcher, TorchTokenDispatcher
|
||||
from prime_rl.trainer.models.layers.expert_compute import BF16ExpertCompute
|
||||
from prime_rl.trainer.models.layers.mega_moe import (
|
||||
MegaMoEExpertCompute,
|
||||
default_nccl_max_ctas,
|
||||
mega_moe_available,
|
||||
reserve_sms_for_comm,
|
||||
)
|
||||
from prime_rl.trainer.models.layers.moe import GroupedExperts
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--num-experts", type=int, default=128)
|
||||
parser.add_argument("--top-k", type=int, default=8)
|
||||
parser.add_argument("--hidden", type=int, default=2048)
|
||||
parser.add_argument("--intermediate", type=int, default=1024)
|
||||
parser.add_argument("--tokens-per-rank", type=int, default=2048)
|
||||
parser.add_argument("--warmup", type=int, default=10)
|
||||
parser.add_argument("--iters", type=int, default=50)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def bench(fn, warmup: int, iters: int) -> float:
|
||||
for _ in range(warmup):
|
||||
fn()
|
||||
torch.cuda.synchronize()
|
||||
dist.barrier()
|
||||
start, end = torch.cuda.Event(enable_timing=True), torch.cuda.Event(enable_timing=True)
|
||||
start.record()
|
||||
for _ in range(iters):
|
||||
fn()
|
||||
end.record()
|
||||
torch.cuda.synchronize()
|
||||
return start.elapsed_time(end) / iters
|
||||
|
||||
|
||||
def rel_diff(a: torch.Tensor, b: torch.Tensor) -> float:
|
||||
return ((a.float() - b.float()).norm() / b.float().norm().clamp_min(1e-12)).item()
|
||||
|
||||
|
||||
def main() -> None:
|
||||
args = parse_args()
|
||||
local_rank = int(os.environ["LOCAL_RANK"])
|
||||
torch.cuda.set_device(local_rank)
|
||||
default_nccl_max_ctas(16, num_concurrent=2)
|
||||
dist.init_process_group(backend="nccl", device_id=torch.device("cuda", local_rank))
|
||||
rank, world_size = dist.get_rank(), dist.get_world_size()
|
||||
group = dist.group.WORLD
|
||||
|
||||
if not mega_moe_available():
|
||||
raise RuntimeError(
|
||||
"Mega MoE requires the prime-mega-moe deep_gemm wheel from Prime Intellect installed over the public one, on an SM90+ GPU."
|
||||
)
|
||||
if args.num_experts % world_size:
|
||||
raise ValueError(f"num_experts ({args.num_experts}) must be divisible by world_size ({world_size}).")
|
||||
|
||||
torch.manual_seed(rank)
|
||||
experts_per_rank = args.num_experts // world_size
|
||||
device = torch.device("cuda", local_rank)
|
||||
|
||||
experts = GroupedExperts(
|
||||
dim=args.hidden,
|
||||
hidden_dim=args.intermediate,
|
||||
num_experts=experts_per_rank,
|
||||
).to(device=device, dtype=torch.bfloat16)
|
||||
experts.init_weights(init_std=0.02)
|
||||
params = [p for p in experts.parameters() if p is not None]
|
||||
|
||||
x = torch.randn(args.tokens_per_rank, args.hidden, dtype=torch.bfloat16, device=device, requires_grad=True)
|
||||
dy = torch.randn(args.tokens_per_rank, args.hidden, dtype=torch.bfloat16, device=device)
|
||||
scores = torch.softmax(
|
||||
torch.randn(args.tokens_per_rank, args.num_experts, device=device, dtype=torch.float32), dim=-1
|
||||
)
|
||||
# Keep the model's (num_tokens, top_k) routing shape: the Mega MoE backward returns dtop_scores in it.
|
||||
top_scores, selected_experts_indices = torch.topk(scores, args.top_k, dim=-1)
|
||||
top_scores = top_scores.contiguous().requires_grad_(True)
|
||||
selected_experts_indices = selected_experts_indices.contiguous()
|
||||
|
||||
bf16_compute = BF16ExpertCompute()
|
||||
baseline = (
|
||||
TorchTokenDispatcher(
|
||||
num_experts=args.num_experts,
|
||||
top_k=args.top_k,
|
||||
token_group_alignment=bf16_compute.token_group_alignment,
|
||||
group=group,
|
||||
),
|
||||
bf16_compute,
|
||||
)
|
||||
mega_compute = MegaMoEExpertCompute(
|
||||
num_experts=args.num_experts,
|
||||
top_k=args.top_k,
|
||||
hidden=args.hidden,
|
||||
intermediate_hidden=args.intermediate,
|
||||
group=group,
|
||||
max_tokens_per_rank=args.tokens_per_rank,
|
||||
num_sms=reserve_sms_for_comm(16, num_concurrent=2),
|
||||
)
|
||||
mega = (FusedTokenDispatcher(), mega_compute)
|
||||
|
||||
def run(path, backward: bool):
|
||||
dispatcher, compute = path
|
||||
|
||||
def fn():
|
||||
experts.compute = compute
|
||||
y = dispatcher.run(x, top_scores, selected_experts_indices, experts, score_before_experts=False)
|
||||
if backward:
|
||||
y.backward(dy)
|
||||
return y
|
||||
|
||||
return fn
|
||||
|
||||
def grads_after(fn):
|
||||
for p in params:
|
||||
p.grad = None
|
||||
x.grad = None
|
||||
top_scores.grad = None
|
||||
y = fn()
|
||||
torch.cuda.synchronize()
|
||||
return y.detach().clone(), x.grad.clone(), top_scores.grad.clone(), [p.grad.clone() for p in params]
|
||||
|
||||
y_ref, dx_ref, ds_ref, dp_ref = grads_after(run(baseline, backward=True))
|
||||
y_mega, dx_mega, ds_mega, dp_mega = grads_after(run(mega, backward=True))
|
||||
diffs = {
|
||||
"y": rel_diff(y_mega, y_ref),
|
||||
"dx": rel_diff(dx_mega, dx_ref),
|
||||
"dtop_scores": rel_diff(ds_mega, ds_ref),
|
||||
"dexperts": max(rel_diff(a, b) for a, b in zip(dp_mega, dp_ref)),
|
||||
}
|
||||
|
||||
def bench_fwd_bwd(path):
|
||||
fwd = bench(run(path, backward=False), args.warmup, args.iters)
|
||||
total = bench(run(path, backward=True), args.warmup, args.iters)
|
||||
return fwd, total
|
||||
|
||||
base_fwd, base_total = bench_fwd_bwd(baseline)
|
||||
mega_fwd, mega_total = bench_fwd_bwd(mega)
|
||||
|
||||
if rank == 0:
|
||||
print(
|
||||
f"world_size={world_size} num_experts={args.num_experts} (per rank={experts_per_rank}) "
|
||||
f"top_k={args.top_k} hidden={args.hidden} intermediate={args.intermediate} "
|
||||
f"tokens_per_rank={args.tokens_per_rank}"
|
||||
)
|
||||
print(f"{'':46} {'fwd':>10} {'bwd':>10} {'fwd+bwd':>10}")
|
||||
print(
|
||||
f"{'bf16 EP (TorchTokenDispatcher+BF16ExpertCompute)':46} "
|
||||
f"{base_fwd:9.3f}ms {base_total - base_fwd:9.3f}ms {base_total:9.3f}ms"
|
||||
)
|
||||
print(
|
||||
f"{'Mega MoE (fused bf16 fwd + fused bf16 bwd)':46} "
|
||||
f"{mega_fwd:9.3f}ms {mega_total - mega_fwd:9.3f}ms {mega_total:9.3f}ms"
|
||||
)
|
||||
print(
|
||||
f"{'speedup':46} {base_fwd / mega_fwd:9.2f}x "
|
||||
f"{(base_total - base_fwd) / (mega_total - mega_fwd):9.2f}x {base_total / mega_total:9.2f}x"
|
||||
)
|
||||
print("relative diff vs bf16 EP path: " + ", ".join(f"{k}={v:.4f}" for k, v in diffs.items()))
|
||||
|
||||
mega_compute.destroy()
|
||||
dist.destroy_process_group()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,89 @@
|
||||
# Performance Benchmarks
|
||||
|
||||
Automated benchmark results for prime-rl using `--bench` flag.
|
||||
|
||||
**Last Updated:** 2026-02-01 00:43 UTC
|
||||
**Commit:** `unknown`
|
||||
**Docker Image:** `primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6`
|
||||
|
||||
> :warning: indicates regression > 5% from baseline
|
||||
> diffs shown when abs(change) >= 1.0% (except regressions, which always show diffs)
|
||||
|
||||
> :clock10: The Step Time shown is the time taken per micro batch. This differs from what gets displayed in the bench table which is the total step time.
|
||||
## INTELLECT-3
|
||||
|
||||
| Type | SeqLen | AC | Attn | EP | CP | Hardware | MFU | TPS | Step Time | Peak Mem |
|
||||
|------|--------|----|----|----|----|----------|-----|-----|-----------|----------|
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 8xH200 | 19.8% | 16.69k | 7.85s | 89.7 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Offload | FA3 | 1 | 1 | 8xH200 | 19.2% | 16.15k | 8.11s | 84.2 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA2 | 1 | 1 | 8xB200 | 2.5% | 4.78k | 27.45s | 90.4 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Offload | FA3 | 1 | 1 | 8xH200 | 25.1% | 9.76k | 53.73s | 128.8 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Offload | FA2 | 1 | 1 | 8xH200 | 16.2% | 6.30k | 83.23s | 130.3 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Recompute | FA2 | 1 | 1 | 8xB200 | 5.8% | 5.16k | 101.60s | 153.6 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Offload | FA2 | 1 | 1 | 8xB200 | 5.7% | 5.04k | 104.10s | 131.5 GiB |
|
||||
|
||||
## Qwen3-0.6B
|
||||
|
||||
| Type | SeqLen | AC | Attn | EP | CP | Hardware | MFU | TPS | Step Time | Peak Mem |
|
||||
|------|--------|----|----|----|----|----------|-----|-----|-----------|----------|
|
||||
| RL Full | 16384 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 11.1% | 11.90k | 1.38s | 12.5 GiB |
|
||||
| RL Full | 16384 | Recompute | FA2 | 1 | 1 | 1xA6000 | 10.9% | 3.69k | 4.44s | 12.5 GiB |
|
||||
| RL Full | 65536 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 26.8% | 10.15k | 6.46s | 19.6 GiB |
|
||||
| RL Full | 65536 | Offload | FA3 | 1 | 1 | 1xH100 HBM3 | 26.4% | 9.98k | 6.57s | 16.1 GiB |
|
||||
| RL Full | 65536 | Recompute | FA2 | 1 | 1 | 4xA6000 | 16.2% | 7.72k | 33.94s | 12.4 GiB |
|
||||
| RL Full | 65536 | Recompute | FA2 | 1 | 1 | 1xA6000 | 17.1% | 2.04k | 32.12s | 19.5 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 10.9% | 13.34k | 1.23s | 5.1 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA2 | 1 | 1 | 1xA6000 | 6.3% | 2.41k | 6.79s | 5.1 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 25.2% | 9.97k | 6.58s | 11.5 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Offload | FA3 | 1 | 1 | 1xH100 HBM3 | 24.7% | 9.78k | 6.70s | 7.9 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Recompute | FA2 | 1 | 1 | 1xA6000 | 16.0% | 1.99k | 32.85s | 11.5 GiB |
|
||||
| SFT Full | 8192 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 16.8% | 26.01k | 0.32s | 31.7 GiB |
|
||||
| SFT Full | 8192 | Recompute | FA2 | 1 | 1 | 1xA6000 | 13.5% | 6.60k | 1.24s | 31.2 GiB |
|
||||
| SFT Full | 16384 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 23.7% | 25.49k | 0.64s | 52.8 GiB |
|
||||
|
||||
## Qwen3-235B-A22B-Instruct-2507
|
||||
|
||||
| Type | SeqLen | AC | Attn | EP | CP | Hardware | MFU | TPS | Step Time | Peak Mem |
|
||||
|------|--------|----|----|----|----|----------|-----|-----|-----------|----------|
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA2 | 1 | 1 | 8xB200 | 4.2% | 4.14k | 31.69s | 161.5 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Offload | FA2 | 1 | 1 | 8xB200 | 4.2% | 4.13k | 31.76s | 150.3 GiB |
|
||||
|
||||
## Qwen3-30B-A3B-Instruct-2507
|
||||
|
||||
| Type | SeqLen | AC | Attn | EP | CP | Hardware | MFU | TPS | Step Time | Peak Mem |
|
||||
|------|--------|----|----|----|----|----------|-----|-----|-----------|----------|
|
||||
| RL Full | 16384 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 2.9% | 6.11k | 21.44s | 74.6 GiB |
|
||||
| RL Full | 16384 | Recompute | FA3 | 1 | 1 | 8xH200 | 2.8% | 5.94k | 22.06s | 74.6 GiB |
|
||||
| RL Full | 65536 | Recompute | FA3 | 1 | 1 | 8xH200 | 15.4% | 12.75k | 41.13s | 105.4 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 8xH200 | 17.0% | 36.77k | 3.56s | 31.6 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 15.3% | 33.10k | 3.96s | 31.6 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA2 | 1 | 1 | 8xB200 | 1.9% | 9.27k | 14.14s | 32.0 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Recompute | FA3 | 1 | 1 | 8xH200 | 29.2% | 24.41k | 21.48s | 63.7 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 27.9% | 23.39k | 22.42s | 63.7 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Recompute | FA2 | 1 | 1 | 8xB200 | 6.9% | 13.23k | 39.64s | 64.8 GiB |
|
||||
| SFT Full | 16384 | Recompute | FA3 | 1 | 1 | 8xH200 | 16.6% | 35.03k | 3.74s | 106.4 GiB |
|
||||
|
||||
## Qwen3-4B-Instruct-2507
|
||||
|
||||
| Type | SeqLen | AC | Attn | EP | CP | Hardware | MFU | TPS | Step Time | Peak Mem |
|
||||
|------|--------|----|----|----|----|----------|-----|-----|-----------|----------|
|
||||
| RL Full | 16384 | Recompute | FA2 | 1 | 1 | 8xB200 | 6.5% | 27.54k | 4.76s | 17.0 GiB |
|
||||
| RL Full | 16384 | Recompute | FA3 | 1 | 1 | 8xH200 | 14.7% | 27.44k | 4.78s | 17.1 GiB |
|
||||
| RL Full | 16384 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 13.9% | 26.03k | 5.04s | 17.1 GiB |
|
||||
| RL Full | 65536 | Recompute | FA3 | 1 | 1 | 8xH200 | 36.1% | 29.54k | 17.75s | 36.1 GiB |
|
||||
| RL Full | 65536 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 35.4% | 28.97k | 18.10s | 36.1 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 8xH200 | 22.8% | 52.38k | 2.50s | 10.3 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 21.2% | 48.72k | 2.69s | 10.3 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA2 | 1 | 1 | 8xB200 | 8.8% | 46.08k | 2.84s | 10.2 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 21.7% | 6.23k | 2.63s | 23.3 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Offload | FA3 | 1 | 1 | 1xH100 HBM3 | 20.7% | 5.95k | 2.75s | 20.6 GiB |
|
||||
| RL LoRA(r=16) | 16384 | Recompute | FA2 | 1 | 1 | 1xA6000 | 13.6% | 1.23k | 13.29s | 23.3 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Recompute | FA3 | 1 | 1 | 8xH200 | 37.5% | 33.43k | 15.68s | 28.8 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 36.8% | 32.80k | 15.98s | 28.8 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Recompute | FA2 | 1 | 1 | 8xB200 | 12.3% | 25.04k | 20.94s | 28.8 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 37.4% | 4.16k | 15.74s | 42.0 GiB |
|
||||
| RL LoRA(r=16) | 65536 | Offload | FA3 | 1 | 1 | 1xH100 HBM3 | 36.3% | 4.04k | 16.21s | 31.1 GiB |
|
||||
| SFT Full | 16384 | Recompute | FA2 | 1 | 1 | 8xB200 | 16.0% | 68.36k | 1.92s | 54.6 GiB |
|
||||
| SFT Full | 16384 | Recompute | FA2 | 1 | 1 | 8xH200 | 28.4% | 53.14k | 2.47s | 54.6 GiB |
|
||||
| SFT Full | 16384 | Recompute | FA2 | 1 | 1 | 8xH100 HBM3 | 26.6% | 49.72k | 2.64s | 54.6 GiB |
|
||||
| SFT Full | 65536 | Recompute | FA2 | 1 | 1 | 8xB200 | 14.2% | 26.39k | 19.86s | 171.5 GiB |
|
||||
@@ -0,0 +1,233 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Aggregate benchmark results from multiple JSON files into markdown report."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import sys
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
from typing import Annotated
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from prime_rl.utils.config import BaseConfig, cli
|
||||
|
||||
SHORTENED_ATTN_MAPPING = {
|
||||
"flash_attention_2": "FA2",
|
||||
"flash_attention_3": "FA3",
|
||||
"flash_attention_4": "FA4",
|
||||
}
|
||||
|
||||
# These words are stripped from the device name to get the short name
|
||||
DEVICE_NAME_STRIP_WORDS = ["NVIDIA", "RTX", "80GB", "40GB"]
|
||||
|
||||
|
||||
class AggregateConfig(BaseConfig):
|
||||
"""Configuration for aggregating benchmark results."""
|
||||
|
||||
artifacts_dir: Annotated[Path, Field(description="Directory containing benchmark JSON artifacts")]
|
||||
baselines_dir: Annotated[Path, Field(description="Directory containing baseline JSON artifacts")]
|
||||
output_markdown: Annotated[Path, Field(description="Output markdown file path")]
|
||||
regression_threshold: Annotated[float, Field(description="Regression threshold (default: 0.05 = 5%)")] = 0.05
|
||||
diff_display_threshold: Annotated[float, Field(description="Diff display threshold (default: 0.01 = 1%)")] = 0.01
|
||||
|
||||
|
||||
def get_hardware(config: dict) -> str:
|
||||
num_gpus = config.get("num_gpus", 1)
|
||||
device_name = config.get("device_name", "Unknown")
|
||||
short_name = " ".join(word for word in device_name.split() if word not in DEVICE_NAME_STRIP_WORDS)
|
||||
return f"{num_gpus}x{short_name}"
|
||||
|
||||
|
||||
def get_training_type(config: dict) -> str:
|
||||
train_type = config.get("type", "unknown").upper()
|
||||
lora_rank = config.get("lora_rank")
|
||||
if lora_rank is not None:
|
||||
return f"{train_type} LoRA(r={lora_rank})"
|
||||
return f"{train_type} Full"
|
||||
|
||||
|
||||
def get_config_key(config: dict) -> str:
|
||||
"""Get a unique key for a benchmark configuration."""
|
||||
return "|".join(
|
||||
[
|
||||
config.get("model_name", "unknown"),
|
||||
get_hardware(config),
|
||||
config.get("type", "rl"),
|
||||
str(config.get("lora_rank") or "none"),
|
||||
str(config.get("seq_len", 0)),
|
||||
config.get("ac", "None"),
|
||||
config.get("attention", "unknown"),
|
||||
str(config.get("ep", 1)),
|
||||
str(config.get("cp", 1)),
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
def load_json_dir(directory: Path) -> list[dict]:
|
||||
"""Load all JSON files from a directory."""
|
||||
results = []
|
||||
if not directory.exists():
|
||||
return results
|
||||
for f in directory.rglob("*.json"):
|
||||
try:
|
||||
results.append(json.loads(f.read_text()))
|
||||
except Exception as e:
|
||||
print(f"Warning: Failed to load {f}: {e}", file=sys.stderr)
|
||||
return results
|
||||
|
||||
|
||||
def format_metric(
|
||||
value: float,
|
||||
baseline: float | None,
|
||||
threshold: float,
|
||||
diff_display_threshold: float,
|
||||
fmt: str,
|
||||
higher_is_better: bool = True,
|
||||
) -> tuple[str, bool]:
|
||||
formatted = fmt.format(value)
|
||||
if baseline is None or baseline == 0:
|
||||
return formatted, False
|
||||
|
||||
pct_change = (value - baseline) / baseline * 100
|
||||
is_regression = (value < baseline * (1 - threshold)) if higher_is_better else (value > baseline * (1 + threshold))
|
||||
|
||||
if is_regression:
|
||||
return f"**{formatted}** :warning: ({pct_change:+.1f}%)", True
|
||||
elif abs(pct_change) >= diff_display_threshold * 100:
|
||||
return f"{formatted} ({pct_change:+.1f}%)", False
|
||||
return formatted, False
|
||||
|
||||
|
||||
def sorting_key(x: dict) -> tuple:
|
||||
return (
|
||||
get_training_type(x["config"]),
|
||||
x["config"]["seq_len"],
|
||||
-x["metrics"]["throughput"]["mean"],
|
||||
get_hardware(x["config"]),
|
||||
x["config"]["ac"],
|
||||
x["config"]["attention"],
|
||||
)
|
||||
|
||||
|
||||
def generate_markdown(
|
||||
results: list[dict],
|
||||
baselines: dict[str, dict],
|
||||
threshold: float,
|
||||
diff_display_threshold: float,
|
||||
) -> tuple[str, bool]:
|
||||
has_regressions = False
|
||||
|
||||
by_model: dict[str, list[dict]] = {}
|
||||
for r in results:
|
||||
if r["config"]["success"]:
|
||||
model = r["config"]["model_name"]
|
||||
by_model.setdefault(model, []).append(r)
|
||||
|
||||
commit = results[0]["config"].get("commit_sha", "unknown") if results else "unknown"
|
||||
docker_image = results[0]["config"].get("docker_image", "unknown") if results else "unknown"
|
||||
|
||||
lines = [
|
||||
"# Performance Benchmarks",
|
||||
"",
|
||||
"Automated benchmark results for prime-rl using `--bench` flag.",
|
||||
"",
|
||||
f"**Last Updated:** {datetime.now(timezone.utc).strftime('%Y-%m-%d %H:%M UTC')} ",
|
||||
f"**Commit:** `{commit}` ",
|
||||
f"**Docker Image:** `{docker_image}`",
|
||||
"",
|
||||
f"> :warning: indicates regression > {threshold * 100:.0f}% from baseline",
|
||||
f"> diffs shown when abs(change) >= {diff_display_threshold * 100:.1f}% (except regressions, which always show diffs)",
|
||||
"",
|
||||
"> :clock10: The Step Time shown is the time taken per micro batch. This differs from what gets displayed in the bench table which is the total step time."
|
||||
"",
|
||||
]
|
||||
|
||||
for model, model_results in sorted(by_model.items()):
|
||||
lines.append(f"## {model.split('/')[-1]}")
|
||||
lines.append("")
|
||||
lines.append("| Type | SeqLen | AC | Attn | EP | CP | Hardware | MFU | TPS | Step Time | Peak Mem |")
|
||||
lines.append("|------|--------|----|----|----|----|----------|-----|-----|-----------|----------|")
|
||||
|
||||
for r in sorted(model_results, key=sorting_key):
|
||||
cfg, m = r["config"], r["metrics"]
|
||||
bl = baselines.get(get_config_key(cfg), {})
|
||||
|
||||
mfu_str, mfu_reg = format_metric(
|
||||
m["mfu"]["mean"], bl.get("mfu"), threshold, diff_display_threshold, "{:.1f}%", True
|
||||
)
|
||||
tps_str, tps_reg = format_metric(
|
||||
m["throughput"]["mean"] / 1000,
|
||||
bl.get("throughput", 0) / 1000 if bl.get("throughput") else None,
|
||||
threshold,
|
||||
diff_display_threshold,
|
||||
"{:.2f}k",
|
||||
True,
|
||||
)
|
||||
step_str, step_reg = format_metric(
|
||||
cfg["seq_len"] * cfg["num_gpus"] / m["throughput"]["mean"],
|
||||
None,
|
||||
threshold,
|
||||
diff_display_threshold,
|
||||
"{:.2f}s",
|
||||
False,
|
||||
)
|
||||
|
||||
has_regressions = has_regressions or mfu_reg or tps_reg or step_reg
|
||||
attn = SHORTENED_ATTN_MAPPING.get(cfg["attention"], cfg["attention"])
|
||||
|
||||
lines.append(
|
||||
f"| {get_training_type(cfg)} | {cfg['seq_len']} | {cfg.get('ac', 'None')} | {attn} | {cfg.get('ep', 1)} | {cfg.get('cp', 1)} | {get_hardware(cfg)} | "
|
||||
f"{mfu_str} | {tps_str} | {step_str} | {m['peak_memory']['gib']:.1f} GiB |"
|
||||
)
|
||||
lines.append("")
|
||||
|
||||
failed = [r for r in results if not r["config"]["success"]]
|
||||
if failed:
|
||||
lines.append("## Failed Benchmarks")
|
||||
lines.append("")
|
||||
for r in failed:
|
||||
cfg = r["config"]
|
||||
error = (cfg.get("error_reason") or "Unknown error")[:200]
|
||||
lines.append(f"- **{cfg['model_name']}** ({get_training_type(cfg)}) on {get_hardware(cfg)}: {error}")
|
||||
lines.append("")
|
||||
|
||||
return "\n".join(lines), has_regressions
|
||||
|
||||
|
||||
def main():
|
||||
config = cli(AggregateConfig)
|
||||
|
||||
results = load_json_dir(config.artifacts_dir)
|
||||
print(f"Loaded {len(results)} benchmark results", file=sys.stderr)
|
||||
|
||||
baseline_results = load_json_dir(config.baselines_dir)
|
||||
baselines = {}
|
||||
for r in baseline_results:
|
||||
if r["config"]["success"]:
|
||||
m = r["metrics"]
|
||||
baselines[get_config_key(r["config"])] = {
|
||||
"mfu": m["mfu"]["mean"],
|
||||
"throughput": m["throughput"]["mean"],
|
||||
"step_time": m["step_time"]["mean"],
|
||||
}
|
||||
print(f"Loaded {len(baselines)} baseline entries", file=sys.stderr)
|
||||
|
||||
markdown, has_regressions = generate_markdown(
|
||||
results, baselines, config.regression_threshold, config.diff_display_threshold
|
||||
)
|
||||
config.output_markdown.parent.mkdir(parents=True, exist_ok=True)
|
||||
config.output_markdown.write_text(markdown)
|
||||
print(f"Wrote markdown report to {config.output_markdown}", file=sys.stderr)
|
||||
|
||||
successful = sum(1 for r in results if r["config"]["success"])
|
||||
print(f"\nSummary: {successful} successful, {len(results) - successful} failed benchmarks", file=sys.stderr)
|
||||
|
||||
if has_regressions:
|
||||
Path("/tmp/prime-rl-benchmark-aggregate-has-regressions").touch()
|
||||
print("WARNING: Performance regressions detected!", file=sys.stderr)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,507 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Exercise Prime's layerwise reload path with vLLM online NVFP4 weights."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import importlib.metadata
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
import time
|
||||
from functools import partial
|
||||
from pathlib import Path
|
||||
from typing import Any, Iterable
|
||||
|
||||
DEFAULT_MODEL = "Qwen/Qwen3-30B-A3B-Instruct-2507"
|
||||
EXPERT_WEIGHT_SUFFIXES = (
|
||||
".gate_proj.weight",
|
||||
".up_proj.weight",
|
||||
".down_proj.weight",
|
||||
)
|
||||
KERNEL_WEIGHT_NAMES = {"w13_weight", "w2_weight"}
|
||||
KERNEL_DERIVED_NAMES = {
|
||||
"g1_scale_c",
|
||||
"gemm1_alpha",
|
||||
"gemm1_beta",
|
||||
"gemm1_clamp_limit",
|
||||
}
|
||||
|
||||
|
||||
def _package_version(name: str) -> str:
|
||||
try:
|
||||
return importlib.metadata.version(name)
|
||||
except importlib.metadata.PackageNotFoundError:
|
||||
return "not-installed"
|
||||
|
||||
|
||||
def environment_probe() -> dict[str, Any]:
|
||||
import torch
|
||||
import vllm
|
||||
from vllm._custom_ops import scaled_fp4_quant
|
||||
from vllm.model_executor.layers.quantization.online.nvfp4 import (
|
||||
Nvfp4OnlineMoEMethod,
|
||||
)
|
||||
from vllm.utils.flashinfer import has_flashinfer_trtllm_fused_moe
|
||||
|
||||
from prime_rl.inference.vllm.worker.weight_transfer import (
|
||||
load_weights_checkpoint_layerwise,
|
||||
)
|
||||
|
||||
if not torch.cuda.is_available():
|
||||
raise RuntimeError("CUDA is unavailable")
|
||||
|
||||
capability = torch.cuda.get_device_capability()
|
||||
if capability[0] != 10:
|
||||
raise RuntimeError(f"online NVFP4 requires SM100, found SM{capability[0]}{capability[1]}")
|
||||
if not has_flashinfer_trtllm_fused_moe():
|
||||
raise RuntimeError("FlashInfer TRTLLM fused MoE is unavailable")
|
||||
|
||||
source = torch.arange(256, device="cuda", dtype=torch.bfloat16).reshape(16, 16)
|
||||
scale = torch.ones((), device="cuda", dtype=torch.float32)
|
||||
packed, block_scales = scaled_fp4_quant(
|
||||
source,
|
||||
scale,
|
||||
is_sf_swizzled_layout=False,
|
||||
)
|
||||
torch.cuda.synchronize()
|
||||
|
||||
return {
|
||||
"torch": _package_version("torch"),
|
||||
"torch_cuda": torch.version.cuda,
|
||||
"vllm": _package_version("vllm"),
|
||||
"vllm_module": str(Path(vllm.__file__).resolve()),
|
||||
"flashinfer_python": _package_version("flashinfer-python"),
|
||||
"flashinfer_cubin": _package_version("flashinfer-cubin"),
|
||||
"gpu": torch.cuda.get_device_name(),
|
||||
"compute_capability": list(capability),
|
||||
"nvfp4_method": f"{Nvfp4OnlineMoEMethod.__module__}.{Nvfp4OnlineMoEMethod.__name__}",
|
||||
"prime_reload_helper": (
|
||||
f"{load_weights_checkpoint_layerwise.__module__}.{load_weights_checkpoint_layerwise.__name__}"
|
||||
),
|
||||
"scaled_fp4_quant": {
|
||||
"packed_shape": list(packed.shape),
|
||||
"packed_dtype": str(packed.dtype),
|
||||
"block_scale_shape": list(block_scales.shape),
|
||||
"block_scale_dtype": str(block_scales.dtype),
|
||||
},
|
||||
"persistent_cache": {
|
||||
"hit": os.environ.get("NVFP4_CACHE_HIT") == "1",
|
||||
"key": os.environ.get("NVFP4_CACHE_KEY"),
|
||||
"marker": os.environ.get("NVFP4_CACHE_READY_MARKER"),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def _mark_persistent_cache_ready() -> None:
|
||||
"""Mark the versioned JIT cache reusable after engine warmup succeeds."""
|
||||
marker_value = os.environ.get("NVFP4_CACHE_READY_MARKER")
|
||||
cache_key = os.environ.get("NVFP4_CACHE_KEY")
|
||||
if not marker_value or not cache_key:
|
||||
return
|
||||
|
||||
marker = Path(marker_value)
|
||||
marker.parent.mkdir(parents=True, exist_ok=True)
|
||||
temporary = marker.with_name(f".{marker.name}.{os.getpid()}.tmp")
|
||||
temporary.write_text(cache_key + "\n")
|
||||
os.replace(temporary, marker)
|
||||
|
||||
|
||||
def _get_worker_model(worker: Any):
|
||||
model_runner = worker.model_runner
|
||||
get_model = getattr(model_runner, "get_model", None)
|
||||
model = get_model() if callable(get_model) else model_runner.model
|
||||
return getattr(model, "runnable", model)
|
||||
|
||||
|
||||
def _is_expert_weight(name: str, layer_index: int) -> bool:
|
||||
marker = f"model.layers.{layer_index}.mlp.experts."
|
||||
return name.startswith(marker) and name.endswith(EXPERT_WEIGHT_SUFFIXES)
|
||||
|
||||
|
||||
def _reload_checkpoint(
|
||||
worker: Any,
|
||||
*,
|
||||
model_path: str,
|
||||
mutation_layer: int | None,
|
||||
) -> dict[str, Any]:
|
||||
"""Worker-side reload through Prime's production checkpoint-format helper."""
|
||||
import torch
|
||||
from torch.nn import Module
|
||||
from vllm.model_executor.model_loader import DefaultModelLoader, get_model_loader
|
||||
|
||||
from prime_rl.inference.vllm.worker.weight_transfer import (
|
||||
load_weights_checkpoint_layerwise,
|
||||
)
|
||||
|
||||
model = _get_worker_model(worker)
|
||||
if not isinstance(model, Module):
|
||||
raise TypeError(f"expected torch Module, got {type(model)!r}")
|
||||
|
||||
model_loader = get_model_loader(worker.load_config)
|
||||
if not isinstance(model_loader, DefaultModelLoader):
|
||||
raise TypeError(f"expected DefaultModelLoader, got {type(model_loader)!r}")
|
||||
|
||||
source = DefaultModelLoader.Source(
|
||||
model_path,
|
||||
revision=None,
|
||||
prefix="",
|
||||
fall_back_to_pt=getattr(model, "fall_back_to_pt_during_load", True),
|
||||
allow_patterns_overrides=getattr(model, "allow_patterns_overrides", None),
|
||||
)
|
||||
source_iterator = model_loader._get_weights_iterator(source)
|
||||
stats: dict[str, Any] = {
|
||||
"mutated_tensors": 0,
|
||||
"mutated_numel": 0,
|
||||
"mutated_names": [],
|
||||
}
|
||||
|
||||
def transformed_weights() -> Iterable[tuple[str, torch.Tensor]]:
|
||||
for name, tensor in source_iterator:
|
||||
if mutation_layer is not None and _is_expert_weight(name, mutation_layer):
|
||||
stats["mutated_tensors"] += 1
|
||||
stats["mutated_numel"] += tensor.numel()
|
||||
if len(stats["mutated_names"]) < 12:
|
||||
stats["mutated_names"].append(name)
|
||||
# Negation changes every non-zero packed FP4 value without
|
||||
# creating the degenerate all-zero activation path. That
|
||||
# keeps this test focused on reload/restore correctness.
|
||||
yield name, tensor.neg()
|
||||
else:
|
||||
yield name, tensor
|
||||
|
||||
started = time.perf_counter()
|
||||
load_weights_checkpoint_layerwise(
|
||||
model,
|
||||
transformed_weights(),
|
||||
worker.model_runner.model_config,
|
||||
worker.vllm_config,
|
||||
)
|
||||
torch.cuda.synchronize()
|
||||
stats["elapsed_seconds"] = time.perf_counter() - started
|
||||
|
||||
if mutation_layer is not None:
|
||||
num_experts = int(worker.model_runner.model_config.hf_text_config.num_experts)
|
||||
expected_tensors = num_experts * len(EXPERT_WEIGHT_SUFFIXES)
|
||||
if stats["mutated_tensors"] != expected_tensors:
|
||||
raise RuntimeError(f"mutated {stats['mutated_tensors']} expert tensors, expected {expected_tensors}")
|
||||
|
||||
return stats
|
||||
|
||||
|
||||
def _sample_tensor(tensor: Any, sample_size: int = 8192) -> dict[str, Any]:
|
||||
import torch
|
||||
|
||||
value = tensor.detach()
|
||||
if not value.is_contiguous():
|
||||
value = value.contiguous()
|
||||
raw = value.view(torch.uint8).reshape(-1)
|
||||
count = min(sample_size, raw.numel())
|
||||
if count:
|
||||
indices = torch.linspace(
|
||||
0,
|
||||
raw.numel() - 1,
|
||||
steps=count,
|
||||
device=raw.device,
|
||||
dtype=torch.float64,
|
||||
).to(torch.long)
|
||||
sample = raw[indices].to(device="cpu", dtype=torch.uint8)
|
||||
payload = bytes(sample.tolist())
|
||||
else:
|
||||
payload = b""
|
||||
|
||||
return {
|
||||
"shape": list(tensor.shape),
|
||||
"dtype": str(tensor.dtype),
|
||||
"device": str(tensor.device),
|
||||
"nbytes": tensor.numel() * tensor.element_size(),
|
||||
"data_ptr": tensor.data_ptr(),
|
||||
"sample_bytes": len(payload),
|
||||
"sample_nonzero": sum(byte != 0 for byte in payload),
|
||||
"sample_sha256": hashlib.sha256(payload).hexdigest(),
|
||||
"sample_prefix": list(payload[:16]),
|
||||
}
|
||||
|
||||
|
||||
def _probe_model(model: Any, *, layer_index: int) -> dict[str, Any]:
|
||||
import torch
|
||||
|
||||
model = getattr(model, "runnable", model)
|
||||
marker = f"model.layers.{layer_index}.mlp.experts"
|
||||
tensors: dict[str, Any] = {}
|
||||
for name, tensor in model.named_parameters():
|
||||
leaf = name.rsplit(".", 1)[-1]
|
||||
if marker in name and (
|
||||
leaf.startswith(("w13_", "w2_")) or leaf in KERNEL_DERIVED_NAMES
|
||||
):
|
||||
tensors[name] = tensor
|
||||
for name, tensor in model.named_buffers():
|
||||
leaf = name.rsplit(".", 1)[-1]
|
||||
if marker in name and (
|
||||
leaf.startswith(("w13_", "w2_")) or leaf in KERNEL_DERIVED_NAMES
|
||||
):
|
||||
tensors.setdefault(name, tensor)
|
||||
|
||||
if not tensors:
|
||||
nearby = [name for name, _ in model.named_parameters() if marker in name]
|
||||
raise RuntimeError(f"found no NVFP4 kernel tensors under {marker}; nearby={nearby[:20]}")
|
||||
|
||||
quant_methods: dict[str, str] = {}
|
||||
kernel_references: dict[str, Any] = {}
|
||||
for name, module in model.named_modules():
|
||||
if marker not in name:
|
||||
continue
|
||||
method = getattr(module, "_quant_method", None)
|
||||
if method is None:
|
||||
method = getattr(module, "quant_method", None)
|
||||
if method is not None:
|
||||
quant_methods[name] = f"{type(method).__module__}.{type(method).__name__}"
|
||||
quant_config = getattr(method, "moe_quant_config", None)
|
||||
for attr in (
|
||||
"g1_alphas",
|
||||
"g2_alphas",
|
||||
"a1_gscale",
|
||||
"a2_gscale",
|
||||
"w1_scale",
|
||||
"w2_scale",
|
||||
):
|
||||
value = getattr(quant_config, attr, None)
|
||||
if isinstance(value, torch.Tensor):
|
||||
kernel_references[f"{name}.moe_quant_config.{attr}"] = _sample_tensor(value)
|
||||
|
||||
moe_kernel = getattr(method, "moe_kernel", None)
|
||||
fused_experts = getattr(moe_kernel, "fused_experts", None)
|
||||
for attr in KERNEL_DERIVED_NAMES:
|
||||
value = getattr(fused_experts, attr, None)
|
||||
if isinstance(value, torch.Tensor):
|
||||
kernel_references[f"{name}.moe_kernel.fused_experts.{attr}"] = _sample_tensor(value)
|
||||
|
||||
if not any(value.endswith(".Nvfp4OnlineMoEMethod") for value in quant_methods.values()):
|
||||
raise RuntimeError(f"layer {layer_index} is not using Nvfp4OnlineMoEMethod: {quant_methods}")
|
||||
|
||||
return {
|
||||
"quant_methods": quant_methods,
|
||||
"tensors": {name: _sample_tensor(tensor) for name, tensor in sorted(tensors.items())},
|
||||
"kernel_references": dict(sorted(kernel_references.items())),
|
||||
"cuda_memory": {
|
||||
"allocated": torch.cuda.memory_allocated(),
|
||||
"reserved": torch.cuda.memory_reserved(),
|
||||
"max_allocated": torch.cuda.max_memory_allocated(),
|
||||
"max_reserved": torch.cuda.max_memory_reserved(),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def _generation_signature(llm: Any, prompt: str) -> dict[str, Any]:
|
||||
from vllm import SamplingParams
|
||||
|
||||
params = SamplingParams(
|
||||
temperature=0.0,
|
||||
max_tokens=4,
|
||||
logprobs=5,
|
||||
seed=0,
|
||||
)
|
||||
request = llm.generate([prompt], params, use_tqdm=False)[0]
|
||||
sequence = request.outputs[0]
|
||||
chosen_logprobs: list[float | None] = []
|
||||
for token_id, candidates in zip(sequence.token_ids, sequence.logprobs or []):
|
||||
candidate = candidates.get(token_id)
|
||||
chosen_logprobs.append(None if candidate is None else float(candidate.logprob))
|
||||
return {
|
||||
"token_ids": list(sequence.token_ids),
|
||||
"text": sequence.text,
|
||||
"cumulative_logprob": (None if sequence.cumulative_logprob is None else float(sequence.cumulative_logprob)),
|
||||
"chosen_logprobs": chosen_logprobs,
|
||||
}
|
||||
|
||||
|
||||
def _kernel_leaf(name: str) -> str:
|
||||
return name.rsplit(".", 1)[-1]
|
||||
|
||||
|
||||
def _compare_phases(
|
||||
baseline: dict[str, Any],
|
||||
mutated: dict[str, Any],
|
||||
restored: dict[str, Any],
|
||||
baseline_generation: dict[str, Any],
|
||||
mutated_generation: dict[str, Any],
|
||||
restored_generation: dict[str, Any],
|
||||
) -> dict[str, Any]:
|
||||
baseline_tensors = baseline["tensors"]
|
||||
mutated_tensors = mutated["tensors"]
|
||||
restored_tensors = restored["tensors"]
|
||||
if baseline_tensors.keys() != mutated_tensors.keys() or baseline_tensors.keys() != restored_tensors.keys():
|
||||
raise RuntimeError("kernel tensor names changed across reload phases")
|
||||
|
||||
pointer_mismatches = [
|
||||
name
|
||||
for name in baseline_tensors
|
||||
if not (
|
||||
baseline_tensors[name]["data_ptr"]
|
||||
== mutated_tensors[name]["data_ptr"]
|
||||
== restored_tensors[name]["data_ptr"]
|
||||
)
|
||||
]
|
||||
restore_hash_mismatches = [
|
||||
name
|
||||
for name in baseline_tensors
|
||||
if baseline_tensors[name]["sample_sha256"] != restored_tensors[name]["sample_sha256"]
|
||||
]
|
||||
changed_kernel_weights = [
|
||||
name
|
||||
for name in baseline_tensors
|
||||
if _kernel_leaf(name) in KERNEL_WEIGHT_NAMES
|
||||
and baseline_tensors[name]["sample_sha256"] != mutated_tensors[name]["sample_sha256"]
|
||||
]
|
||||
kernel_weights = [name for name in baseline_tensors if _kernel_leaf(name) in KERNEL_WEIGHT_NAMES]
|
||||
|
||||
baseline_logprob = baseline_generation["cumulative_logprob"]
|
||||
mutated_logprob = mutated_generation["cumulative_logprob"]
|
||||
restored_logprob = restored_generation["cumulative_logprob"]
|
||||
mutation_changed_output = baseline_generation["token_ids"] != mutated_generation["token_ids"] or (
|
||||
baseline_logprob is not None
|
||||
and mutated_logprob is not None
|
||||
and not math.isclose(baseline_logprob, mutated_logprob, abs_tol=1e-5)
|
||||
)
|
||||
restored_output_matches = baseline_generation["token_ids"] == restored_generation["token_ids"]
|
||||
if baseline_logprob is not None and restored_logprob is not None:
|
||||
restored_output_matches = restored_output_matches and math.isclose(
|
||||
baseline_logprob,
|
||||
restored_logprob,
|
||||
abs_tol=1e-5,
|
||||
)
|
||||
|
||||
checks = {
|
||||
"kernel_tensor_names_stable": True,
|
||||
"kernel_storage_pointers_preserved": not pointer_mismatches,
|
||||
"mutated_kernel_weights_changed": bool(kernel_weights) and len(changed_kernel_weights) == len(kernel_weights),
|
||||
"restored_kernel_fingerprints_match": not restore_hash_mismatches,
|
||||
"mutation_changed_generation": mutation_changed_output,
|
||||
"restored_generation_matches": restored_output_matches,
|
||||
}
|
||||
return {
|
||||
"passed": all(checks.values()),
|
||||
"checks": checks,
|
||||
"pointer_mismatches": pointer_mismatches,
|
||||
"restore_hash_mismatches": restore_hash_mismatches,
|
||||
"changed_kernel_weights": changed_kernel_weights,
|
||||
}
|
||||
|
||||
|
||||
def run_experiment(args: argparse.Namespace) -> dict[str, Any]:
|
||||
from vllm import LLM
|
||||
|
||||
probe = environment_probe()
|
||||
started = time.perf_counter()
|
||||
llm = LLM(
|
||||
model=args.model,
|
||||
quantization="nvfp4_per_token",
|
||||
dtype="bfloat16",
|
||||
tensor_parallel_size=1,
|
||||
enforce_eager=args.enforce_eager,
|
||||
enable_prefix_caching=False,
|
||||
max_model_len=args.max_model_len,
|
||||
max_num_seqs=1,
|
||||
gpu_memory_utilization=args.gpu_memory_utilization,
|
||||
trust_remote_code=False,
|
||||
disable_log_stats=True,
|
||||
)
|
||||
load_seconds = time.perf_counter() - started
|
||||
_mark_persistent_cache_ready()
|
||||
|
||||
try:
|
||||
baseline = llm.apply_model(partial(_probe_model, layer_index=args.layer))[0]
|
||||
baseline_generation = _generation_signature(llm, args.prompt)
|
||||
|
||||
mutated_reload = llm.collective_rpc(
|
||||
_reload_checkpoint,
|
||||
timeout=args.reload_timeout,
|
||||
kwargs={"model_path": args.model, "mutation_layer": args.layer},
|
||||
)[0]
|
||||
mutated = llm.apply_model(partial(_probe_model, layer_index=args.layer))[0]
|
||||
mutated_generation = _generation_signature(llm, args.prompt)
|
||||
|
||||
restored_reload = llm.collective_rpc(
|
||||
_reload_checkpoint,
|
||||
timeout=args.reload_timeout,
|
||||
kwargs={"model_path": args.model, "mutation_layer": None},
|
||||
)[0]
|
||||
restored = llm.apply_model(partial(_probe_model, layer_index=args.layer))[0]
|
||||
restored_generation = _generation_signature(llm, args.prompt)
|
||||
|
||||
comparison = _compare_phases(
|
||||
baseline,
|
||||
mutated,
|
||||
restored,
|
||||
baseline_generation,
|
||||
mutated_generation,
|
||||
restored_generation,
|
||||
)
|
||||
return {
|
||||
"status": "passed" if comparison["passed"] else "failed",
|
||||
"environment": probe,
|
||||
"configuration": {
|
||||
"model": args.model,
|
||||
"layer": args.layer,
|
||||
"quantization": "nvfp4_per_token",
|
||||
"enforce_eager": args.enforce_eager,
|
||||
"max_model_len": args.max_model_len,
|
||||
"gpu_memory_utilization": args.gpu_memory_utilization,
|
||||
},
|
||||
"initial_load_seconds": load_seconds,
|
||||
"reloads": {
|
||||
"mutated": mutated_reload,
|
||||
"restored": restored_reload,
|
||||
},
|
||||
"generations": {
|
||||
"baseline": baseline_generation,
|
||||
"mutated": mutated_generation,
|
||||
"restored": restored_generation,
|
||||
},
|
||||
"kernel_probes": {
|
||||
"baseline": baseline,
|
||||
"mutated": mutated,
|
||||
"restored": restored,
|
||||
},
|
||||
"comparison": comparison,
|
||||
}
|
||||
finally:
|
||||
shutdown = getattr(llm, "shutdown", None)
|
||||
if callable(shutdown):
|
||||
shutdown()
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--model", default=DEFAULT_MODEL)
|
||||
parser.add_argument("--layer", type=int, default=0)
|
||||
parser.add_argument("--prompt", default="The capital of France is")
|
||||
parser.add_argument("--max-model-len", type=int, default=256)
|
||||
parser.add_argument("--gpu-memory-utilization", type=float, default=0.5)
|
||||
parser.add_argument("--reload-timeout", type=float, default=1800)
|
||||
parser.add_argument("--enforce-eager", action=argparse.BooleanOptionalAction, default=True)
|
||||
parser.add_argument("--environment-only", action="store_true")
|
||||
parser.add_argument("--output", type=Path)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main() -> None:
|
||||
os.environ.setdefault("VLLM_ALLOW_INSECURE_SERIALIZATION", "1")
|
||||
args = parse_args()
|
||||
if args.environment_only:
|
||||
result: dict[str, Any] = {"status": "passed", "environment": environment_probe()}
|
||||
else:
|
||||
result = run_experiment(args)
|
||||
|
||||
rendered = json.dumps(result, indent=2, sort_keys=True)
|
||||
print(rendered, flush=True)
|
||||
if args.output is not None:
|
||||
args.output.parent.mkdir(parents=True, exist_ok=True)
|
||||
args.output.write_text(rendered + "\n")
|
||||
if result["status"] != "passed":
|
||||
raise RuntimeError("NVFP4 layerwise reload verification failed")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,266 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Run a single benchmark configuration and output JSON results.
|
||||
|
||||
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 subprocess
|
||||
import sys
|
||||
import time
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
from typing import Annotated, Literal
|
||||
|
||||
import torch
|
||||
from pydantic import Field
|
||||
|
||||
from prime_rl.utils.config import BaseConfig, cli
|
||||
|
||||
MAX_LORAS = 4
|
||||
|
||||
|
||||
def get_commit_sha() -> str:
|
||||
"""Get current git commit SHA."""
|
||||
try:
|
||||
result = subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True, check=True)
|
||||
return result.stdout.strip()[:8]
|
||||
except Exception:
|
||||
return "unknown"
|
||||
|
||||
|
||||
def extract_oom_error_reason(output: str) -> str | None:
|
||||
"""
|
||||
Extract a human-readable error reason from process output.
|
||||
|
||||
Currently we only special-case CUDA OOM to make failures easier to triage in CI.
|
||||
"""
|
||||
needle = "torch.OutOfMemoryError: CUDA out of memory."
|
||||
for line in output.splitlines():
|
||||
if needle in line:
|
||||
return line.strip()
|
||||
return None
|
||||
|
||||
|
||||
class BenchmarkConfig(BaseConfig):
|
||||
"""Configuration for running a single benchmark."""
|
||||
|
||||
type: Annotated[
|
||||
Literal["sft", "rl"],
|
||||
Field(description="Training type"),
|
||||
] = "rl"
|
||||
|
||||
num_gpus: Annotated[int, Field(ge=1, description="Number of GPUs")] = 2
|
||||
|
||||
model_name: Annotated[str, Field(description="Model name (e.g., Qwen/Qwen3-0.6B)")] = "Qwen/Qwen3-0.6B"
|
||||
|
||||
lora_rank: Annotated[int | None, Field(description="LoRA rank (None for full fine-tuning)")] = None
|
||||
|
||||
seq_len: Annotated[int, Field(ge=1, description="Sequence length")] = 512
|
||||
|
||||
ac: Annotated[
|
||||
Literal["Recompute", "Selective", "Offload"] | None,
|
||||
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"),
|
||||
] = "flash_attention_2"
|
||||
|
||||
output: Annotated[Path, Field(description="Output JSON file path")] = Path("benchmark_result.json")
|
||||
|
||||
dry_run: Annotated[bool, Field(description="Print command without executing")] = False
|
||||
|
||||
timeout: Annotated[int, Field(description="Timeout in seconds")] = 3600
|
||||
|
||||
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
|
||||
|
||||
cp: Annotated[int, Field(ge=1, description="Context parallelism size (1 = no CP)")] = 1
|
||||
|
||||
fused_lm_head_token_chunk_size: Annotated[
|
||||
int | None,
|
||||
Field(description="Fused LM head token chunk size (None uses trainer default)"),
|
||||
] = None
|
||||
|
||||
docker_image: Annotated[str | None, Field(description="Docker image used for the benchmark")] = None
|
||||
|
||||
# Metadata set by the script
|
||||
device_name: Annotated[str, Field(description="Device name. This is set automatically by the script.")] = (
|
||||
torch.cuda.get_device_name()
|
||||
)
|
||||
commit_sha: Annotated[str, Field(description="Commit SHA. This is set automatically by the script.")] = (
|
||||
get_commit_sha()
|
||||
)
|
||||
timestamp: Annotated[str, Field(description="Timestamp. This is set automatically by the script.")] = datetime.now(
|
||||
timezone.utc
|
||||
).isoformat()
|
||||
success: Annotated[bool, Field(description="Success. This is set automatically by the script.")] = True
|
||||
error_reason: Annotated[str | None, Field(description="Error reason. This is set automatically by the script.")] = (
|
||||
None
|
||||
)
|
||||
time_taken: Annotated[
|
||||
float | None, Field(description="Time taken in seconds. This is set automatically by the script.")
|
||||
] = None
|
||||
|
||||
|
||||
def build_command(config: BenchmarkConfig) -> list[str]:
|
||||
"""Build the benchmark command from config."""
|
||||
# Determine training script
|
||||
if config.type == "rl":
|
||||
script = "src/prime_rl/trainer/rl/train.py"
|
||||
elif config.type == "sft":
|
||||
script = "src/prime_rl/trainer/sft/train.py"
|
||||
else:
|
||||
raise ValueError(f"Invalid training type: {config.type}")
|
||||
|
||||
cmd = [
|
||||
"uv",
|
||||
"run",
|
||||
"torchrun",
|
||||
f"--nproc-per-node={config.num_gpus}",
|
||||
script,
|
||||
"--model.name",
|
||||
config.model_name,
|
||||
"--model.seq-len",
|
||||
str(config.seq_len),
|
||||
"--model.attn",
|
||||
config.attention,
|
||||
"--bench.output-json",
|
||||
str(config.output),
|
||||
"--model.compile",
|
||||
"--dist-timeout-seconds",
|
||||
str(config.timeout),
|
||||
]
|
||||
|
||||
# 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")
|
||||
|
||||
# Add LoRA configuration if applicable
|
||||
if config.lora_rank is not None:
|
||||
cmd.extend(["--model.lora.rank", str(config.lora_rank)])
|
||||
cmd.extend(["--max-concurrent-runs", str(MAX_LORAS)])
|
||||
|
||||
# Add expert parallelism if enabled
|
||||
if config.ep > 1:
|
||||
cmd.extend(["--model.ep", str(config.ep)])
|
||||
|
||||
# Add context parallelism if enabled
|
||||
if config.cp > 1:
|
||||
cmd.extend(["--model.cp", str(config.cp)])
|
||||
|
||||
# Fused LM head chunk size
|
||||
if config.fused_lm_head_token_chunk_size is not None:
|
||||
cmd.extend(["--model.fused-lm-head-token-chunk-size", str(config.fused_lm_head_token_chunk_size)])
|
||||
|
||||
# Data configuration differs between RL and SFT
|
||||
if config.type.startswith("rl"):
|
||||
cmd.extend(["--data.fake.batch-size", str(config.micro_batches * config.num_gpus)])
|
||||
else:
|
||||
cmd.extend(
|
||||
[
|
||||
"--data.type",
|
||||
"fake",
|
||||
"--data.batch-size",
|
||||
str(config.micro_batches * config.num_gpus),
|
||||
"--data.seq-len",
|
||||
str(config.seq_len),
|
||||
]
|
||||
)
|
||||
|
||||
return cmd
|
||||
|
||||
|
||||
def dummy_metrics() -> dict:
|
||||
return {
|
||||
"mfu": {"mean": 0, "std": 0, "min": 0, "max": 0},
|
||||
"throughput": {"mean": 0, "std": 0, "min": 0, "max": 0},
|
||||
"step_time": {"mean": 0, "std": 0, "min": 0, "max": 0},
|
||||
"peak_memory": {"gib": 0, "pct": 0},
|
||||
}
|
||||
|
||||
|
||||
def run_benchmark(config: BenchmarkConfig) -> None:
|
||||
"""Run a single benchmark and write results to output path."""
|
||||
cmd = build_command(config)
|
||||
print(f"Running: {' '.join(cmd)}")
|
||||
|
||||
if config.dry_run:
|
||||
return
|
||||
|
||||
start_time = time.perf_counter()
|
||||
try:
|
||||
config.output.parent.mkdir(parents=True, exist_ok=True)
|
||||
result = subprocess.run(
|
||||
cmd,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=config.timeout,
|
||||
)
|
||||
output = result.stdout + result.stderr
|
||||
|
||||
if result.returncode != 0:
|
||||
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 config.output.exists():
|
||||
config.success = False
|
||||
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 JSON output was written")
|
||||
else:
|
||||
with open(config.output) as f:
|
||||
metrics = json.load(f)
|
||||
lines = output.splitlines()
|
||||
print("\n".join(lines))
|
||||
except subprocess.TimeoutExpired:
|
||||
config.success = False
|
||||
config.error_reason = "Timeout"
|
||||
print(f"Benchmark timed out after {config.timeout} seconds")
|
||||
except Exception as e:
|
||||
config.success = False
|
||||
config.error_reason = str(e)
|
||||
print(f"Error: {e}")
|
||||
finally:
|
||||
config.time_taken = time.perf_counter() - start_time
|
||||
|
||||
if not config.success:
|
||||
metrics = dummy_metrics()
|
||||
|
||||
# Write final result with config and metadata
|
||||
final_result = {
|
||||
"config": config.model_dump(mode="json"),
|
||||
"metrics": metrics,
|
||||
}
|
||||
|
||||
with open(config.output, "w") as f:
|
||||
json.dump(final_result, f, indent=2)
|
||||
|
||||
print(f"Results written to {config.output}", file=sys.stderr)
|
||||
|
||||
|
||||
def main():
|
||||
config = cli(BenchmarkConfig)
|
||||
run_benchmark(config)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
+8
-11
@@ -2,19 +2,16 @@
|
||||
|
||||
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, SWE RL with
|
||||
MXFP8 inference, and a standalone vLLM serving pre-flight). For the tutorialized equivalents, see
|
||||
[`examples/advanced/`](../examples/advanced).
|
||||
- **[`basic/`](basic)** — small, 2-GPU (1 trainer + 1 inference) configs for the core
|
||||
environments, sized to run on a single dev machine. Each mirrors the matching
|
||||
[`examples/basic/`](../examples/basic) tutorial and is smoke-tested for one step.
|
||||
Envs: `reverse-text`, `alphabet-sort`, `wiki-search`, `wordle`, `hendrycks-sanity`.
|
||||
- **`ci/`** — integration and nightly configs used by CI.
|
||||
- **`debug/`** — throwaway configs for developing the framework itself: `algo/`
|
||||
(per-algorithm smokes), `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.
|
||||
(per-algorithm smokes) and `fake/` (fake-data trainer/SFT smokes). 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
|
||||
uv run rl @ configs/basic/<env>/rl.toml
|
||||
uv run sft @ configs/basic/<env>/sft.toml # where present
|
||||
```
|
||||
|
||||
@@ -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,48 +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.
|
||||
#
|
||||
# To buy memory back for quicker testing on fewer nodes, set `offload = "full"` under `[model]`,
|
||||
# which keeps the fp32 masters, moments and gradients in CPU RAM and disables gradient clipping;
|
||||
# the lighter `offload = "optimizer"` 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.
|
||||
|
||||
max_steps = 20
|
||||
|
||||
[model]
|
||||
name = "deepseek-ai/DeepSeek-V4-Flash-0731"
|
||||
ep = 8
|
||||
|
||||
[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,168 +0,0 @@
|
||||
# DeepSeek-V4-Flash RL on the `scaleswe` SWE taskset at 131k context, with online MXFP8 vLLM
|
||||
# inference and a trainer quantized the same way, on 4 trainer nodes and 4 one-node inference
|
||||
# replicas.
|
||||
#
|
||||
# The checkpoint's dense weights sit exactly on the e4m3 grid (DeepSeek ships them as FP8), so an
|
||||
# lr-1e-6 update mostly rounds back to the base value when vLLM re-quantizes. A bf16 trainer then
|
||||
# drifts away from inference step by step; quantizing the trainer's forward identically keeps
|
||||
# both on the same weights.
|
||||
#
|
||||
# Experiment config, as used for the DeepSeek-V4 MXFP8 SWE run. It should be run on B300 GPUs.
|
||||
#
|
||||
# uv run rl @ configs/advanced/deepseek-v4-flash/swe_mxfp8.toml
|
||||
|
||||
max_steps = 2000
|
||||
seq_len = 131072
|
||||
|
||||
# Only the latest checkpoint stays on disk; the full trainer state is several TB.
|
||||
[ckpt]
|
||||
interval = 100
|
||||
keep_last = 1
|
||||
|
||||
# FlashInfer autotuning takes ~20 min of each replica's startup. Its results are keyed by the vLLM
|
||||
# config hash and only rank 0 reads them, so a cache on shared storage is safe across nodes. It sits
|
||||
# at the top level because only these vars are exported by the sbatch, where $HOME expands.
|
||||
[env_vars]
|
||||
VLLM_FLASHINFER_AUTOTUNE_CACHE_DIR = "$HOME/.cache/vllm-flashinfer-autotune"
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/DeepSeek-V4-Flash-0731-bf16"
|
||||
|
||||
[monitors.wandb]
|
||||
project = "deepseek-v4-flash"
|
||||
group = "dsv4-mxfp8-swe"
|
||||
|
||||
# Router replay rules out disaggregated prefill/decode, so inference is independent one-node replicas.
|
||||
[deployment]
|
||||
type = "multi_node"
|
||||
num_train_nodes = 4
|
||||
num_infer_nodes = 1
|
||||
num_infer_replicas = 4
|
||||
|
||||
[slurm]
|
||||
job_name = "dsv4-swe-mxfp8"
|
||||
partition = "all"
|
||||
|
||||
[weight_broadcast]
|
||||
type = "nccl"
|
||||
port = 29501
|
||||
timeout = 3600
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
# Episodes run long enough to span many trainer steps.
|
||||
max_staleness = 64
|
||||
|
||||
[orchestrator.model.client]
|
||||
# Loading and quantizing the 1.1 TB bf16 checkpoint over NFS takes well over the default 30 min.
|
||||
wait_for_ready_timeout = 7200
|
||||
|
||||
# No ceiling: the orchestrator sizes concurrency from KV-cache pressure. SWE episodes spend most of
|
||||
# their time in sandbox tool calls, so a fixed per-replica cap leaves the replicas mostly idle.
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = "None"
|
||||
# Start where the 256-cap run settled instead of ramping up from ~47 over ~45 min.
|
||||
initial_inflight = 256
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[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 = "deepseek-v4"
|
||||
enable_thinking = true
|
||||
reasoning_effort = "low"
|
||||
# With tools present the encoder keeps all reasoning anyway; these make the settings agree.
|
||||
drop_thinking = false
|
||||
thinking_retention = "all"
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "scaleswe"
|
||||
env.taskset.id = "scaleswe"
|
||||
env.agent.harness.id = "bash"
|
||||
env.agent.harness.compaction.summarize_at_tokens = 98304
|
||||
env.agent.runtime.labels = ["dsv4-swe-mxfp8"]
|
||||
|
||||
[orchestrator.eval]
|
||||
interval = 50
|
||||
skip_first_step = true
|
||||
|
||||
[[orchestrator.eval.source]]
|
||||
name = "swebench-verified"
|
||||
env.taskset.id = "swebench-verified"
|
||||
env.agent.harness.id = "bash"
|
||||
env.agent.harness.compaction.summarize_at_tokens = 98304
|
||||
env.agent.runtime.labels = ["dsv4-swe-mxfp8"]
|
||||
env.agent.timeout.rollout = 3600
|
||||
|
||||
[trainer]
|
||||
enable_router_replay = true
|
||||
dist_timeout_seconds = 14400
|
||||
|
||||
[trainer.model]
|
||||
freeze_moe_router = false
|
||||
ep = 8
|
||||
# DeepSeek V4 only supports ring CP. 131k / 8 = 16k tokens per rank.
|
||||
cp = 8
|
||||
|
||||
[trainer.model.compile]
|
||||
|
||||
[trainer.model.moe.dispatch]
|
||||
type = "torch"
|
||||
|
||||
[trainer.model.moe.compute]
|
||||
type = "mxfp8"
|
||||
|
||||
# Every linear vLLM runs in MXFP8 (wq_a, wkv, wq_b, wo_b, shared experts) runs in MXFP8 here too;
|
||||
# what vLLM keeps bf16 (wo_a, compressors, router, lm_head) stays bf16. Both quantize 1x32 with
|
||||
# power-of-two scales rounded up, so weights match bit for bit. The indexer stays bf16 on both
|
||||
# sides: its top-k key selection is discrete, so FP8 rounding differences flip selected keys once
|
||||
# sequences are long, and at 131k nearly every token is in that regime.
|
||||
[trainer.model.quantization]
|
||||
type = "mxfp8"
|
||||
recipe = "mxfp8_rceil_wgrad_with_hp"
|
||||
extra_ignore_patterns = ["o_a_proj", 'compressor\.', 'indexer\.']
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.ac_offloading]
|
||||
max_inflight_activations = 5
|
||||
|
||||
[trainer.optim]
|
||||
type = "adamw"
|
||||
lr = 1e-6
|
||||
weight_decay = 0.01
|
||||
|
||||
# Pinned off: vLLM derives it from `scale_fmt`, and this checkpoint has no `quantization_config`.
|
||||
[inference.env_vars]
|
||||
VLLM_USE_DEEP_GEMM_E8M0 = "0"
|
||||
|
||||
[inference.vllm]
|
||||
dtype = "bfloat16"
|
||||
quantization = "mxfp8"
|
||||
tensor_parallel_size = 8
|
||||
enable_expert_parallel = true
|
||||
# Headroom for the NCCL weight-receive staging buffer, which OOMed at 0.85.
|
||||
gpu_memory_utilization = 0.75
|
||||
max_model_len = 131072
|
||||
# Required: DeepSeek V4 sets `use_fp8_ds_mla_layout`, and sparse MLA asserts against `auto`.
|
||||
kv_cache_dtype = "fp8"
|
||||
block_size = 256
|
||||
# Eval goes through chat completions, which needs both parsers. Their auto-resolution only matches
|
||||
# `deepseek-ai/DeepSeek-V4`, not this re-export.
|
||||
tool_call_parser = "deepseek_v4"
|
||||
reasoning_parser = "deepseek_v4"
|
||||
|
||||
[inference.vllm.quantization_config]
|
||||
# wo_a: vLLM's deep_gemm_fp8_o_proj treats an MXFP8 `wo_a` as blockwise FP8 and fails a DeepGEMM
|
||||
# assert. indexer: kept bf16 to match the trainer.
|
||||
ignore = ["*.wo_a", "*.indexer.*"]
|
||||
@@ -1,102 +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"
|
||||
# Sync the env (the gpu extra brings Nemotron-H's mamba-ssm kernels), then clear this run's orphaned sandboxes.
|
||||
pre_run_command = 'uv sync --all-extras --all-packages ; 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"
|
||||
|
||||
[ckpt]
|
||||
interval = 50
|
||||
keep_last = 1
|
||||
|
||||
[resume]
|
||||
|
||||
[model]
|
||||
name = "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16"
|
||||
|
||||
[trainer]
|
||||
enable_router_replay = true
|
||||
|
||||
[trainer.model]
|
||||
attn = "flash_attention_3"
|
||||
# Hybrid-Mamba model: CP is capped at 8 by n_groups.
|
||||
cp = 8
|
||||
ep = 8
|
||||
|
||||
[trainer.model.ac]
|
||||
|
||||
[trainer.model.ac_offloading]
|
||||
max_inflight_activations = 1
|
||||
|
||||
[trainer.model.compile]
|
||||
|
||||
[trainer.optim]
|
||||
type = "adamw"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
max_staleness = 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
|
||||
@@ -0,0 +1,8 @@
|
||||
# alphabet-sort (2 GPU)
|
||||
|
||||
Multi-turn task driven by a colocated user simulator, LoRA on `Qwen3-4B`. Dev mirror of
|
||||
[`examples/basic/alphabet-sort`](../../../examples/basic/alphabet-sort).
|
||||
|
||||
```bash
|
||||
uv run rl @ configs/basic/alphabet-sort/rl.toml
|
||||
```
|
||||
@@ -0,0 +1,42 @@
|
||||
# Alphabet-sort on 2 GPUs (1 trainer + 1 inference) — a multi-turn task driven by a colocated
|
||||
# user simulator, trained with LoRA on Qwen3-4B. Dev-sized mirror of examples/basic/alphabet-sort.
|
||||
|
||||
max_steps = 200
|
||||
seq_len = 2048
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 1
|
||||
num_infer_gpus = 1
|
||||
|
||||
[model]
|
||||
name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[wandb]
|
||||
project = "alphabet-sort"
|
||||
name = "alphabet-sort"
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 32
|
||||
alpha = 64
|
||||
|
||||
[trainer.optim]
|
||||
lr = 1e-5
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 768
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "alphabet-sort"
|
||||
env.taskset = { id = "alphabet-sort-v1", min_turns = 3, max_turns = 5, task = { power_per_turn = false } }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[ckpt] # Checkpoint at the end of training
|
||||
|
||||
[inference]
|
||||
@@ -0,0 +1,9 @@
|
||||
# hendrycks-sanity (2 GPU)
|
||||
|
||||
Single-turn math sanity run (reward climbs slowly, meant to run long),
|
||||
`DeepSeek-R1-Distill-Qwen-1.5B`. Dev mirror of
|
||||
[`examples/basic/hendrycks-sanity`](../../../examples/basic/hendrycks-sanity).
|
||||
|
||||
```bash
|
||||
uv run rl @ configs/basic/hendrycks-sanity/rl.toml
|
||||
```
|
||||
@@ -0,0 +1,36 @@
|
||||
# Hendrycks-math sanity on 2 GPUs (1 trainer + 1 inference) — a single-turn math env meant to
|
||||
# run long (reward climbs slowly). Dev-sized mirror of examples/basic/hendrycks-sanity.
|
||||
|
||||
max_steps = 5000
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 1
|
||||
num_infer_gpus = 1
|
||||
|
||||
[model]
|
||||
name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
|
||||
[wandb]
|
||||
project = "hendrycks-sanity"
|
||||
name = "hendrycks-sanity"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 8
|
||||
seq_len = 8192
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "hendrycks-math"
|
||||
env.taskset = { id = "math-env-v1", dataset_name = "mikasenghaas/Sanity-Test-R1D-1.5B", dataset_subset = "default" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.model]
|
||||
seq_len = 16384
|
||||
|
||||
[inference.model]
|
||||
max_model_len = 8192
|
||||
|
||||
# Model not in MODEL_RENDERER_MAP — opt into DefaultRenderer (apply_chat_template).
|
||||
[orchestrator.renderer]
|
||||
name = "default"
|
||||
reasoning_parser = "think"
|
||||
@@ -0,0 +1,9 @@
|
||||
# reverse-text (2 GPU)
|
||||
|
||||
Smallest end-to-end RL loop — single-turn, `Qwen3-0.6B`. Dev mirror of
|
||||
[`examples/basic/reverse-text`](../../../examples/basic/reverse-text).
|
||||
|
||||
```bash
|
||||
uv run sft @ configs/basic/reverse-text/sft.toml # optional warmup
|
||||
uv run rl @ configs/basic/reverse-text/rl.toml
|
||||
```
|
||||
@@ -0,0 +1,40 @@
|
||||
# Reverse-text on 2 GPUs (1 trainer + 1 inference) — the smallest end-to-end RL loop
|
||||
# (single-turn, 0.6B). Dev-sized mirror of examples/basic/reverse-text.
|
||||
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
|
||||
[deployment]
|
||||
num_train_gpus = 1
|
||||
num_infer_gpus = 1
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[wandb]
|
||||
project = "reverse-text"
|
||||
name = "reverse-text"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
[[orchestrator.train.env]]
|
||||
name = "reverse-text"
|
||||
env.taskset = { id = "reverse-text-v1" }
|
||||
env.agent.harness = { id = "null", runtime = { type = "subprocess" } }
|
||||
|
||||
[trainer.optim]
|
||||
lr = 3e-6
|
||||
|
||||
[ckpt] # Checkpoint at the end of training
|
||||
|
||||
[inference]
|
||||
|
||||
# PrimeIntellect Qwen3 fine-tune - select its renderer explicitly (the -SFT
|
||||
# suffix misses the MODEL_RENDERER_MAP exact match).
|
||||
[orchestrator.renderer]
|
||||
name = "prime-qwen3"
|
||||
@@ -0,0 +1,19 @@
|
||||
# SFT warmup for reverse-text on 2 GPUs. Dev-sized mirror of examples/basic/reverse-text/sft.toml.
|
||||
|
||||
max_steps = 100
|
||||
|
||||
[deployment]
|
||||
num_gpus = 2
|
||||
|
||||
[ckpt] # Checkpoint at the end of training
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B"
|
||||
|
||||
[data]
|
||||
name = "willcb/R1-reverse-wikipedia-paragraphs-v1-1000"
|
||||
seq_len = 4096
|
||||
batch_size = 32
|
||||
|
||||
[optim]
|
||||
lr = 2e-5
|
||||
@@ -0,0 +1,8 @@
|
||||
# wiki-search (2 GPU)
|
||||
|
||||
Multi-turn tool calling (search a wiki corpus via native V1 tools), LoRA on `Qwen3-4B`. Dev mirror
|
||||
of [`examples/basic/wiki-search`](../../../examples/basic/wiki-search).
|
||||
|
||||
```bash
|
||||
uv run rl @ configs/basic/wiki-search/rl.toml
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user