Files
prime-rl/configs/debug/rl/train.toml
T
c5afcaa2e2
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
feat: default ep to auto for MoE models (#2868)
* feat: default ep to "auto" for MoE models

ep now defaults to "auto" which resolves at trainer startup to the
largest valid EP degree up to 8. The resolution loads AutoConfig to
read num_experts, then picks the biggest divisor of num_experts that
also divides the FSDP island size (world_size // dp_replicate), is a
multiple of cp, and is <= 8. For non-MoE models, auto resolves to 1.

Changes:
- ModelConfig.ep type: int -> int | Literal["auto"], default "auto"
- Added resolve_ep() in parallel_dims.py, called before
  get_parallel_dims() in both rl/train.py and sft/train.py
- Fixed validators (validate_ep_comm_backend, ep_only_with_custom_impl)
  to handle the "auto" string without comparing to int
- get_parallel_dims() now asserts ep is resolved to int
- Updated docs/scaling.md and CHANGELOG.md

* fix: ruff format parallel_dims.py

* feat: enable memory-saving defaults (ac, ac_offloading, compile, optim_cpu_offload, chunk loss)

- model.ac: None -> ActivationCheckpointConfig() (full mode)
- model.ac_offloading: None -> ActivationOffloadingConfig()
- model.compile: None -> CompileConfig() (fullgraph=false)
- model.optim_cpu_offload: False -> True
- model.fused_lm_head_token_chunk_size: disabled -> 1024
- SFT silently disables fused_lm_head_token_chunk_size
- Multi-run CI config sets optim_cpu_offload=false
- Debug configs disable compile

* refactor: replace ep="auto" string with auto_ep boolean

- Replace ep: int | Literal["auto"] = "auto" with auto_ep: bool = True + ep: int = 1
- Update validators to check auto_ep instead of string comparisons
- Revert SFT changes to main (ep_only_with_custom_impl, sft/train.py)
- Keep SFT validate_and_disable_chunked_loss fix (silently disable)
- Remove isinstance assertion in get_parallel_dims (ep is always int now)
- Update docs and changelog

* fix: address review comments

- Rename resolve_ep to resolve_auto_ep (samsja)
- Add impl guard in resolve_auto_ep: skip EP for hf impl (bugbot)
- Add runtime check: raise if deepep resolves to ep=1 (bugbot)
- Revert configs/debug/moe/sft/train.toml to keep compile enabled (mika)

* fix: update benchmark baselines for memory-saving defaults

The new memory-saving defaults (ac, ac_offloading, compile, optim_cpu_offload,
fused_lm_head_token_chunk_size) reduce throughput. Update both 1-GPU and 4-GPU
baselines to the actual metrics from the CI run.

* refactor: replace auto_ep boolean with ep: int | Literal["auto"]

- Remove the auto_ep boolean field from ModelConfig
- Change ep type from int to int | Literal["auto"], default "auto"
- Rename resolve_auto_ep back to resolve_ep, check config.ep != "auto"
- Update validators to handle ep being a string (isinstance check)
- Add assertion in get_parallel_dims that ep is resolved to int
- Update docs/scaling.md and CHANGELOG.md

* fix(sft): handle ep="auto" in ep_only_with_custom_impl validator

The SFT validator used  which raises TypeError when ep is
"auto" (a str). Match the RL trainer's approach using != comparisons
to handle both int and str types.

* fix(sft): call resolve_ep before get_parallel_dims in SFT trainer

* Simplify resolve_ep: min(fsdp_island_size, 8) for MoE, 1 otherwise

Remove the magic auto-resolution that searched for the largest EP degree
satisfying num_experts divisibility, FSDP island divisibility, and cp
multiple constraints. Now just checks if the model is MoE and resolves
to min(fsdp_island_size, 8).

* docs(inference): document required NIXL/UCX from-source build for P/D disaggregation

---------

Co-authored-by: samsja <samsja@users.noreply.github.com>
2026-06-26 16:17:13 -07:00

9 lines
83 B
TOML

max_steps = 5
[data.fake]
batch_size = 2
[model]
seq_len = 1024
compile = "None"