Compare commits

...
Author SHA1 Message Date
faresobeidandGitHub 8493109b7d chore(inference): drop typed vLLM fields that only repeat vLLM defaults (#3986)
Drops seven typed `[inference.vllm]` fields: `seed`, `enforce_eager`,
`dtype`, `trust_remote_code`, `enable_dbo`, `max_loras`,
`all2all_backend`, and the `All2AllBackend` alias. Each one only
repeated vLLM 0.31's own default, and nothing in prime-rl reads it.
`VllmConfig` is `extra="allow"`, so all seven keys still pass through to
vLLM unchanged. The `VllmConfig` docstring says to type only fields that
prime-rl types, defaults or reads back; these were none of those.

`all2all_backend` also suggested control it doesn't have for P/D: the
sbatch templates set the per-role backend in `ROLE_EXTRA`
(`inference.sbatch.j2:261,276`, `multi_node_rl.sbatch.j2:405,419`). That
stays as is.

Behavior: I resolved the vLLM serve args (`to_namespace` →
`make_arg_parser().parse_args`) on main and on this branch for the
default config and for `--vllm.enforce-eager`, `--vllm.enforce-eager
true`, `--vllm.max-loras 2`, `--vllm.dtype bfloat16`, `--vllm.seed 7`,
`--vllm.all2all-backend deepep_low_latency`, `--vllm.enable-dbo true`,
`--vllm.trust-remote-code true`, `@
examples/advanced/glm-5.3/infer/pd.toml`. All seven values are
identical. The nested rl form `--inference.vllm.enforce-eager
--inference.vllm.max-loras 2` also resolves to `True, 2`. `"enable_dbo"
= true` in `examples/advanced/glm-5.3/swe.toml` sits under
`prefill_vllm_overrides` and is unaffected.

Differences:
- `--no-vllm.enforce-eager` (the negated bool flag) only exists for
typed fields. Use `--vllm.enforce-eager false`. All four removed bools
default to False, so this only matters when undoing a toml that set one
to true.
- `dtype` now accepts every value vLLM accepts (for example `half`)
instead of prime-rl's narrower Literal.

`skills/configs/SKILL.md` used `enforce_eager = true` as its TOML
boolean example. It now uses `enable_prefix_caching = true`, which is
still typed, so `--no-flag` applies to it.

## Test plan
- `pytest tests/unit/orchestrator tests/unit/test_configs.py
tests/unit/test_parsers.py -m "not gpu"`: 489 passed
- Parsed all 78 tomls under `configs/` and `examples/` with every config
class on main and on this branch: same results
- The resolved-args comparison above
- `ruff check` / `ruff format --check` on the changed file
2026-10-10 19:07:27 +01:00
faresobeidandGitHub c9ce5f3d30 chore(configs): drop dead orchestrator fields (#3983) 2026-10-10 19:04:40 +01:00
faresobeidandGitHub 9570bccc28 chore(configs): drop recipe lines that repeat defaults (#3982)
## What
Drop recipe lines that only repeat what the config already resolves to.
The resolved configs do not change, except for `skip_optimizer` (see
below).
- `[weight_broadcast] type = "nccl"`: `rl` already picks NCCL when
inference is managed and LoRA is off. Removed from minimax-m2.5 swe,
intellect-3.1 rl, and qwen3-30b-a3b swe/math. The block stays in
examples/extra/dynamo/rl.toml (no managed inference, so the default
there is filesystem) and in glm-5.3 (it also sets port and timeout).
- `ac.freq = 1` (the default) is removed from 8 recipes. The
`[*.model.ac]` table header stays, matching the GLM-4.5-Air recipes.
- `trainer.dist_timeout_seconds = 3600` / `dist_timeout_seconds = 3600`
(the default) is removed from 5 RL recipes and vlm/sft-moe.
- `inference.vllm.enable_return_routed_experts = true` is removed where
`trainer.enable_router_replay = true` already sets it (glm-4.5-air ×4,
nemotron-3-super).
- `[trainer.ckpt] skip_optimizer = true` is removed from glm-4.5-air
swe-budget/search/terminal and nemotron-3-super swe.
  - It only affects loading: on resume, it drops the AdamW/Muon state.
- It came from the #2862/#2915 ablation configs. None of these recipes
warm-starts from another run's checkpoint. They train from the HF model
and resume their own checkpoints, which include optimizer state.
- configs/ci/integration/reverse-text-sft/full-offload-resume.toml keeps
it on purpose: it tests that path.
- docs/scaling.md: the `fused_lm_head_token_chunk_size` default is 8192
(since #3302), not 1024.

## Not touched
- `fused_lm_head_token_chunk_size = 1024` pins (7 recipes) and `attn =
"flash_attention_3"` pins (10). Should they stay as memory/hardware
choices?
- `[ac_offloading] max_inflight_activations` lines (a separate PR
removes the field).
- The `[weight_broadcast]` blocks of the GLM-4.5-Air and nemotron
recipes (handled in the weight_broadcast.timeout PR, to avoid a
conflict).

## Test plan
- `pytest tests/unit/orchestrator tests/unit/test_configs.py -m "not
gpu"`: 334 passed (validates every TOML under configs/ and examples/).
- Resolved configs of all 14 edited recipes, main vs this branch
(RLConfig/SFTConfig `model_dump`):
- identical, except `trainer.ckpt.skip_optimizer` True → False in the 4
recipes above;
- the checkout path in `template_path` also differs (main checkout vs
this worktree), which is not a recipe change.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Mostly documentation and deduplication; the only resolved-config
change is `skip_optimizer` false on four recipes that resume with full
optimizer state, which matches their intended training flow.
> 
> **Overview**
> Trims RL/SFT example and advanced recipe TOMLs by deleting settings
that already match framework defaults, so recipes only spell out
non-default choices.
> 
> Removed redundant **`[weight_broadcast] type = "nccl"`**,
**`trainer.model.ac` `freq = 1`**, **`dist_timeout_seconds = 3600`**,
and **`inference.vllm.enable_return_routed_experts`** where NCCL
broadcast, AC frequency, dist timeout, and routed-expert return are
implied (e.g. managed inference + **`enable_router_replay`**). Dropped
**`[trainer.ckpt] skip_optimizer = true`** from four GLM-4.5-Air and
Nemotron SWE/search/terminal recipes so resume loads optimizer state
from their own checkpoints instead of discarding it.
> 
> **`docs/scaling.md`** now documents
**`fused_lm_head_token_chunk_size`** default **8192** (was incorrectly
**1024**). Explicit pins like **`fused_lm_head_token_chunk_size =
1024`** in memory-tight recipes are unchanged.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c87c43defc655e83c39559736ca874740327d266. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-10-10 18:38:11 +01:00
27 changed files with 27 additions and 151 deletions
-4
View File
@@ -6,9 +6,6 @@ level = "debug"
[model]
name = "PrimeIntellect/MiniMax-M2.5-bf16"
[weight_broadcast]
type = "nccl"
[deployment]
type = "multi_node"
num_train_nodes = 4
@@ -35,7 +32,6 @@ fused_lm_head_token_chunk_size = 1024
max_inflight_activations = 5
[trainer.model.ac]
freq = 1
[trainer.optim]
type = "adamw"
@@ -36,7 +36,6 @@ keep_last = 1
name = "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16"
[trainer]
dist_timeout_seconds = 3600
enable_router_replay = true
[trainer.model]
@@ -54,9 +53,6 @@ max_inflight_activations = 1
[trainer.model.compile]
[trainer.ckpt]
skip_optimizer = true
[trainer.optim]
type = "adamw"
@@ -110,4 +106,3 @@ max_model_len = 131072
tensor_parallel_size = 8
enable_prefix_caching = true
enable_expert_parallel = true
enable_return_routed_experts = true
@@ -24,8 +24,6 @@ group_size = 16
[orchestrator.concurrency]
max_inflight = 128
[orchestrator.model.lora]
[orchestrator.train.sampling]
max_completion_tokens = 128
@@ -21,8 +21,6 @@ group_size = 16
[orchestrator.concurrency]
max_inflight = 128
[orchestrator.model.lora]
[orchestrator.train.sampling]
max_completion_tokens = 128
+3 -3
View File
@@ -147,11 +147,11 @@ State-only optimizer offload remains enabled by default with `model.optim_cpu_of
### LM Head Chunking
The vanilla LM head materializes a `[batch * seq, vocab]` logits tensor on every step — a major memory tax when the vocabulary is large (often >100K). `fused_lm_head_token_chunk_size` swaps in a custom fused linear + logprob/entropy kernel that streams through `chunk_size` tokens at a time, avoiding the materialization. It defaults to `1024` for RL training:
The vanilla LM head materializes a `[batch * seq, vocab]` logits tensor on every step — a major memory tax when the vocabulary is large (often >100K). `fused_lm_head_token_chunk_size` swaps in a custom fused linear + logprob/entropy kernel that streams through `chunk_size` tokens at a time, avoiding the materialization. It defaults to `8192` for RL training:
```toml
[trainer.model]
fused_lm_head_token_chunk_size = 1024 # default
fused_lm_head_token_chunk_size = 8192 # default
# fused_lm_head_token_chunk_size = "disabled" # vanilla LM head
```
@@ -173,7 +173,7 @@ freq = 1
max_inflight_activations = 1
```
The defaults already cover: fused LM head chunking (`1024`), `torch.compile` (fullgraph=False), AC (full mode), AC offloading (`max_inflight_activations=5`), and optimizer CPU offload. Walks through every memory lever in order: FSDP+EP shard the weights, CP shards the activations along the token dim, AC + AC offloading shrink the activation footprint, fused LM head chunks the loss, `torch.compile` reduces fragmentation, optim offload moves Adam state off GPU. Apply selectively — each knob has a throughput cost.
The defaults already cover: fused LM head chunking (`8192`), `torch.compile` (fullgraph=False), AC (full mode), AC offloading (`max_inflight_activations=5`), and optimizer CPU offload. Walks through every memory lever in order: FSDP+EP shard the weights, CP shards the activations along the token dim, AC + AC offloading shrink the activation footprint, fused LM head chunks the loss, `torch.compile` reduces fragmentation, optim offload moves Adam state off GPU. Apply selectively — each knob has a throughput cost.
## SLURM
@@ -37,7 +37,6 @@ name = "zai-org/GLM-4.5-Air"
# --- Trainer ---
[trainer]
dist_timeout_seconds = 3600
enable_router_replay = true
[trainer.model]
@@ -53,9 +52,6 @@ max_inflight_activations = 1
[trainer.model.compile]
[trainer.ckpt]
skip_optimizer = true
[trainer.optim]
type = "muon"
@@ -175,4 +171,3 @@ FLASHINFER_WORKSPACE_BASE = "/tmp/.flashinfer-cache"
[inference.vllm]
max_model_len = 131072
tensor_parallel_size = 8
enable_return_routed_experts = true
@@ -47,7 +47,6 @@ keep_last = 1
# --- Trainer ---
[trainer]
dist_timeout_seconds = 3600
enable_router_replay = true
[model]
@@ -68,9 +67,6 @@ max_inflight_activations = 1
[trainer.model.compile]
[trainer.ckpt]
skip_optimizer = true
[trainer.optim]
type = "sign_sgd"
@@ -107,4 +103,3 @@ FLASHINFER_WORKSPACE_BASE = "/tmp/.flashinfer-cache"
[inference.vllm]
max_model_len = 131072
tensor_parallel_size = 8
enable_return_routed_experts = true
-2
View File
@@ -48,7 +48,6 @@ keep_last = 1
# --- Trainer ---
[trainer]
dist_timeout_seconds = 3600
enable_router_replay = true
[model]
@@ -123,4 +122,3 @@ gpu_memory_utilization = 0.85
max_model_len = 131072
tensor_parallel_size = 8
enable_expert_parallel = true
enable_return_routed_experts = true
@@ -38,7 +38,6 @@ name = "zai-org/GLM-4.5-Air"
# --- Trainer ---
[trainer]
dist_timeout_seconds = 3600
enable_router_replay = true
[trainer.model]
@@ -54,9 +53,6 @@ max_inflight_activations = 1
[trainer.model.compile]
[trainer.ckpt]
skip_optimizer = true
[trainer.optim]
type = "muon"
@@ -170,4 +166,3 @@ FLASHINFER_WORKSPACE_BASE = "/tmp/.flashinfer-cache"
[inference.vllm]
max_model_len = 131072
tensor_parallel_size = 8
enable_return_routed_experts = true
-1
View File
@@ -98,7 +98,6 @@ type = "fp8"
type = "deepgemm_fp8"
[trainer.model.ac]
freq = 1
[trainer.model.compile]
-4
View File
@@ -6,9 +6,6 @@ level = "debug"
[model]
name = "PrimeIntellect/INTELLECT-3-Base"
[weight_broadcast]
type = "nccl"
[deployment]
type = "multi_node"
num_train_nodes = 4
@@ -35,7 +32,6 @@ fused_lm_head_token_chunk_size = 1024
max_inflight_activations = 5
[trainer.model.ac]
freq = 1
[trainer.optim]
type = "muon"
@@ -6,9 +6,6 @@ level = "debug"
[model]
name = "Qwen/Qwen3-30B-A3B-Thinking-2507"
[weight_broadcast]
type = "nccl"
[deployment]
type = "multi_node"
num_train_nodes = 2
@@ -33,7 +30,6 @@ ep = 8
max_inflight_activations = 5
[trainer.model.ac]
freq = 1
[trainer.optim]
type = "adamw"
-4
View File
@@ -6,9 +6,6 @@ level = "debug"
[model]
name = "Qwen/Qwen3-30B-A3B-Thinking-2507"
[weight_broadcast]
type = "nccl"
[deployment]
type = "multi_node"
num_train_nodes = 2
@@ -34,7 +31,6 @@ cp = 2
max_inflight_activations = 5
[trainer.model.ac]
freq = 1
[trainer.optim]
type = "adamw"
@@ -26,7 +26,6 @@ name = "Qwen/Qwen3-30B-A3B-Instruct-2507"
cp = 2
[trainer.model.ac]
freq = 1
[trainer.model.compile]
-1
View File
@@ -12,7 +12,6 @@ project = "alphabet-sort"
name = "alphabet-sort"
[trainer.model.ac]
freq = 1
[trainer.model.lora]
rank = 32
-2
View File
@@ -38,8 +38,6 @@ group_size = 16
[orchestrator.concurrency]
initial_inflight = 1024
[orchestrator.model.lora]
[orchestrator.train.sampling]
max_completion_tokens = 512
-1
View File
@@ -1,6 +1,5 @@
# Multimodal (VLM) SFT on a Mixture-of-Experts model — single 8xH200 node.
max_steps = 1000
dist_timeout_seconds = 3600
[model]
name = "Qwen/Qwen3.6-35B-A3B"
-1
View File
@@ -19,7 +19,6 @@ freeze_vision_encoder = true
rank = 16
[model.ac]
freq = 1
[data]
type = "sft"
@@ -29,15 +29,6 @@ class ServerConfig(BaseConfig):
# not depend on vLLM, and importing it costs seconds in every config-parsing process.
VALID_VLLM_LORA_RANKS = (8, 16, 32, 64, 128, 256, 320, 512)
# vLLM all2all backend options for expert-parallel deployments.
All2AllBackend = Literal[
"allgather_reducescatter",
"deepep_high_throughput",
"deepep_low_latency",
"flashinfer_nvlink_one_sided",
"flashinfer_nvlink_two_sided",
]
QuantizationType = Literal["fp8_per_block"]
@@ -59,18 +50,9 @@ class VllmConfig(BaseConfig):
model: str = "Qwen/Qwen3-0.6B"
"""HF model name or local path."""
dtype: Literal["auto", "float16", "bfloat16", "float32"] = "auto"
"""dtype for model weights and activations. ``auto`` uses FP16 for FP32/FP16 models and BF16 for BF16 models."""
max_model_len: int | None = None
"""Maximum model context length. If None, uses the model config's value."""
enforce_eager: bool = False
"""Enforce eager mode. When False, PyTorch eager and cuda graphs run hybrid for maximum performance."""
trust_remote_code: bool = False
"""Trust remote code when loading the model."""
chat_template: str | None = None
"""Chat template — a Jinja2 template string or path to a template file. If None, uses the model's default."""
@@ -98,9 +80,6 @@ class VllmConfig(BaseConfig):
api_server_count: int = Field(1, ge=0)
"""API servers to run. Set to 0 for headless mode."""
seed: int = 0
"""Seed the inference components."""
gpu_memory_utilization: float = 0.9
"""GPU memory utilization."""
@@ -113,10 +92,6 @@ class VllmConfig(BaseConfig):
enable_lora: bool = False
"""Enable LoRA."""
max_loras: int = 1
"""Maximum number of concurrently served LoRAs. prime-rl serves one adapter and reloads
it in place every policy version (same name, same lora_int_id), so one slot suffices."""
max_lora_rank: int | None = None
"""Maximum LoRA rank. Rounded up to the nearest value vLLM accepts."""
@@ -126,9 +101,6 @@ class VllmConfig(BaseConfig):
enable_expert_parallel: bool = False
"""Enable expert parallelism for MoE models."""
all2all_backend: All2AllBackend = "allgather_reducescatter"
"""All-to-all backend for expert-parallel communication."""
enable_eplb: bool = False
"""Enable expert parallel load balancer (EPLB)."""
@@ -138,9 +110,6 @@ class VllmConfig(BaseConfig):
expert parallelism is disabled, or under EPLB (redundant expert slots need all
logical expert weights)."""
enable_dbo: bool = False
"""Enable dual batch overlap (DBO)."""
enable_return_routed_experts: bool = False
"""Return routed experts in responses."""
@@ -19,9 +19,9 @@ from prime_rl.configs.shared import (
FileSystemWeightBroadcastConfig,
HeartbeatConfig,
LogConfig,
PolicyClientConfig,
ResumeConfig,
TransportConfig,
VLLMClientConfig,
WeightBroadcastConfig,
ZMQTransportConfig,
)
@@ -29,19 +29,8 @@ from prime_rl.configs.trainer import TokenizerConfig
from prime_rl.utils.config import BaseConfig, default_output_dir
class LoRAConfig(BaseConfig):
rank: int | None = Field(None, ge=1)
"""LoRA rank for this run. Must be ≤ trainer's max rank. If None, uses the trainer's rank."""
alpha: float | None = Field(None, ge=0)
"""LoRA alpha for this run. If None, uses the trainer's alpha."""
class ModelConfig(BaseModelConfig):
lora: LoRAConfig | None = None
"""Per-run LoRA configuration. If None, LoRA is disabled."""
client: VLLMClientConfig = Field(default_factory=VLLMClientConfig)
client: PolicyClientConfig = Field(default_factory=PolicyClientConfig)
"""Client of the live deployment (``[orchestrator.model.client]``)."""
@@ -440,12 +429,6 @@ class CheckpointConfig(BaseConfig):
wait_for_weights_timeout: int | None = Field(None, ge=1)
"""Wait up to this many seconds for the startup weight directory to appear (the trainer broadcasts the incoming policy — v0 from scratch, the resumed step's version on resume — before the first step). If None, fall back to a default timeout. Raise this for large models on slow shared filesystems."""
keep_last: int | None = Field(None, ge=1)
"""Keep at most this many recent step checkpoints on disk. If None, never clean old checkpoints based on recency."""
keep_interval: int | None = Field(None, ge=1)
"""Keep checkpoints at every N steps permanently (e.g. ``keep_interval=100`` keeps step 100, 200, ...). If None, no interval-based keeping."""
class ConcurrencyConfig(BaseConfig):
"""Adaptive in-flight concurrency control. The orchestrator sizes the
@@ -470,37 +470,6 @@ class RLConfig(BaseConfig):
@model_validator(mode="after")
def auto_setup_lora(self):
if self.trainer.model.lora is not None:
if self.orchestrator.model.lora is None:
from prime_rl.configs.orchestrator import LoRAConfig
self.orchestrator.model.lora = LoRAConfig()
if (
self.orchestrator.model.lora.rank is not None
and self.orchestrator.model.lora.rank != self.trainer.model.lora.rank
):
raise ValueError(
f"orchestrator.model.lora.rank ({self.orchestrator.model.lora.rank}) conflicts with "
f"trainer.model.lora.rank ({self.trainer.model.lora.rank}). "
f"Remove orchestrator.model.lora.rank to inherit from trainer, or update trainer.model.lora.rank to match."
)
if (
self.orchestrator.model.lora.alpha is not None
and self.orchestrator.model.lora.alpha != self.trainer.model.lora.alpha
):
raise ValueError(
f"orchestrator.model.lora.alpha ({self.orchestrator.model.lora.alpha}) conflicts with "
f"trainer.model.lora.alpha ({self.trainer.model.lora.alpha}). "
f"Remove orchestrator.model.lora.alpha to inherit from trainer, or update trainer.model.lora.alpha to match."
)
if self.orchestrator.model.lora.rank is None:
self.orchestrator.model.lora.rank = self.trainer.model.lora.rank
if self.orchestrator.model.lora.alpha is None:
self.orchestrator.model.lora.alpha = self.trainer.model.lora.alpha
if self.inference is not None:
self.inference.vllm.enable_lora = True
self.inference.vllm.max_lora_rank = self.trainer.model.lora.rank
@@ -223,9 +223,6 @@ class ClientConfig(BaseClientConfig):
admin_base_url: list[str] | None = None
"""Separate base URLs for admin operations (weight updates, health checks). When set, admin clients bypass routers and hit each server directly — used in multi-replica or disaggregated P/D deployments where the router must not handle admin traffic."""
dynamo: DynamoConfig | None = None
"""Dynamo RL worker-discovery configuration."""
class VLLMClientConfig(ClientConfig):
"""Client defaults for the live inference deployment managed by training."""
@@ -234,6 +231,13 @@ class VLLMClientConfig(ClientConfig):
api_key_var: str = "VLLM_API_KEY"
class PolicyClientConfig(VLLMClientConfig):
"""Client of the policy deployment the orchestrator drives (weight updates, admin plane)."""
dynamo: DynamoConfig | None = None
"""Dynamo RL worker-discovery configuration."""
class LogConfig(BaseConfig):
level: str = Field(default_factory=lambda: os.environ.get("PRIME_LOG_LEVEL", "info"))
"""Log level for the process. Defaults to ``$PRIME_LOG_LEVEL`` if set, else ``info``."""
@@ -86,8 +86,8 @@ def propagate_shared_fields(data: Any) -> Any:
# ``orchestrator.ckpt`` has no ``output_dir`` field — trainer-only.
propagate("ckpt.output_dir", "trainer.ckpt.output_dir")
propagate("ckpt.interval", "trainer.ckpt.interval", "orchestrator.ckpt.interval")
propagate("ckpt.keep_last", "trainer.ckpt.keep_last", "orchestrator.ckpt.keep_last")
propagate("ckpt.keep_interval", "trainer.ckpt.keep_interval", "orchestrator.ckpt.keep_interval")
propagate("ckpt.keep_last", "trainer.ckpt.keep_last")
propagate("ckpt.keep_interval", "trainer.ckpt.keep_interval")
# [monitors.wandb] leaves. (Bare empty ``[monitors.wandb]`` block enablement is at the end.)
# ``monitors.wandb.name`` flows verbatim to both sub-configs — shared W&B mode is
+1 -1
View File
@@ -42,7 +42,7 @@ Incompatible combinations (e.g. CP requires flash attention) must raise in a `mo
**Sources are one block** — inside a `[[...source]]` entry, write nested sub-configs as dotted keys in the same block (`env.taskset.id = "..."`, `env.agent.harness.id = "..."`), not one subsection header per nested config. Nested arrays of tables (e.g. `[[orchestrator.train.source.env.taskset.task.judges]]`) keep full-path headers — they attach to the preceding `[[...source]]` entry.
**Booleans** — CLI `--flag` / `--no-flag`; TOML must be explicit (`enforce_eager = true`).
**Booleans** — CLI `--flag` / `--no-flag`; TOML must be explicit (`enable_prefix_caching = true`).
**None** — TOML has no null, use the string `"None"` (`max_model_len = "None"`); CLI: `--vllm.max-model-len None`.
+3 -3
View File
@@ -10,7 +10,7 @@ from typing import Literal
import httpx
from pydantic import BaseModel, Field
from prime_rl.configs.shared import ClientConfig
from prime_rl.configs.shared import ClientConfig, PolicyClientConfig
from prime_rl.orchestrator.clients import (
ADMIN_TIMEOUT_S,
UPDATE_WEIGHTS_TIMEOUT_S,
@@ -100,7 +100,7 @@ def _discovery_headers(client_config: ClientConfig) -> dict[str, str]:
return headers
def resolve_dynamo_discovery_url(client_config: ClientConfig) -> str:
def resolve_dynamo_discovery_url(client_config: PolicyClientConfig) -> str:
dynamo = client_config.dynamo
if dynamo is None or not dynamo.enabled:
raise ValueError("Dynamo discovery is not enabled")
@@ -156,7 +156,7 @@ class DynamoAdminPlane(AdminPlane):
def __init__(
self,
client_config: ClientConfig,
client_config: PolicyClientConfig,
model_name: str,
*,
poll_interval: float = 1.0,
+2 -2
View File
@@ -21,7 +21,7 @@ from verifiers.v1.configs.client import (
)
from prime_rl.configs.algorithm import FrozenModelConfig
from prime_rl.configs.shared import ClientConfig
from prime_rl.configs.shared import ClientConfig, PolicyClientConfig
from prime_rl.utils.logger import get_logger
@@ -209,7 +209,7 @@ class AdminPlane:
await client.aclose()
def setup_admin_plane(client_config: ClientConfig, model_name: str) -> AdminPlane:
def setup_admin_plane(client_config: PolicyClientConfig, model_name: str) -> AdminPlane:
dynamo = client_config.dynamo
if dynamo is not None and dynamo.enabled:
from prime_rl.inference.dynamo import DynamoAdminPlane
+7 -7
View File
@@ -3,7 +3,7 @@ from unittest.mock import AsyncMock, patch
import pytest
from prime_rl.configs.shared import ClientConfig
from prime_rl.configs.shared import PolicyClientConfig
from prime_rl.inference.dynamo import (
DynamoAdminPlane,
DynamoDiscoveryPending,
@@ -42,7 +42,7 @@ def parsed(*workers: dict):
def admin_for(*workers: dict) -> DynamoAdminPlane:
config = ClientConfig(
config = PolicyClientConfig(
base_url="http://worker:8000/v1",
skip_model_check=True,
wait_for_ready_timeout=2,
@@ -96,7 +96,7 @@ def test_dynamo_admin_plane_factory_pins_two_identical_snapshots():
discovered_worker = parsed(worker(1))
discover = AsyncMock(side_effect=[discovered_worker, discovered_worker])
admin = setup_admin_plane(
ClientConfig(
PolicyClientConfig(
base_url="http://worker:8000/v1",
skip_model_check=True,
wait_for_ready_timeout=2,
@@ -124,7 +124,7 @@ def test_dynamo_admin_plane_factory_pins_two_identical_snapshots():
def test_dynamo_worker_client_propagates_admin_headers(monkeypatch, api_key, authorization):
monkeypatch.setenv("DYNAMO_HEADER", "from-env")
monkeypatch.setenv("DYNAMO_API_KEY", api_key)
config = ClientConfig(
config = PolicyClientConfig(
base_url="http://worker:8000/v1",
headers={"X-Static": "static"},
headers_from_env={"X-Environment": "DYNAMO_HEADER"},
@@ -144,7 +144,7 @@ def test_dynamo_worker_client_propagates_admin_headers(monkeypatch, api_key, aut
def test_dynamo_admin_plane_derives_discovery_url_from_client_port():
admin = setup_admin_plane(
ClientConfig(
PolicyClientConfig(
base_url="http://worker:8000/v1",
dynamo={"enabled": True},
),
@@ -158,7 +158,7 @@ def test_dynamo_admin_plane_derives_discovery_url_from_client_port():
def test_dynamo_admin_plane_can_be_disabled():
admin = setup_admin_plane(
ClientConfig(
PolicyClientConfig(
base_url="http://worker:8000/v1",
dynamo={"enabled": False},
),
@@ -172,7 +172,7 @@ def test_dynamo_admin_plane_can_be_disabled():
def test_dynamo_discovery_url_derivation_requires_an_explicit_port():
with pytest.raises(ValueError, match="Set dynamo.discovery_url"):
setup_admin_plane(
ClientConfig(
PolicyClientConfig(
base_url="http://worker/v1",
dynamo={"enabled": True},
),