Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d91edc9e6 | ||
|
|
2c5c69da8b | ||
|
|
5f0dcc8a1b | ||
|
|
8ea7bd4834 | ||
|
|
302ef6d084 | ||
|
|
89a5343780 | ||
|
|
22f0ae7640 | ||
|
|
f0746566e9 | ||
|
|
99c02bba6c | ||
|
|
ebb5a1cac2 | ||
|
|
d19ce7919f | ||
|
|
e2175c11ae |
@@ -3,6 +3,7 @@
|
||||
Documenting changes which affect configuration usage patterns (added/moved/removed/renamed fields, notable logic changes).
|
||||
|
||||
- **`orchestrator.verification.enabled`**: Added top-level rollout verification switch. `orchestrator.buffer.skip_verification` has been removed; use `verification.enabled = false` instead. When disabled, rewards are always 0 and reward-dependent buffer features (`online_difficulty_filtering`, `easy_threshold`, `hard_threshold`) must be unset (2026-03-03)
|
||||
- **`client.dp_rank_count`**: Added configuration for data-parallel inference routing. When > 1, each `client.base_url` is expanded into `dp_rank_count` logical clients and pinned via `X-data-parallel-rank` to keep multi-turn rollouts on a consistent DP rank (default: 1) (2026-03-03)
|
||||
- **`model.lora`**: Moved from `model.experimental.lora` to `model.lora` (no longer experimental) (#1440, 2025-12-16)
|
||||
- Auto-set `api_server_count=1` on inference when LoRA is enabled, because vLLM doesn't support hotloading for multiple API servers (#1422, 2025-12-17)
|
||||
- **`inference.model.rope_scaling`**: Added RoPE scaling configuration passthrough to vLLM (#1447 2025-12-17)
|
||||
|
||||
+5
-7
@@ -19,7 +19,7 @@ dependencies = [
|
||||
"torch>=2.9.0",
|
||||
"torchdata>=0.11.0",
|
||||
"transformers",
|
||||
"vllm>=0.16.1.dev",
|
||||
"vllm>=0.17.0",
|
||||
"wandb>=0.24.2",
|
||||
"ring-flash-attn>=0.1.8",
|
||||
"prime>=0.5.37",
|
||||
@@ -75,6 +75,10 @@ dev = [
|
||||
[tool.uv]
|
||||
preview = true
|
||||
no-build-isolation-package = ["flash-attn"]
|
||||
environments = [
|
||||
"sys_platform == 'linux' and platform_machine == 'x86_64'",
|
||||
"sys_platform == 'linux' and platform_machine == 'aarch64'",
|
||||
]
|
||||
# Override torch's pinned cuDNN to fix Conv3d performance regression (torch 2.9 + cuDNN 9.8-9.14)
|
||||
# See: https://github.com/pytorch/pytorch/issues/166122
|
||||
override-dependencies = [
|
||||
@@ -86,7 +90,6 @@ override-dependencies = [
|
||||
|
||||
[tool.uv.sources]
|
||||
torch = { index = "pytorch-cu128" }
|
||||
vllm = { url = "https://wheels.vllm.ai/097eb544e9a22810c9b7a59e586b61627b308362/vllm-0.17.0rc0-cp38-abi3-manylinux_2_31_x86_64.whl" }
|
||||
math-env = { index = "primeintellect" }
|
||||
verifiers = { git = "https://github.com/PrimeIntellect-ai/verifiers.git", rev = "45fae8d" }
|
||||
torchtitan = { git = "https://github.com/pytorch/torchtitan", rev = "a1fdd7e" }
|
||||
@@ -112,11 +115,6 @@ name = "pytorch-cu128"
|
||||
url = "https://download.pytorch.org/whl/cu128"
|
||||
explicit = true
|
||||
|
||||
[[tool.uv.index]]
|
||||
name = "vllm-nightly"
|
||||
url = "https://wheels.vllm.ai/nightly"
|
||||
explicit = true
|
||||
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["F", "I"]
|
||||
|
||||
@@ -3,12 +3,18 @@
|
||||
set -e
|
||||
|
||||
echo "=== building flash-attn from source (sm_100 / GB200) ==="
|
||||
TORCH_CUDA_ARCH_LIST="10.0" MAX_JOBS=4 \
|
||||
uv pip install "flash-attn==2.8.3" --no-build-isolation
|
||||
# Run from /tmp so uv doesn't read pyproject.toml's [tool.uv.extra-build-variables]
|
||||
# which sets FLASH_ATTENTION_SKIP_CUDA_BUILD=TRUE and prevents CUDA kernel compilation.
|
||||
export TORCH_CUDA_ARCH_LIST="10.0"
|
||||
export MAX_JOBS=4
|
||||
export FLASH_ATTENTION_FORCE_BUILD=TRUE
|
||||
export FLASH_ATTENTION_SKIP_CUDA_BUILD=FALSE
|
||||
(cd /tmp && uv pip install --python /app/.venv/bin/python \
|
||||
"flash-attn==2.8.3" --no-build-isolation --no-binary flash-attn --no-cache)
|
||||
|
||||
echo "=== reinstalling flash-attn-cute (flash-attn overwrites it with a stub) ==="
|
||||
uv pip install --reinstall --no-deps \
|
||||
"flash-attn-cute @ git+https://github.com/Dao-AILab/flash-attention.git@e2743ab5#subdirectory=flash_attn/cute"
|
||||
"flash-attn-cute @ git+https://github.com/Dao-AILab/flash-attention.git@2b5db43#subdirectory=flash_attn/cute"
|
||||
|
||||
# TODO: remove once flash-attn gates the ampere_helpers import or cutlass-dsl re-adds it.
|
||||
echo "=== copying ampere_helpers.py from flashinfer vendor ==="
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
set -e
|
||||
|
||||
echo "Reinstalling flash-attn-cute to fix namespace conflict with flash-attn..."
|
||||
uv pip install --reinstall --no-deps "flash-attn-cute @ git+https://github.com/Dao-AILab/flash-attention.git@e2743ab5#subdirectory=flash_attn/cute"
|
||||
uv pip install --reinstall --no-deps "flash-attn-cute @ git+https://github.com/Dao-AILab/flash-attention.git@2b5db43#subdirectory=flash_attn/cute"
|
||||
|
||||
# Verify installation
|
||||
LINES=$(wc -l < "$(python -c 'import flash_attn.cute.interface as m; print(m.__file__)')")
|
||||
|
||||
@@ -939,7 +939,7 @@ class OrchestratorConfig(BaseConfig):
|
||||
@model_validator(mode="after")
|
||||
def resolve_extra_env_kwargs(self):
|
||||
train_extra_env_kwargs = dict(
|
||||
seq_len=self.seq_len,
|
||||
max_seq_len=self.seq_len,
|
||||
score_rollouts=self.verification.enabled,
|
||||
)
|
||||
for env in self.env:
|
||||
|
||||
+18
-18
@@ -1,4 +1,3 @@
|
||||
import warnings
|
||||
from pathlib import Path
|
||||
from typing import Annotated, Literal, TypeAlias
|
||||
|
||||
@@ -38,6 +37,7 @@ 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.validation import (
|
||||
validate_shared_ckpt_config,
|
||||
validate_shared_max_async_level,
|
||||
@@ -560,7 +560,7 @@ class RLConfig(BaseConfig):
|
||||
self.inference.enable_lora = True
|
||||
self.inference.max_lora_rank = self.trainer.model.lora.rank
|
||||
else:
|
||||
warnings.warn(
|
||||
get_logger().warning(
|
||||
"LoRA is enabled, but inference is not configured. When manually starting the inference server, "
|
||||
"make sure to set --enable_lora and --max-lora-rank."
|
||||
)
|
||||
@@ -572,12 +572,12 @@ class RLConfig(BaseConfig):
|
||||
if self.trainer.enable_router_replay:
|
||||
if self.inference is not None:
|
||||
if self.inference.enable_return_routed_experts is False:
|
||||
warnings.warn(
|
||||
get_logger().warning(
|
||||
"Router replay is enabled, but inference.enable_return_routed_experts is False. Setting to True."
|
||||
)
|
||||
self.inference.enable_return_routed_experts = True
|
||||
else:
|
||||
warnings.warn(
|
||||
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."
|
||||
)
|
||||
return self
|
||||
@@ -649,6 +649,20 @@ class RLConfig(BaseConfig):
|
||||
|
||||
return self
|
||||
|
||||
@model_validator(mode="after")
|
||||
def auto_setup_dp_rank_count(self):
|
||||
"""Auto-set orchestrator client dp_rank_count from inference DP size.
|
||||
|
||||
Uses data_parallel_size_local (per-node DP) when set, since each base URL
|
||||
points to a single node whose API server only knows about its local ranks.
|
||||
Falls back to the global parallel.dp for single-node setups.
|
||||
"""
|
||||
if self.inference is not None and "dp_rank_count" not in self.orchestrator.client.model_fields_set:
|
||||
self.orchestrator.client.dp_rank_count = (
|
||||
self.inference.data_parallel_size_local or self.inference.parallel.dp
|
||||
)
|
||||
return self
|
||||
|
||||
@model_validator(mode="after")
|
||||
def auto_setup_teacher_inference(self):
|
||||
"""Auto-configure teacher inference server and orchestrator teacher_model client."""
|
||||
@@ -704,17 +718,3 @@ class RLConfig(BaseConfig):
|
||||
return self
|
||||
|
||||
### Warnings
|
||||
|
||||
@model_validator(mode="after")
|
||||
def warn_wandb_resume_id_missing(self):
|
||||
if self.trainer.ckpt is not None and self.trainer.ckpt.resume_step is not None:
|
||||
if self.trainer.wandb and not self.trainer.wandb.id:
|
||||
warnings.warn(
|
||||
"W&B run ID is not set for trainer even though resuming training. The current run will be created as a new run."
|
||||
)
|
||||
if self.orchestrator.ckpt is not None and self.orchestrator.ckpt.resume_step is not None:
|
||||
if self.orchestrator.wandb and not self.orchestrator.wandb.id:
|
||||
warnings.warn(
|
||||
"W&B run ID is not set for orchestrator even though resuming training. The current run will be created as a new run."
|
||||
)
|
||||
return self
|
||||
|
||||
@@ -122,6 +122,22 @@ class ClientConfig(BaseConfig):
|
||||
),
|
||||
] = False
|
||||
|
||||
dp_rank_count: Annotated[
|
||||
int,
|
||||
Field(
|
||||
ge=1,
|
||||
description=(
|
||||
"Number of data-parallel ranks behind each base URL. When > 1, "
|
||||
"each URL is expanded into dp_rank_count logical clients, each "
|
||||
"pinned to a specific DP rank via the X-data-parallel-rank header. "
|
||||
"This ensures all requests within a multi-turn rollout hit the same "
|
||||
"DP engine, maximizing KV cache reuse. Auto-set from "
|
||||
"inference.data_parallel_size_local (or inference.parallel.dp) "
|
||||
"when using the RL entrypoint."
|
||||
),
|
||||
),
|
||||
] = 1
|
||||
|
||||
elastic: Annotated[
|
||||
ElasticConfig | None,
|
||||
Field(
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import warnings
|
||||
from pathlib import Path
|
||||
from typing import Annotated, Any, Literal, TypeAlias
|
||||
|
||||
@@ -14,6 +13,7 @@ from prime_rl.configs.shared import (
|
||||
WandbConfig,
|
||||
)
|
||||
from prime_rl.utils.config import BaseConfig
|
||||
from prime_rl.utils.logger import get_logger
|
||||
|
||||
# -- Shared trainer configs (used by both SFT and RL trainers) --
|
||||
|
||||
@@ -333,7 +333,7 @@ class ModelConfig(BaseModelConfig):
|
||||
f"Fused LM head chunk size must be at least {low}, got {self.fused_lm_head_chunk_size}"
|
||||
)
|
||||
if self.fused_lm_head_chunk_size < warn_threshold:
|
||||
warnings.warn(
|
||||
get_logger().warning(
|
||||
f"Fused LM head chunk size is set to {self.fused_lm_head_chunk_size}, which is less than the recommended threshold of {warn_threshold}. This may cause some runs to diverge due to numerical instability in floating point arithmetic."
|
||||
)
|
||||
|
||||
|
||||
@@ -406,6 +406,7 @@ def write_slurm_script(config: RLConfig, config_dir: Path, script_path: Path) ->
|
||||
inference_tp=config.inference.parallel.tp,
|
||||
inference_enable_expert_parallel=config.inference.enable_expert_parallel,
|
||||
inference_data_parallel_rpc_port=config.inference.data_parallel_rpc_port,
|
||||
use_nccl_broadcast=config.weight_broadcast is not None and config.weight_broadcast.type == "nccl",
|
||||
)
|
||||
|
||||
script_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
import gc
|
||||
import multiprocessing as mp
|
||||
import random
|
||||
import time
|
||||
@@ -789,6 +790,11 @@ async def orchestrate(config: OrchestratorConfig):
|
||||
progress.step += 1
|
||||
is_first_step = False
|
||||
|
||||
# Free large per-step objects to prevent memory accumulation
|
||||
del train_rollouts, train_examples, training_batch, vlm_cache
|
||||
del results_df, metrics_df, val_results_df
|
||||
gc.collect()
|
||||
|
||||
event_loop_lag_monitor.reset()
|
||||
|
||||
# Send heartbeat if configured
|
||||
|
||||
@@ -40,6 +40,7 @@ class GroupState:
|
||||
example: dict
|
||||
rollouts_to_schedule: int
|
||||
completed_rollouts: list[vf.RolloutOutput] = field(default_factory=list)
|
||||
pinned_client: vf.ClientConfig | None = None
|
||||
|
||||
|
||||
class Scheduler:
|
||||
@@ -145,16 +146,22 @@ class Scheduler:
|
||||
self.groups.clear()
|
||||
self.cancelled_rollouts_count += count
|
||||
|
||||
@staticmethod
|
||||
def _client_identity(c: vf.ClientConfig) -> tuple[str, str | None]:
|
||||
return (c.api_base_url, c.extra_headers.get("X-data-parallel-rank"))
|
||||
|
||||
async def _select_least_loaded_client(self) -> vf.ClientConfig:
|
||||
"""Select the client with the fewest in-flight tasks."""
|
||||
"""Select the client with the fewest in-flight tasks.
|
||||
|
||||
Uses (api_base_url, dp_rank) as identity rather than client_idx so that
|
||||
load tracking survives elastic pool refreshes (which reassign indices).
|
||||
"""
|
||||
clients = self.inference_pool.clients
|
||||
while not clients:
|
||||
await asyncio.sleep(1)
|
||||
clients = self.inference_pool.clients
|
||||
inflight_by_url = Counter()
|
||||
for info in self.inflight_requests.values():
|
||||
inflight_by_url[info.client_config.api_base_url] += 1
|
||||
return min(clients, key=lambda c: inflight_by_url[c.api_base_url])
|
||||
inflight = Counter(self._client_identity(info.client_config) for info in self.inflight_requests.values())
|
||||
return min(clients, key=lambda c: inflight[self._client_identity(c)])
|
||||
|
||||
async def drop_group(self, group_id: int) -> int:
|
||||
"""Drop a group and cancel any remaining in-flight rollouts for it."""
|
||||
@@ -176,9 +183,13 @@ class Scheduler:
|
||||
if group is None or group.rollouts_to_schedule <= 0:
|
||||
return
|
||||
group.rollouts_to_schedule -= 1
|
||||
client_config = await self._select_least_loaded_client()
|
||||
if group_id not in self.groups:
|
||||
return
|
||||
if group.pinned_client is not None:
|
||||
client_config = group.pinned_client
|
||||
else:
|
||||
client_config = await self._select_least_loaded_client()
|
||||
if group_id not in self.groups:
|
||||
return
|
||||
group.pinned_client = client_config
|
||||
run_rollout_task = asyncio.create_task(
|
||||
run_rollout(
|
||||
env=self.env,
|
||||
|
||||
@@ -229,6 +229,29 @@ def _decode_b64_image(b64_data: str) -> Image.Image:
|
||||
_PARALLEL_DECODE_THRESHOLD = 4
|
||||
|
||||
|
||||
_IMAGE_STRIPPED_PLACEHOLDER = "[preprocessed image]"
|
||||
|
||||
|
||||
def strip_base64_images(examples: list[tuple[int, vf.RolloutOutput]]) -> None:
|
||||
"""Strip base64 image data from rollout prompts to free memory.
|
||||
|
||||
The images have been decoded and indexed; the original data is no longer needed.
|
||||
"""
|
||||
for _, output in examples:
|
||||
for step in output.get("trajectory", []):
|
||||
prompt = step.get("prompt")
|
||||
if not prompt or not isinstance(prompt, list):
|
||||
continue
|
||||
for msg in prompt:
|
||||
content = msg.get("content", [])
|
||||
if isinstance(content, list):
|
||||
for item in content:
|
||||
if item.get("type") == "image_url":
|
||||
url = item.get("image_url", {}).get("url", "")
|
||||
if url.startswith("data:image"):
|
||||
item["image_url"]["url"] = _IMAGE_STRIPPED_PLACEHOLDER
|
||||
|
||||
|
||||
def _extract_images_from_examples(
|
||||
examples: list[tuple[int, vf.RolloutOutput]],
|
||||
) -> tuple[list[Image.Image], dict[int, list[list[int]]]]:
|
||||
@@ -279,6 +302,9 @@ def _extract_images_from_examples(
|
||||
all_images = list(pool.map(_decode_b64_image, unique_keys))
|
||||
else:
|
||||
all_images = [_decode_b64_image(k) for k in unique_keys]
|
||||
del unique_keys, key_to_index
|
||||
|
||||
strip_base64_images(examples)
|
||||
|
||||
return all_images, step_image_indices_per_example
|
||||
|
||||
@@ -363,14 +389,19 @@ def _preprocess_images_batched(
|
||||
else:
|
||||
results = [_process_chunk(chunks[0])]
|
||||
|
||||
# Free PIL images now that preprocessing is done
|
||||
del chunks
|
||||
images.clear()
|
||||
|
||||
all_pixel_values_list = [r[0] for r in results]
|
||||
all_grid_thw_list = [r[1] for r in results]
|
||||
|
||||
all_pixel_values = torch.cat(all_pixel_values_list, dim=0)
|
||||
all_grid_thw = torch.cat(all_grid_thw_list, dim=0)
|
||||
del all_pixel_values_list, all_grid_thw_list, results
|
||||
|
||||
logger.debug(
|
||||
f"VLM image processing: {len(images)} images, sizes={image_sizes}, "
|
||||
f"VLM image processing: {len(image_sizes)} images, sizes={image_sizes}, "
|
||||
f"pixel_values={all_pixel_values.shape}, grid_thw={all_grid_thw.tolist()}"
|
||||
)
|
||||
|
||||
@@ -381,15 +412,16 @@ def _preprocess_images_batched(
|
||||
|
||||
patch_dim = all_pixel_values.shape[1]
|
||||
|
||||
# Store per-image bytes once
|
||||
# Convert to bytes per-image and free the tensor immediately after
|
||||
image_bytes_list: list[bytes] = []
|
||||
image_num_patches_list: list[int] = []
|
||||
image_grids_list: list[list[int]] = []
|
||||
for i in range(len(images)):
|
||||
for i in range(len(image_sizes)):
|
||||
img_slice = all_pixel_values[patch_starts[i] : patch_starts[i + 1]]
|
||||
image_bytes_list.append(img_slice.numpy().tobytes())
|
||||
image_num_patches_list.append(img_slice.shape[0])
|
||||
image_grids_list.append(all_grid_thw[i].tolist())
|
||||
del all_pixel_values, all_grid_thw
|
||||
|
||||
store = _ImageStore(
|
||||
image_bytes=image_bytes_list,
|
||||
@@ -483,12 +515,13 @@ def build_vlm_image_cache(rollouts: list[vf.RolloutOutput], processor) -> VLMIma
|
||||
examples = [(idx, rollout) for idx, rollout in enumerate(rollouts)]
|
||||
unique_example_ids = {rollout["example_id"] for rollout in rollouts}
|
||||
|
||||
# Extract images
|
||||
# Extract images (also strips base64 data from rollout prompts to free memory)
|
||||
extract_start = time.perf_counter()
|
||||
all_images, images_per_example = _extract_images_from_examples(examples)
|
||||
num_unique_images = len(all_images)
|
||||
extract_time = time.perf_counter() - extract_start
|
||||
|
||||
# Preprocess images
|
||||
# Preprocess images (clears PIL image list when done)
|
||||
preprocess_start = time.perf_counter()
|
||||
store, step_indices = _preprocess_images_batched(all_images, images_per_example, processor)
|
||||
preprocess_time = time.perf_counter() - preprocess_start
|
||||
@@ -497,7 +530,7 @@ def build_vlm_image_cache(rollouts: list[vf.RolloutOutput], processor) -> VLMIma
|
||||
store=store,
|
||||
step_indices=step_indices,
|
||||
num_unique_examples=len(unique_example_ids),
|
||||
num_unique_images=len(all_images),
|
||||
num_unique_images=num_unique_images,
|
||||
extract_time=extract_time,
|
||||
preprocess_time=preprocess_time,
|
||||
)
|
||||
|
||||
@@ -128,10 +128,10 @@ else
|
||||
TRAIN_NODE_RANK=$((SLURM_PROCID - NUM_INFER_NODES))
|
||||
|
||||
if [ "$TRAIN_NODE_RANK" -eq 0 ]; then
|
||||
uv run orchestrator \
|
||||
@ $CONFIG_DIR/orchestrator.toml \
|
||||
--weight_broadcast.host $MASTER_ADDR \
|
||||
--client.base-url $INFER_URLS \
|
||||
ORCHESTRATOR_ARGS="@ $CONFIG_DIR/orchestrator.toml"
|
||||
ORCHESTRATOR_ARGS="$ORCHESTRATOR_ARGS --client.base-url $INFER_URLS"
|
||||
{% if use_nccl_broadcast %}ORCHESTRATOR_ARGS="$ORCHESTRATOR_ARGS --weight_broadcast.host $MASTER_ADDR"
|
||||
{% endif %}uv run orchestrator $ORCHESTRATOR_ARGS \
|
||||
2>&1 | tee $OUTPUT_DIR/slurm/latest_orchestrator.log $OUTPUT_DIR/slurm/job_${SLURM_JOB_ID}_orchestrator.log &
|
||||
fi
|
||||
|
||||
|
||||
@@ -109,6 +109,7 @@ async def setup_inference_pool(
|
||||
|
||||
logger.info(
|
||||
f"Initializing static inference pool (base_url={', '.join(client_config.base_url)}, "
|
||||
f"dp_rank_count={client_config.dp_rank_count}, "
|
||||
f"api_key_var={client_config.api_key_var}, headers={client_config.headers})"
|
||||
)
|
||||
return StaticInferencePool(
|
||||
@@ -119,20 +120,28 @@ async def setup_inference_pool(
|
||||
|
||||
|
||||
def setup_clients(client_config: ClientConfig, client_type: str = "openai_chat_completions") -> list[vf.ClientConfig]:
|
||||
def setup_client(client_idx: int, base_url: str) -> vf.ClientConfig:
|
||||
return vf.ClientConfig(
|
||||
client_idx=client_idx,
|
||||
client_type=client_type,
|
||||
api_base_url=base_url,
|
||||
api_key_var=client_config.api_key_var,
|
||||
timeout=client_config.timeout,
|
||||
max_connections=8192,
|
||||
max_keepalive_connections=8192,
|
||||
max_retries=10,
|
||||
extra_headers=client_config.headers,
|
||||
)
|
||||
|
||||
return [setup_client(client_idx, base_url) for client_idx, base_url in enumerate(client_config.base_url)]
|
||||
clients = []
|
||||
client_idx = 0
|
||||
for base_url in client_config.base_url:
|
||||
for dp_rank in range(client_config.dp_rank_count):
|
||||
headers = client_config.headers.copy()
|
||||
if client_config.dp_rank_count > 1:
|
||||
headers["X-data-parallel-rank"] = str(dp_rank)
|
||||
clients.append(
|
||||
vf.ClientConfig(
|
||||
client_idx=client_idx,
|
||||
client_type=client_type,
|
||||
api_base_url=base_url,
|
||||
api_key_var=client_config.api_key_var,
|
||||
timeout=client_config.timeout,
|
||||
max_connections=8192,
|
||||
max_keepalive_connections=8192,
|
||||
max_retries=10,
|
||||
extra_headers=headers,
|
||||
)
|
||||
)
|
||||
client_idx += 1
|
||||
return clients
|
||||
|
||||
|
||||
def setup_admin_clients(client_config: ClientConfig) -> list[AsyncClient]:
|
||||
|
||||
@@ -173,6 +173,7 @@ class ElasticInferencePool:
|
||||
base_url=urls,
|
||||
api_key_var=self.client_config.api_key_var,
|
||||
headers=self.client_config.headers,
|
||||
dp_rank_count=self.client_config.dp_rank_count,
|
||||
),
|
||||
client_type=self.client_type,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user