Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8493109b7d | ||
|
|
c9ce5f3d30 | ||
|
|
9570bccc28 |
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -98,7 +98,6 @@ type = "fp8"
|
||||
type = "deepgemm_fp8"
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.compile]
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ project = "alphabet-sort"
|
||||
name = "alphabet-sort"
|
||||
|
||||
[trainer.model.ac]
|
||||
freq = 1
|
||||
|
||||
[trainer.model.lora]
|
||||
rank = 32
|
||||
|
||||
@@ -38,8 +38,6 @@ group_size = 16
|
||||
[orchestrator.concurrency]
|
||||
initial_inflight = 1024
|
||||
|
||||
[orchestrator.model.lora]
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
max_completion_tokens = 512
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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`.
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user