Feat: set default to 8192 (#1892)
Release / Push CUDA image to Docker (push) Canceled after 0s
Release / Push CUDA image to Docker (push) Canceled after 0s
This commit is contained in:
@@ -82,3 +82,4 @@ Documenting changes which affect configuration usage patterns (added/moved/remov
|
||||
- **`clean`**: Removed from `RLConfig`. The old `clean` flag (default: `True`) silently deleted logs, rollouts, and broadcasts on every local RL run. Superseded by the explicit `clean_output_dir` flag (2026-02-24)
|
||||
- **Config consolidation**: All config modules moved into `prime_rl.configs` subpackage. `utils/config.py` + `transport/config.py` → `configs/shared.py`; `trainer/config.py` + `trainer/rl/config.py` → `configs/trainer.py`; `trainer/sft/config.py` → `configs/sft.py`; `orchestrator/config.py` → `configs/orchestrator.py`; `inference/config.py` → `configs/inference.py`; `rl_config.py` → `configs/rl.py`. Class renames: `SFTTrainerConfig` → `SFTConfig`, `RLTrainerConfig` → `TrainerConfig`. Component prefixes dropped from orchestrator and inference config classes (e.g. `OrchestratorCheckpointConfig` → `CheckpointConfig`). TypeAlias renames: dropped `Type` suffix (e.g. `LossConfigType` → `LossConfig`, `TransportConfigType` → `TransportConfig`), renamed `LossConfig` class → `DefaultLossConfig`. No TOML key changes. (2026-02-24)
|
||||
- **`orchestrator.oversampling_factor`**: Added rollout-only over-sampling config that resolves `max_inflight_rollouts = int(batch_size * oversampling_factor)` when `max_inflight_rollouts` is unset. Cannot be used with `token_batch_size` or together with explicit `max_inflight_rollouts` (2026-02-25)
|
||||
- **`model.fused_lm_head_chunk_size`**: Changed default value from 2048 to 8192 for RL training (2026-02-26)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import warnings
|
||||
from pathlib import Path
|
||||
from typing import Annotated, Any, Literal, TypeAlias
|
||||
|
||||
@@ -275,7 +276,7 @@ class ModelConfig(BaseModelConfig):
|
||||
"The chunk size to use for the fused LM head. "
|
||||
"Three behaviors: "
|
||||
"(1) int >= 512: explicitly set chunk size for fused LM head; "
|
||||
"(2) 'auto': auto-enable (RL training auto-sets to 2048); "
|
||||
"(2) 'auto': auto-enable (RL training auto-sets to 8192); "
|
||||
"(3) 'disabled': explicitly disable fused LM head (use vanilla). "
|
||||
"Explicitly setting an integer value for this feature isn't supported for SFT training."
|
||||
),
|
||||
@@ -326,10 +327,16 @@ class ModelConfig(BaseModelConfig):
|
||||
def fused_lm_head_chunk_size_is_valid(self):
|
||||
if isinstance(self.fused_lm_head_chunk_size, int):
|
||||
low = 512
|
||||
warn_threshold = 8192
|
||||
if self.fused_lm_head_chunk_size < low:
|
||||
raise ValueError(
|
||||
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(
|
||||
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."
|
||||
)
|
||||
|
||||
return self
|
||||
|
||||
@model_validator(mode="after")
|
||||
@@ -798,7 +805,7 @@ class TrainerConfig(BaseSettings):
|
||||
@model_validator(mode="after")
|
||||
def auto_setup_fused_lm_head_chunk_size(self):
|
||||
if self.model.fused_lm_head_chunk_size == "auto":
|
||||
self.model.fused_lm_head_chunk_size = 2048
|
||||
self.model.fused_lm_head_chunk_size = 8192
|
||||
|
||||
return self
|
||||
|
||||
|
||||
Reference in New Issue
Block a user