Compare commits

...
Author SHA1 Message Date
38b524925d fix(configs): use FutureWarning so config deprecations are visible (#2429)
Release / Push CUDA image to Docker (push) Canceled after 0s
DeprecationWarning is silenced by default outside __main__, so users
never saw notices for max_tokens / [[orchestrator.env]] / [orchestrator.sampling].
FutureWarning is shown under default filters and is the right category
for "will be removed in a future release" notices.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 22:42:03 -07:00
d62c7539e4 feat: split prime-rl-configs into separate workspace package (#2416)
Release / Push CUDA image to Docker (push) Canceled after 0s
* feat: split prime-rl-configs into separate workspace package

Goal: make `prime_rl.configs.*` pip-installable on its own (~13 deps)
without pulling the full GPU/ML stack (~329 deps).

Layout — uv workspace with two members:
- root `prime-rl` (heavy stack, unchanged location at src/prime_rl/)
- `packages/prime-rl-configs/` (slim wheel, owns prime_rl.configs.*
  and the small slim utils: utils/config.py, utils/logger.py,
  utils/validation.py)

Mechanism — both wheels contribute to a PEP 420 namespace package
`prime_rl/` (no __init__.py at the top level, nor under utils/). Each
wheel ships disjoint files; pip merges them at install time.
- `pip install prime-rl-configs` → schema only
- `pip install prime-rl` → full stack (depends on prime-rl-configs)

Code changes:
- Move src/prime_rl/configs/ → packages/prime-rl-configs/src/prime_rl/configs/
- Move utils/{config,logger,validation}.py → packages/prime-rl-configs/src/prime_rl/utils/
- Move rgetattr/rsetattr from utils/utils.py → utils/config.py (was the
  only heavy import the configs needed; this breaks the dep)
- Replace `Path(prime_rl.__file__).parent / "templates"` (None on a
  namespace package) with `find_package_resource("templates")` which
  iterates `prime_rl.__path__` to locate the heavy wheel's data dir
- Delete src/prime_rl/__init__.py; move its `import _compat` side-effect
  into the actual entrypoint scripts (orchestrator.py, entrypoints/rl.py,
  entrypoints/sft.py — trainer/{rl,sft}/train.py already had it)
- Dockerfile.cuda: also COPY packages/ so the workspace member is
  available during `uv sync`

Verified:
- `uv sync --all-extras` resolves and builds both wheels
- 333 unit tests pass (none touched)
- all 6 entrypoints (rl/sft/trainer/orchestrator/env-server/inference)
  load and print --help
- fresh `pip install ./packages/prime-rl-configs` (no extras) installs
  13 packages, imports all configs, parses examples/.../rl.toml with a
  [slurm] section, and sys.modules contains zero of:
  torch / transformers / vllm / wandb / ring_flash_attn / verifiers /
  prime / datasets / liger_kernel

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci: add slim-configs-install job to cpu_tests

Fresh venv → `uv pip install ./packages/prime-rl-configs` → assert that:
- all 6 config modules import
- sys.modules contains zero of: torch, transformers, vllm, wandb,
  ring_flash_attn, verifiers, prime, datasets, liger_kernel
- find_package_resource("templates") returns None (the heavy wheel's
  data dir isn't shipped on slim)
- a real example config with [slurm] parses; template_path stays None

Guards the slim-import contract against future regressions where
something under prime_rl.configs.* might re-introduce a heavy import.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(ruff): mark prime_rl as first-party for isort

Without this, ruff's import sorter classifies prime_rl.configs.* as
third-party (because those files now live under packages/, not src/),
and groups them apart from prime_rl.utils.* / prime_rl.trainer.* etc.

Telling ruff that prime_rl is a single first-party namespace keeps
all prime_rl.* imports in one block, regardless of which workspace
wheel ships the submodule.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* refactor(configs): drop logger dep, use stdlib warnings

Configs were doing get_logger().warning(...) at validation time, which
forced loguru into the slim wheel and a logger.py copy alongside it.
None of these warnings need a configured logger — they're config-time
deprecation notices and misconfiguration hints. Stdlib `warnings.warn`
covers the use case without any runtime infrastructure.

- Replace 7 `get_logger().warning(...)` call sites in configs/rl.py and
  configs/orchestrator.py with `warnings.warn(...)`. Deprecation messages
  use `DeprecationWarning`; the rest use the default `UserWarning`.
- Move `prime_rl/utils/logger.py` back to the heavy `prime-rl` wheel
  (`src/prime_rl/utils/`).
- Drop `loguru` from `prime-rl-configs` deps; add it to `prime-rl`.
- Slim CI: stop importing `prime_rl.utils.logger` (it's no longer in the
  slim wheel) and add `loguru` to the forbidden-modules list.

Slim install drops from 13 to 12 packages.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix: import _compat in remaining ring_flash_attn entry points

Integration tests like tests/integration/test_sft_lora.py import
prime_rl.trainer.weights, which transitively pulled ring_flash_attn
(via models layer / utils.cp) without prime_rl._compat ever running,
producing the ImportError that failed CI.

Add `import prime_rl._compat` to the two remaining top-level
ring_flash_attn import sites: utils/cp.py and trainer/models/layers/
ring_attn.py. The trainer entrypoints (rl/sft/train.py) already had
this import.

`# ruff: noqa: I001` on both files because ruff's isort, with
known-first-party=prime_rl, sorts the prime_rl._compat first-party
import after the third-party ring_flash_attn import — which defeats
the patch ordering. The shim must run before ring_flash_attn is
imported, so the file order is intentional.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix: pin pydantic-config to git fork in slim package

The PyPI package named `pydantic-config` is a different project that
doesn't expose BaseConfig / cli (those are in samsja's fork). Without
this pin, plain `pip install prime-rl-configs` resolves the wrong
package and configs.* imports crash with:

  ImportError: cannot import name 'BaseConfig' from 'pydantic_config'

uv pip install accidentally worked because it reads the root workspace
pyproject.toml's [tool.uv.sources] when installing from a git
subdirectory, which redirected pydantic-config to the fork. Plain pip
doesn't do that — it only sees the leaf pyproject.toml.

PEP 508 direct reference works for both uv and pip.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci: install slim wheel from /tmp to bypass workspace source discovery

The previous step did `uv pip install ./packages/prime-rl-configs` from
inside the cloned repo. uv silently reads the root pyproject.toml's
[tool.uv.sources] in that case and applies the pydantic-config git
override — masking the issue an external pip-only user would hit.

Build the wheel into /tmp/slim-wheel and install it from /tmp so uv
can't discover the workspace. This catches dep-resolution bugs that
only show up in a real external install.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: explain dist-name vs import-path in slim package README

Distribution name (`prime-rl-configs`) and import path
(`prime_rl.configs.*`) are different — easy to trip on.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 21:59:37 -07:00
Jackmin801andGitHub edf41113fe Revert "chore: bump vllm 0.20.1 + migrate cu128 → cu130 (#2403)" (#2426)
Release / Push CUDA image to Docker (push) Canceled after 0s
This reverts commit bcac552c3f.
2026-05-05 21:12:11 -07:00
bcac552c3f chore: bump vllm 0.20.1 + migrate cu128 → cu130 (#2403)
Release / Push CUDA image to Docker (push) Canceled after 0s
* chore: bump vllm 0.19 → 0.20

vLLM 0.20.0 lands MoE LoRA refactor (#40338) and CPU offloading fix
(#39617) upstream — drop now-redundant prime-rl monkey patches:
monkey_patch_fused_moe_lora_dp and monkey_patch_offloading_connector_
cpu_block_count.

PyPI vllm-0.20.0 is built against CUDA 13 and links libcudart.so.13;
our env is pytorch-cu128 (CUDA 12). Pin vllm to the cu129 wheel from
wheels.vllm.ai (libcudart.so.12) for binary compat. Promote
torchvision/torchaudio to direct deps so [tool.uv.sources] pins them
to pytorch-cu128 (cu13 transitive resolution would break torch ops).

Add vllm = false exemption to the 7-day exclude-newer cooldown since
0.20.0 was published 2026-04-27, inside the window.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat: migrate cu128 → cu130

Now that vllm 0.20.0 is the floor and PyPI ships it for CUDA 13
natively, drop our cu129-wheel detour and move the rest of the
GPU stack to cu130:

- pytorch-cu128{,-test} indices → pytorch-cu130{,-test}
  torch/torchvision/torchaudio/flash_attn_3 follow.
- flash-attn extra: bump to v0.9.4 cu130torch2.11 prebuilt wheel.
- Drop the wheels.vllm.ai cu129 URL pin — PyPI vllm 0.20.0 (cu13)
  is now the default.
- override-dependencies: nvidia-cudnn-cu12 → nvidia-cudnn-cu13.

Lockfile pulls torch 2.11.0+cu130, torchvision/torchaudio 0.26.0/2.11.0
+cu130, flash-attn 2.8.3+cu130torch2.11, vllm 0.20.0, and swaps every
nvidia-*-cu12 transitive for its cu13 counterpart.

Not addressed in this change (draft until ready):
- Host driver upgrade: 575.64.03 → ≥580.65.06 required for CUDA 13.
- samsja prebuilt wheels (deep-ep, deep-gemm, nixl-cu12) still
  point at cu12 builds — runtime-incompatible with cu13. Need
  rebuilds before merging.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(deps): bump vllm 0.20.0 → 0.20.1

Picks up the DeepSeek V4 patch release and a handful of bug fixes
(CUDA-graph max_num_batched_token, num_gpu_blocks_override, cumem
expandable_segments, structured-output kwargs). Strict patch — none
of the kept/dropped monkey-patches are touched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(deps): ship cu13 disagg wheels, switch nixl to PyPI

deep-ep / deep-gemm: rebuilt against CUDA 13.1, stamped with `.cu13`
local version, uploaded alongside the existing cu12 wheels at v0.5.0.

nixl: dropped the URL pin entirely. PyPI `nixl-cu13` 1.0.1 ships UCX
auditwheel'd with mlx5_ib / rdmacm / cuda transports — verified
end-to-end with a 2-node basic_two_peers.py run that picked rc_mlx5
for inter-node RMA. The custom install_nixl_from_source.sh path is
kept (now generates `nixl-cuMAJOR` per torch's CUDA major) for
clusters that need a vendored UCX, but it's no longer the default.

install_ep_kernels.sh:
- Falls back to /usr/local/cuda-${MAJOR} when torch reports 13.0
  but only cuda-13 (-> 13.1) is installed; rejects toolkit/torch
  major mismatches.
- Exports CPATH=$CUDA_HOME/include/cccl for CUDA 13, where CCCL
  headers (e.g. <cuda/std/tuple>) moved into the cccl/ subdir and
  torch's CUDAExtension doesn't add it on its own.
- Post-build --set-runpath /tmp/deepep_build/nvshmem/lib rewrites
  the DT_RUNPATH on deep_ep_cpp.so to match the cu12 convention the
  existing inference/RL templates already hook (they symlink the
  user's NVSHMEM at that path on each compute node).

install_deep_gemm.sh: post-build cu-suffix stamp.

scripts/wheel_add_cu_suffix.py (new): repacks a wheel with
+...cuXX appended to its local version, optionally stripping or
rewriting DT_RUNPATH on every .so. Keeps METADATA / dist-info /
RECORD / filename consistent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(templates): fall back to ep_kernels_workspace nvshmem in disagg launchers

inference.sbatch.j2 and multi_node_rl.sbatch.j2 still set up the
/tmp/deepep_build/nvshmem/lib symlink the deep_ep wheel needs at
runtime, but now also try $PROJECT_DIR/ep_kernels_workspace/nvshmem/lib
(where install_ep_kernels.sh actually places NVSHMEM) if
$OUTPUT_DIR/nvshmem isn't staged.

Also adds the same hook to multi_node_rl.sbatch.j2's disagg block
(was previously only in inference.sbatch.j2, despite multi_node_rl
running deep_ep in-process when disagg is enabled).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* style: drop unused shutil import, apply ruff format

Caught by the Style workflow — `shutil` was speculatively imported
when wheel_add_cu_suffix.py was first sketched but never used, and
ruff's formatter wanted a couple of cosmetic tweaks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(deps): exempt torchvision/torchaudio from exclude-newer cooldown

Both are sourced from the `pytorch-cu130` index alongside `torch` and
`flash_attn_3`. That index doesn't publish upload dates, so any package
pulled from it must be exempt from the 7-day `exclude-newer` cooldown
or `uv lock` may fail to resolve when a new release lands inside the
window.

Caught by bugbot.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(deps): refresh uv.lock metadata under uv 0.11.9

Previous lockfile was generated with uv 0.11.7. After the bugbot
fix added `torchvision`/`torchaudio` to `exclude-newer-package`,
CI (which runs uv 0.11.9) detected a metadata drift and failed
`uv sync --locked`, even though the resolved packages were
identical.

Re-locking with uv 0.11.9 reorders the `exclude-newer-package`
section and normalizes the `exclude-newer` value; no resolution
changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* add cu12 cudart to venv dep

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Jackmin801 <ongjackm@gmail.com>
2026-05-05 20:20:19 -07:00
f7a27f69dd fix(sft): don't divide reported throughput by cp (#2424)
Release / Push CUDA image to Docker (push) Canceled after 0s
The bench reported `num_tokens = batch * seq // cp`, which under-reports
tps and MFU by ~cp× when CP > 1. CP is sequence-sharded data parallelism
(cp ranks split the seq dim of the same `batch × seq` tokens), so the
unique training tokens per step is `batch × seq` regardless of cp —
identical to the convention RL already uses (which excludes cp from the
`dp` mesh used for token counting).

Effect: cp=2 runs no longer look 2× slower than they really are in
SFT bench output; numbers become directly comparable across cp values.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 17:33:39 -07:00
minh hoangandGitHub 31591b7fe8 docker: drop deadsnakes in build stage (#2421)
Release / Push CUDA image to Docker (push) Canceled after 0s
deadsnakes has been pretty flakey during image builds on CI, and afaict
i think uv already installs python so don't think it's actually required
2026-05-05 09:24:40 -07:00
samsjaandGitHub 0deb4abaa9 fix(ring_attn): make FA3 causal/window_size kwargs version-agnostic (#2417)
Release / Push CUDA image to Docker (push) Canceled after 0s
66b277fb hardcoded is_causal + window_size_left/right assuming flash_attn_3
  3.0.0 API, but forward uses causal while backward uses is_causal in the
  installed package. Add _set_fa3_signature_params() that inspects the
  get_default_args() dict to set whichever key is actually present, covering
  both param name variants across FA3 versions.
2026-05-04 19:23:23 -07:00
halleriteandGitHub 4be61bbd68 chore(deps): host disagg wheels on prime-rl release instead of samsja personal repo (#2413)
Release / Push CUDA image to Docker (push) Canceled after 0s
2026-05-05 00:07:16 +02:00
rasdaniandGitHub 0660a9b3cb Pin Triton JIT cache to node-local /tmp per job (#2305)
Release / Push CUDA image to Docker (push) Canceled after 0s
Default TRITON_CACHE_DIR=~/.triton/cache lives on NFS in shared-home
clusters. Concurrent multi-node compiles race on that directory and
some ranks hit `ImportError: cannot stat shared object: Stale file
handle` when reading a .so that another node invalidated. One rank
dies, NCCL watchdog trips after 480s on all other ranks, job hangs.

Point TRITON_CACHE_DIR at /tmp/triton-cache-$USER-$SLURM_JOB_ID so
each node has its own local cache and no job shares state with any
other.
2026-05-03 23:37:04 +02:00
28 changed files with 300 additions and 172 deletions
+56
View File
@@ -38,3 +38,59 @@ jobs:
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@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
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
forbidden = ["torch", "transformers", "vllm", "wandb", "ring_flash_attn",
"verifiers", "prime", "datasets", "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 a real config (with [slurm]) parses on slim install
run: |
/tmp/slim/bin/python - <<'PY'
from pydantic_config import cli
from prime_rl.configs.rl import RLConfig
rl = cli(RLConfig, args=["@", "examples/Intellect-3.1/rl.toml"])
assert rl.slurm is not None, "expected [slurm] in example config"
# On slim, template_path can't be auto-resolved (heavy wheel absent) — must stay None.
assert rl.slurm.template_path is None, f"unexpected template_path on slim: {rl.slurm.template_path}"
print("slim parse OK")
PY
+2 -7
View File
@@ -12,7 +12,7 @@ RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment
ENV CUDA_HOME=/usr/local/cuda
ENV PATH=$PATH:/usr/local/cuda/bin
# Install packages (including Python 3.12 and ninja for fast CUDA kernel compilation)
# Install build tooling.
ARG DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
@@ -22,12 +22,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends --force-yes \
sudo \
git \
ninja-build \
software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get install -y --no-install-recommends python3.12 python3.12-dev python3.12-venv \
&& ln -sf /usr/bin/python3.12 /usr/bin/python3 \
&& ln -sf /usr/bin/python3.12 /usr/bin/python \
&& apt-get clean autoclean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Download the latest installer
@@ -48,6 +42,7 @@ 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 configs /app/configs
COPY examples /app/examples
COPY benchmarks/scripts /app/benchmarks/scripts
+26
View File
@@ -0,0 +1,26 @@
# prime-rl-configs
Slim config schema for [`prime-rl`](https://github.com/PrimeIntellect-ai/prime-rl), with no GPU or ML deps.
`pip install prime-rl-configs` gives you `prime_rl.configs.*` (RL/SFT/inference/orchestrator/trainer/env-server schemas) without pulling in `torch`, `vllm`, `transformers`, `wandb`, etc. The full training stack lives in `prime-rl`, which depends on this package.
## Install
```sh
pip install git+https://github.com/PrimeIntellect-ai/prime-rl.git#subdirectory=packages/prime-rl-configs
```
## Usage
The pip *distribution name* (`prime-rl-configs`) and the *import path* (`prime_rl.configs.*`) are different on purpose: this package contributes submodules to the shared `prime_rl` namespace.
```python
from pydantic_config import cli
from prime_rl.configs.rl import RLConfig
config = cli(RLConfig, args=["@", "path/to/rl.toml"])
```
Other config classes live alongside `RLConfig` under `prime_rl.configs.*` (`sft`, `inference`, `orchestrator`, `trainer`, `env_server`).
`import prime_rl` on its own succeeds but is empty — it's a [PEP 420](https://peps.python.org/pep-0420/) namespace package with no top-level attributes. Always import a submodule.
+25
View File
@@ -0,0 +1,25 @@
[project]
name = "prime-rl-configs"
version = "0.4.0"
description = "Slim config schema for prime-rl (no GPU/ML deps)."
readme = "README.md"
requires-python = "~=3.12.0"
dependencies = [
"pydantic>=1.10.13",
# The PyPI package named `pydantic-config` is a different project that
# doesn't expose `BaseConfig` / `cli`. Pin to samsja's fork so plain
# `pip install prime-rl-configs` (no uv workspace context) resolves it.
"pydantic-config @ git+https://github.com/samsja/pydantic_config.git",
"tomli>=2.2.1",
"tomli-w>=1.2.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/prime_rl"]
[tool.hatch.metadata]
allow-direct-references = true
@@ -6,7 +6,7 @@ from pydantic import BaseModel, ConfigDict, Field, model_validator
from pydantic_config import BaseConfig
from prime_rl.configs.shared import BaseModelConfig, SlurmConfig
from prime_rl.utils.utils import rgetattr, rsetattr
from prime_rl.utils.config import find_package_resource, rgetattr, rsetattr
# TODO: Set thinking/ solution budget
@@ -450,10 +450,9 @@ class InferenceConfig(BaseConfig):
@model_validator(mode="after")
def auto_setup_slurm_template(self):
if self.slurm is not None and self.slurm.template_path is None:
import prime_rl
templates_dir = Path(prime_rl.__file__).parent / "templates"
self.slurm.template_path = templates_dir / "inference.sbatch.j2"
templates_dir = find_package_resource("templates")
if templates_dir is not None:
self.slurm.template_path = templates_dir / "inference.sbatch.j2"
return self
@model_validator(mode="after")
@@ -1,4 +1,5 @@
import math
import warnings
from pathlib import Path
from typing import Annotated, Any, Literal, TypeAlias
@@ -17,7 +18,6 @@ from prime_rl.configs.shared import (
)
from prime_rl.configs.trainer import TokenizerConfig
from prime_rl.utils.config import BaseConfig
from prime_rl.utils.logger import get_logger
class OptimizerConfig(BaseConfig):
@@ -149,9 +149,11 @@ class TrainSamplingConfig(BaseConfig):
@classmethod
def _deprecate_max_tokens(cls, data: Any) -> Any:
if isinstance(data, dict) and "max_tokens" in data and "max_completion_tokens" not in data:
get_logger().warning(
warnings.warn(
"'max_tokens' is deprecated, use 'max_completion_tokens' instead. "
"Auto-translating for now, but this will be removed in a future release."
"Auto-translating for now, but this will be removed in a future release.",
FutureWarning,
stacklevel=2,
)
return data
@@ -248,9 +250,11 @@ class EvalSamplingConfig(BaseConfig):
@classmethod
def _deprecate_max_tokens(cls, data: Any) -> Any:
if isinstance(data, dict) and "max_tokens" in data and "max_completion_tokens" not in data:
get_logger().warning(
warnings.warn(
"'max_tokens' is deprecated, use 'max_completion_tokens' instead. "
"Auto-translating for now, but this will be removed in a future release."
"Auto-translating for now, but this will be removed in a future release.",
FutureWarning,
stacklevel=2,
)
return data
@@ -1103,15 +1107,19 @@ class OrchestratorConfig(BaseConfig):
train = data.setdefault("train", {})
if isinstance(train, dict):
if "env" in data:
get_logger().warning(
warnings.warn(
"'[[orchestrator.env]]' is deprecated, use '[[orchestrator.train.env]]' instead. "
"Auto-translating for now, but this will be removed in a future release."
"Auto-translating for now, but this will be removed in a future release.",
FutureWarning,
stacklevel=2,
)
train.setdefault("env", data.pop("env"))
if "sampling" in data:
get_logger().warning(
warnings.warn(
"'[orchestrator.sampling]' is deprecated, use '[orchestrator.train.sampling]' instead. "
"Auto-translating for now, but this will be removed in a future release."
"Auto-translating for now, but this will be removed in a future release.",
FutureWarning,
stacklevel=2,
)
train.setdefault("sampling", data.pop("sampling"))
return data
@@ -1,3 +1,4 @@
import warnings
from pathlib import Path
from typing import Annotated, Literal, TypeAlias
@@ -38,8 +39,7 @@ from prime_rl.configs.trainer import (
from prime_rl.configs.trainer import (
NCCLWeightBroadcastConfig as TrainerNCCLWeightBroadcastConfig,
)
from prime_rl.utils.config import BaseConfig
from prime_rl.utils.logger import get_logger
from prime_rl.utils.config import BaseConfig, find_package_resource
from prime_rl.utils.validation import (
validate_shared_ckpt_config,
validate_shared_max_async_level,
@@ -745,9 +745,10 @@ class RLConfig(BaseConfig):
self.inference.enable_lora = True
self.inference.max_lora_rank = self.trainer.model.lora.rank
else:
get_logger().warning(
warnings.warn(
"LoRA is enabled, but inference is not configured. When manually starting the inference server, "
"make sure to set --enable_lora and --max-lora-rank."
"make sure to set --enable_lora and --max-lora-rank.",
stacklevel=2,
)
return self
@@ -763,13 +764,15 @@ class RLConfig(BaseConfig):
if self.trainer.enable_router_replay:
if self.inference is not None:
if self.inference.enable_return_routed_experts is False:
get_logger().warning(
"Router replay is enabled, but inference.enable_return_routed_experts is False. Setting to True."
warnings.warn(
"Router replay is enabled, but inference.enable_return_routed_experts is False. Setting to True.",
stacklevel=2,
)
self.inference.enable_return_routed_experts = True
else:
get_logger().warning(
"Router replay is enabled, but inference is not configured. When manually starting the inference server, make sure to pass `--enable-return-routed-experts` to the vLLM server."
warnings.warn(
"Router replay is enabled, but inference is not configured. When manually starting the inference server, make sure to pass `--enable-return-routed-experts` to the vLLM server.",
stacklevel=2,
)
return self
@@ -957,13 +960,12 @@ class RLConfig(BaseConfig):
def auto_setup_slurm_template(self):
"""Auto-setup the default single-node/multi-node SLURM template if no custom template is provided."""
if self.slurm is not None and self.slurm.template_path is None:
import prime_rl
templates_dir = Path(prime_rl.__file__).parent / "templates"
if self.deployment.type == "single_node":
self.slurm.template_path = templates_dir / "single_node_rl.sbatch.j2"
else:
self.slurm.template_path = templates_dir / "multi_node_rl.sbatch.j2"
templates_dir = find_package_resource("templates")
if templates_dir is not None:
if self.deployment.type == "single_node":
self.slurm.template_path = templates_dir / "single_node_rl.sbatch.j2"
else:
self.slurm.template_path = templates_dir / "multi_node_rl.sbatch.j2"
return self
### Warnings
@@ -21,7 +21,7 @@ from prime_rl.configs.trainer import (
SchedulerConfig,
TokenizerConfig,
)
from prime_rl.utils.config import BaseConfig
from prime_rl.utils.config import BaseConfig, find_package_resource
class BaseDataConfig(BaseModel):
@@ -425,11 +425,10 @@ class SFTConfig(BaseConfig):
@model_validator(mode="after")
def auto_setup_slurm_template(self):
if self.slurm is not None and self.slurm.template_path is None:
import prime_rl
templates_dir = Path(prime_rl.__file__).parent / "templates"
if self.deployment.type == "single_node":
self.slurm.template_path = templates_dir / "single_node_sft.sbatch.j2"
else:
self.slurm.template_path = templates_dir / "multi_node_sft.sbatch.j2"
templates_dir = find_package_resource("templates")
if templates_dir is not None:
if self.deployment.type == "single_node":
self.slurm.template_path = templates_dir / "single_node_sft.sbatch.j2"
else:
self.slurm.template_path = templates_dir / "multi_node_sft.sbatch.j2"
return self
@@ -0,0 +1,56 @@
from pathlib import Path
from typing import Any
from pydantic import BaseModel
from pydantic_config import BaseConfig as BaseConfig # noqa: F401
from pydantic_config import cli # noqa: F401
def find_package_resource(subdir: str) -> Path | None:
"""Find a directory contributed to the `prime_rl` namespace package by any installed wheel.
Returns None if `subdir` is not present in any wheel — e.g. on a slim
`prime-rl-configs`-only install where `prime-rl`'s shipped resources
(templates, etc.) are absent.
"""
import prime_rl
for p in prime_rl.__path__:
candidate = Path(p) / subdir
if candidate.is_dir():
return candidate
return None
def rgetattr(obj: Any, attr_path: str) -> Any:
"""Recursive getattr for dotted paths: rgetattr(cfg, "trainer.model.name")."""
current = obj
for attr in attr_path.split("."):
if not hasattr(current, attr):
raise AttributeError(f"'{type(current).__name__}' object has no attribute '{attr}'")
current = getattr(current, attr)
return current
def rsetattr(obj: Any, attr_path: str, value: Any) -> None:
"""Recursive setattr for dotted paths: rsetattr(cfg, "trainer.model.name", "foo")."""
if "." not in attr_path:
return setattr(obj, attr_path, value)
parent_path, attr = attr_path.rsplit(".", 1)
setattr(rgetattr(obj, parent_path), attr, value)
def get_all_fields(model: BaseModel | type) -> list[str]:
if isinstance(model, BaseModel):
model_cls = model.__class__
else:
model_cls = model
fields = []
for name, field in model_cls.model_fields.items():
field_type = field.annotation
fields.append(name)
if field_type is not None and hasattr(field_type, "model_fields"):
sub_fields = get_all_fields(field_type)
fields.extend(f"{name}.{sub}" for sub in sub_fields)
return fields
+17 -7
View File
@@ -5,16 +5,13 @@ description = "Async RL Training at Scale"
readme = "README.md"
requires-python = "~=3.12.0"
dependencies = [
"prime-rl-configs",
"beartype>=0.21.0",
"datasets>=4.0.0",
"jaxtyping>=0.3.2",
"liger-kernel>=0.5.10",
"loguru>=0.7.3",
"pyarrow>=21.0.0",
"pydantic>=1.10.13",
"pydantic-config",
"tomli>=2.2.1",
"tomli-w>=1.2.0",
"numpy>=2.2.6",
"torch>=2.9.0",
"torchdata>=0.11.0",
@@ -108,6 +105,9 @@ dev = [
]
[tool.uv.workspace]
members = ["packages/*"]
[tool.uv]
exclude-newer = "7 days"
preview = true
@@ -158,6 +158,7 @@ deep-gemm = false
nixl-cu12 = false
[tool.uv.sources]
prime-rl-configs = { workspace = true }
torch = { index = "pytorch-cu128" }
verifiers = { git = "https://github.com/PrimeIntellect-ai/verifiers.git", rev = "3b77145" }
torchtitan = { git = "https://github.com/pytorch/torchtitan", rev = "a1fdd7e" }
@@ -180,9 +181,9 @@ aime2024 = { index = "primeintellect" }
aime2025 = { index = "primeintellect" }
deepdive = { index = "primeintellect" }
mini_swe_agent_plus = { index = "primeintellect" }
deep-ep = { url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/deep_ep-1.2.1+73b6ea4-cp312-cp312-linux_x86_64.whl" }
deep-gemm = { url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/deep_gemm-2.3.0+477618c-cp312-cp312-linux_x86_64.whl" }
nixl-cu12 = { url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl" }
deep-ep = { url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/deep_ep-1.2.1+73b6ea4-cp312-cp312-linux_x86_64.whl" }
deep-gemm = { url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/deep_gemm-2.3.0+477618c-cp312-cp312-linux_x86_64.whl" }
nixl-cu12 = { url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl" }
flash-linear-attention = { git = "https://github.com/fla-org/flash-linear-attention" }
flash_attn_3 = { index = "pytorch-cu128-test" }
@@ -214,6 +215,12 @@ explicit = true
select = ["F", "I"]
ignore = ["F722", "F821"] # Need to ignore for jaxtyping (https://docs.kidger.site/jaxtyping/faq/)
[tool.ruff.lint.isort]
# `prime_rl` is split across two workspace wheels (prime-rl + prime-rl-configs).
# Without this, ruff classifies prime_rl.configs.* as third-party because it
# doesn't live under src/.
known-first-party = ["prime_rl"]
[tool.ruff]
line-length = 120
@@ -228,5 +235,8 @@ markers = [
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/prime_rl"]
[tool.hatch.metadata]
allow-direct-references = true
-1
View File
@@ -1 +0,0 @@
import prime_rl._compat # noqa: F401 — must run before ring_flash_attn is imported
+1
View File
@@ -12,6 +12,7 @@ from threading import Event, Thread
import pynvml
import tomli_w
import prime_rl._compat # noqa: F401 — patch ring_flash_attn compat before transitive import
from prime_rl.configs.rl import RLConfig
from prime_rl.trainer.model import pre_download_model
from prime_rl.utils.config import cli
+1
View File
@@ -8,6 +8,7 @@ from threading import Event, Thread
import tomli_w
import prime_rl._compat # noqa: F401 — patch ring_flash_attn compat before transitive import
from prime_rl.configs.sft import SFTConfig
from prime_rl.trainer.model import pre_download_model
from prime_rl.utils.config import cli
@@ -5,6 +5,7 @@ import time
import tomli_w
import prime_rl._compat # noqa: F401 — patch ring_flash_attn compat before transitive import
from prime_rl.orchestrator.advantage import compute_advantages
from prime_rl.orchestrator.eval_utils import compute_eval_ckpt_step
from prime_rl.orchestrator.event_loop_lag import EventLoopLagMonitor
@@ -52,6 +52,7 @@ ln -sfn inference/node_0.log $OUTPUT_DIR/logs/inference.log
export CUDA_DEVICE_ORDER=PCI_BUS_ID
export PYTHONUNBUFFERED=1
export OMP_NUM_THREADS=1
export TRITON_CACHE_DIR=/tmp/triton-cache-$USER-$SLURM_JOB_ID
export VLLM_CACHE_ROOT=/tmp/.vllm_cache_$(whoami)
# Setup environment
@@ -66,6 +66,7 @@ ln -sfn inference/node_0.log $OUTPUT_DIR/logs/inference.log
export CUDA_DEVICE_ORDER=PCI_BUS_ID
export PYTHONUNBUFFERED=1
export OMP_NUM_THREADS=1
export TRITON_CACHE_DIR=/tmp/triton-cache-$USER-$SLURM_JOB_ID
{% if wandb_shared -%}
export WANDB_SHARED_MODE=1
@@ -36,6 +36,7 @@ ln -sfn trainer/node_0.log $OUTPUT_DIR/logs/trainer.log
export CUDA_DEVICE_ORDER=PCI_BUS_ID
export PYTHONUNBUFFERED=1
export OMP_NUM_THREADS=1
export TRITON_CACHE_DIR=/tmp/triton-cache-$USER-$SLURM_JOB_ID
# Networking
export HOSTNAMES=( $( scontrol show hostnames $SLURM_JOB_NODELIST ) )
@@ -1,10 +1,26 @@
from __future__ import annotations
# ruff: noqa: I001 — `prime_rl._compat` must run before `ring_flash_attn` imports below.
import prime_rl._compat # noqa: F401
import torch
import torch.distributed as dist
from ring_flash_attn.utils import AllGatherComm, get_default_args
def _set_fa3_signature_params(params: dict, causal: bool, window_size: tuple[int, int]) -> None:
if "is_causal" in params:
params["is_causal"] = causal
else:
params["causal"] = causal
if "window_size" in params:
params["window_size"] = window_size
else:
params["window_size_left"] = window_size[0]
params["window_size_right"] = window_size[1]
def _fa3_varlen_forward(
q: torch.Tensor,
k: torch.Tensor,
@@ -30,11 +46,9 @@ def _fa3_varlen_forward(
"max_seqlen_q": max_seqlen_q,
"max_seqlen_k": max_seqlen_k,
"softmax_scale": softmax_scale,
"is_causal": causal,
"window_size_left": window_size[0],
"window_size_right": window_size[1],
}
)
_set_fa3_signature_params(params, causal, window_size)
out, lse, _, _ = _flash_attn_forward(**params)
return out, lse
@@ -76,11 +90,9 @@ def _fa3_varlen_backward(
"dk": dk,
"dv": dv,
"softmax_scale": softmax_scale,
"is_causal": causal,
"window_size_left": window_size[0],
"window_size_right": window_size[1],
}
)
_set_fa3_signature_params(params, causal, window_size)
_flash_attn_backward(**params)
+8 -3
View File
@@ -422,9 +422,14 @@ def train(config: SFTConfig):
if memory_profiler is not None:
memory_profiler.step()
# Compute step metrics
# Divide by CP since those ranks process the same data
num_tokens = config.data.batch_size * config.data.seq_len // config.model.cp
# Compute step metrics. CP shards the same sequences across cp ranks
# (sequence-sharded data parallelism on the seq dim), so the unique
# training tokens per step is dp_size * (batch_per_dp_rank * seq).
# The `dp` mesh excludes cp by construction (parallel_dims.py), mirroring
# the RL trainer's accounting (rl/train.py).
dp_size = parallel_dims.get_mesh("dp").size()
num_local_tokens = config.data.seq_len * (config.data.batch_size // dp_size)
num_tokens = dp_size * num_local_tokens
progress.total_tokens += num_tokens
progress.total_samples = dataset.step
perf_counter = get_perf_counter(model, config.data.seq_len)
-19
View File
@@ -1,19 +0,0 @@
from pydantic import BaseModel
from pydantic_config import BaseConfig as BaseConfig # noqa: F401
from pydantic_config import cli # noqa: F401
def get_all_fields(model: BaseModel | type) -> list[str]:
if isinstance(model, BaseModel):
model_cls = model.__class__
else:
model_cls = model
fields = []
for name, field in model_cls.model_fields.items():
field_type = field.annotation
fields.append(name)
if field_type is not None and hasattr(field_type, "model_fields"):
sub_fields = get_all_fields(field_type)
fields.extend(f"{name}.{sub}" for sub in sub_fields)
return fields
+3
View File
@@ -1,5 +1,8 @@
from __future__ import annotations
# ruff: noqa: I001 — `prime_rl._compat` must run before `ring_flash_attn` imports below.
import prime_rl._compat # noqa: F401
import torch
import torch.distributed as dist
import torch.distributed.nn as dist_nn
-71
View File
@@ -41,77 +41,6 @@ def import_object(dotted_path: str) -> Any:
return getattr(module, name)
def rgetattr(obj: Any, attr_path: str) -> Any:
"""
Try to get a (nested) attribute from an object. For example:
```python
class Foo:
bar = "baz"
class Bar:
foo = Foo()
foo = Foo()
bar = Bar()
```
Here, the following holds:
- `getattr(foo, "bar")` will return `"baz"`.
- `getattr(bar, "foo)` will return an object of type `Foo`.
- `getattr(bar, "foo.bar")` will error
This function solves this. `rgetattr(bar, "foo.bar")` will return `"baz"`.
Args:
obj: The object to get the attribute from.
attr_path: The path to the attribute, nested using `.` as separator.
Returns:
The attribute
"""
attrs = attr_path.split(".")
current = obj
for attr in attrs:
if not hasattr(current, attr):
raise AttributeError(f"'{type(current).__name__}' object has no attribute '{attr}'")
current = getattr(current, attr)
return current
def rsetattr(obj: Any, attr_path: str, value: Any) -> None:
"""
Try to set a (nested) attribute from an object. For example:
```python
class Foo:
bar = "baz"
class Bar:
foo = Foo()
foo = Foo()
bar = Bar()
```
Here, the following holds:
- `rsetattr(bar, "foo.bar", "qux")` will set `bar.foo.bar` to `"qux"`.
- `rsetattr(bar, "foo.bar", "qux")` will set `bar.foo.bar` to `"qux"`.
Args:
obj: The object to set the attribute on.
attr_path: The path to the attribute, nested using `.` as separator.
value: The value to set the attribute to.
"""
if "." not in attr_path:
return setattr(obj, attr_path, value)
attr_path, attr = attr_path.rsplit(".", 1)
obj = rgetattr(obj, attr_path)
setattr(obj, attr, value)
def capitalize(s: str) -> str:
"""Capitalize the first letter of a string."""
return s[0].upper() + s[1:]
Generated
+38 -21
View File
@@ -11,7 +11,7 @@ supported-markers = [
]
[options]
exclude-newer = "2026-04-23T20:00:49.639641409Z"
exclude-newer = "2026-04-27T23:51:18.884329218Z"
exclude-newer-span = "P7D"
[options.exclude-newer-package]
@@ -44,6 +44,10 @@ aime2025 = false
prime-sandboxes = false
[manifest]
members = [
"prime-rl",
"prime-rl-configs",
]
overrides = [
{ name = "nvidia-cudnn-cu12", specifier = ">=9.15" },
{ name = "nvidia-cutlass-dsl", specifier = ">=4.4.1" },
@@ -638,17 +642,17 @@ wheels = [
[[package]]
name = "deep-ep"
version = "1.2.1+73b6ea4"
source = { url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/deep_ep-1.2.1+73b6ea4-cp312-cp312-linux_x86_64.whl" }
source = { url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/deep_ep-1.2.1+73b6ea4-cp312-cp312-linux_x86_64.whl" }
wheels = [
{ url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/deep_ep-1.2.1+73b6ea4-cp312-cp312-linux_x86_64.whl", hash = "sha256:ddf25e5d9c8543d27d7ae7a62ff7752560bf79c03c5991d48721352818b320d3" },
{ url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/deep_ep-1.2.1+73b6ea4-cp312-cp312-linux_x86_64.whl", hash = "sha256:ddf25e5d9c8543d27d7ae7a62ff7752560bf79c03c5991d48721352818b320d3" },
]
[[package]]
name = "deep-gemm"
version = "2.3.0+477618c"
source = { url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/deep_gemm-2.3.0+477618c-cp312-cp312-linux_x86_64.whl" }
source = { url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/deep_gemm-2.3.0+477618c-cp312-cp312-linux_x86_64.whl" }
wheels = [
{ url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/deep_gemm-2.3.0+477618c-cp312-cp312-linux_x86_64.whl", hash = "sha256:a40cea03705cfa50eefe5651d91e3e7ebf87a53acf06cde8bbb877fb95f0f921" },
{ url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/deep_gemm-2.3.0+477618c-cp312-cp312-linux_x86_64.whl", hash = "sha256:a40cea03705cfa50eefe5651d91e3e7ebf87a53acf06cde8bbb877fb95f0f921" },
]
[[package]]
@@ -2006,7 +2010,7 @@ version = "0.10.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "nixl-cu12", version = "0.10.1", source = { registry = "https://pypi.org/simple" }, marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "nixl-cu12", version = "0.10.1", source = { url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
{ name = "nixl-cu12", version = "0.10.1", source = { url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
]
wheels = [
{ url = "https://files.pythonhosted.org/packages/bb/a4/10e80e623790d3fb070e966b36bced009419d483c92ae0df6645230f606f/nixl-0.10.1-py3-none-any.whl", hash = "sha256:616465673dae5180d296525a03237af4cd5f2c00c3228d185bc06dbe621509b7", size = 6680, upload-time = "2026-03-03T19:55:44.848Z" },
@@ -2030,7 +2034,7 @@ wheels = [
[[package]]
name = "nixl-cu12"
version = "0.10.1"
source = { url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl" }
source = { url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl" }
resolution-markers = [
"platform_machine == 'x86_64' and sys_platform == 'linux'",
]
@@ -2039,7 +2043,7 @@ dependencies = [
{ name = "torch", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
]
wheels = [
{ url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl", hash = "sha256:bd01eb9e52f1affee3330062baa2f3bea7d711664f7cb602bf5d3f694daeb796" },
{ url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl", hash = "sha256:bd01eb9e52f1affee3330062baa2f3bea7d711664f7cb602bf5d3f694daeb796" },
]
[package.metadata]
@@ -2690,17 +2694,14 @@ dependencies = [
{ name = "nvidia-ml-py", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "openai", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "prime", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "prime-rl-configs", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "pyarrow", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "pydantic", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "pydantic-config", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "pyzmq", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "rich", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "ring-flash-attn", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "setproctitle", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "tenacity", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "tilelang", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "tomli", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "tomli-w", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "torch", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "torchdata", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "torchtitan", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
@@ -2719,7 +2720,7 @@ all = [
{ name = "flash-attn-3", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "flash-attn-4", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "nixl", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "nixl-cu12", version = "0.10.1", source = { url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
{ name = "nixl-cu12", version = "0.10.1", source = { url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
{ name = "quack-kernels", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "vllm-router", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
]
@@ -2727,7 +2728,7 @@ disagg = [
{ name = "deep-ep", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
{ name = "deep-gemm", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
{ name = "nixl", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "nixl-cu12", version = "0.10.1", source = { url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
{ name = "nixl-cu12", version = "0.10.1", source = { url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
{ name = "vllm-router", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
]
envs = [
@@ -2784,8 +2785,8 @@ requires-dist = [
{ name = "code-env", marker = "extra == 'envs'", index = "https://hub.primeintellect.ai/primeintellect/simple/" },
{ name = "color-codeword", marker = "extra == 'envs'", index = "https://hub.primeintellect.ai/primeintellect/simple/" },
{ name = "datasets", specifier = ">=4.0.0" },
{ name = "deep-ep", marker = "platform_machine == 'x86_64' and extra == 'disagg'", url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/deep_ep-1.2.1+73b6ea4-cp312-cp312-linux_x86_64.whl" },
{ name = "deep-gemm", marker = "platform_machine == 'x86_64' and extra == 'disagg'", url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/deep_gemm-2.3.0+477618c-cp312-cp312-linux_x86_64.whl" },
{ name = "deep-ep", marker = "platform_machine == 'x86_64' and extra == 'disagg'", url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/deep_ep-1.2.1+73b6ea4-cp312-cp312-linux_x86_64.whl" },
{ name = "deep-gemm", marker = "platform_machine == 'x86_64' and extra == 'disagg'", url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/deep_gemm-2.3.0+477618c-cp312-cp312-linux_x86_64.whl" },
{ name = "deepdive", marker = "extra == 'envs'", index = "https://hub.primeintellect.ai/primeintellect/simple/" },
{ name = "dion", git = "https://github.com/samsja/dion.git?rev=d891eeb" },
{ name = "flash-attn", marker = "platform_machine == 'x86_64' and extra == 'flash-attn'", url = "https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.7.16/flash_attn-2.8.3+cu128torch2.10-cp312-cp312-linux_x86_64.whl" },
@@ -2802,7 +2803,7 @@ requires-dist = [
{ name = "math500", marker = "extra == 'envs'", index = "https://hub.primeintellect.ai/primeintellect/simple/" },
{ name = "mini-swe-agent-plus", marker = "extra == 'envs'", index = "https://hub.primeintellect.ai/primeintellect/simple/" },
{ name = "nixl", marker = "extra == 'disagg'" },
{ name = "nixl-cu12", marker = "platform_machine == 'x86_64' and extra == 'disagg'", url = "https://github.com/samsja/research-pre-built-wheels/releases/download/v0.2/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl" },
{ name = "nixl-cu12", marker = "platform_machine == 'x86_64' and extra == 'disagg'", url = "https://github.com/PrimeIntellect-ai/prime-rl/releases/download/v0.5.0/nixl_cu12-0.10.1-cp312-cp312-linux_x86_64.whl" },
{ name = "numpy", specifier = ">=2.2.6" },
{ name = "nvidia-ml-py", specifier = ">=12.575.51" },
{ name = "openai", specifier = ">=1.106.1" },
@@ -2812,9 +2813,8 @@ requires-dist = [
{ name = "prime-rl", extras = ["flash-attn-3"], marker = "extra == 'all'" },
{ name = "prime-rl", extras = ["flash-attn-cute"], marker = "extra == 'all'" },
{ name = "prime-rl", extras = ["quack"], marker = "extra == 'all'" },
{ name = "prime-rl-configs", editable = "packages/prime-rl-configs" },
{ name = "pyarrow", specifier = ">=21.0.0" },
{ name = "pydantic", specifier = ">=1.10.13" },
{ name = "pydantic-config", git = "https://github.com/samsja/pydantic_config.git?branch=main" },
{ name = "pyzmq", specifier = ">=27.1.0" },
{ name = "quack-kernels", marker = "extra == 'quack'", specifier = ">=0.3.3" },
{ name = "reverse-text", marker = "extra == 'envs'", index = "https://hub.primeintellect.ai/primeintellect/simple/" },
@@ -2824,8 +2824,6 @@ requires-dist = [
{ name = "setproctitle", specifier = ">=1.3.0" },
{ name = "tenacity", specifier = ">=8.2.0" },
{ name = "tilelang", specifier = ">=0.1.8" },
{ name = "tomli", specifier = ">=2.2.1" },
{ name = "tomli-w", specifier = ">=1.2.0" },
{ name = "torch", specifier = ">=2.9.0", index = "https://download.pytorch.org/whl/cu128" },
{ name = "torchdata", specifier = ">=0.11.0" },
{ name = "torchtitan", git = "https://github.com/pytorch/torchtitan?rev=a1fdd7e" },
@@ -2849,6 +2847,25 @@ dev = [
]
mamba-ssm = [{ name = "mamba-ssm", specifier = ">=2.3.0" }]
[[package]]
name = "prime-rl-configs"
version = "0.4.0"
source = { editable = "packages/prime-rl-configs" }
dependencies = [
{ name = "pydantic", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "pydantic-config", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "tomli", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
{ name = "tomli-w", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },
]
[package.metadata]
requires-dist = [
{ name = "pydantic", specifier = ">=1.10.13" },
{ name = "pydantic-config", git = "https://github.com/samsja/pydantic_config.git?branch=main" },
{ name = "tomli", specifier = ">=2.2.1" },
{ name = "tomli-w", specifier = ">=1.2.0" },
]
[[package]]
name = "prime-sandboxes"
version = "0.2.22"