Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ The trainer runs the PrimeRL model implementations under `src/prime_rl/trainer/m
| Nemotron H (`nemotron_h`) | `nvidia/Nemotron-3-Nano-30B-A3B`, `nvidia/Nemotron-3-Super-120B-A12B`, … | yes | ✅ | ✅ |
| Trinity (`afmoe`) | `arcee-ai/Trinity-Mini`, … | yes | ✅ | ✅ |
| GLM-4 · GLM-4.5 MoE · INTELLECT-3 (`glm4_moe`) | `THUDM/GLM-4-9B-0414`, `zai-org/GLM-4.5-Air`, `zai-org/GLM-4.5`, `PrimeIntellect/INTELLECT-3`, … | yes | ✅ | ✅ |
| GPT-OSS (`gpt_oss`) | `unsloth/gpt-oss-20b-BF16`, … | yes | ✅ | ✅ |

## Setup

Expand Down
6 changes: 1 addition & 5 deletions docs/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ The trainer only runs `prime-rl`'s own model implementations, selected from the
| Nemotron H | `nvidia/Nemotron-3-Nano-30B-A3B`, … | ✅ | ❌ |
| Trinity (AFMoE) | `arcee-ai/Trinity-Mini`, … | ✅ | ✅ |
| GLM-4 / GLM-4.5 / INTELLECT-3 | `THUDM/GLM-4-9B-0414`, `zai-org/GLM-4.5`, `PrimeIntellect/INTELLECT-3`, … | ✅ | ✅ |
| GPT-OSS | `unsloth/gpt-oss-20b-BF16`, … | ✅ | ✅ |
| DeepSeek V4 | `deepseek-ai/DeepSeek-V4-Flash-0731` | ✅ | ✅ |

GPT-OSS uses FlashAttention 4 with learned attention sinks. Training requires SM90 or SM100/SM110 GPUs
and a BF16 checkpoint such as `unsloth/gpt-oss-20b-BF16`; the original MXFP4 checkpoints are not supported.

### Low-precision training

Dense linear precision and routed-expert precision are configured independently. `[trainer.model.quantization]` applies only to dense `Linear` modules:
Expand All @@ -48,7 +44,7 @@ Dense linear precision and routed-expert precision are configured independently.
- `type = "deepgemm_fp8"` (requires DeepGEMM and SM90+)
- `type = "mxfp8"` (requires `prime-kernels`, torchao, and SM100)

SonicMoE uses the upstream `sonic-moe` package (`uv sync --extra sonic-moe`) for fused BF16 expert computation. The supported model is Qwen3 MoE with the `gate_up` model fusion enabled. Backend selection requires fused gate/up weights, standard SwiGLU, and bias-free experts; incompatible expert structures raise an error during setup. It uses the same router and local, torch EP, or DeepEP dispatch as other compute backends:
SonicMoE uses the upstream `sonic-moe` package (`uv sync --extra sonic-moe`) for fused BF16 expert computation. The supported model is Qwen3 MoE with the `gate_up` model fusion enabled. Backend selection requires fused gate/up weights and standard SwiGLU; incompatible expert structures raise an error during setup. It uses the same router and local, torch EP, or DeepEP dispatch as other compute backends:

```toml
[trainer.model]
Expand Down
2 changes: 0 additions & 2 deletions packages/prime-rl-configs/src/prime_rl/utils/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
(re.compile(r"^zai-org/GLM-4\.7"), "glm47"),
(re.compile(r"^zai-org/GLM-5"), "glm47"),
(re.compile(r"^MiniMaxAI/MiniMax-M2"), "minimax_m2"),
(re.compile(r"^openai/gpt-oss"), "openai"),
(re.compile(r"^poolside/Laguna"), "poolside_v1"),
(re.compile(r"^PrimeIntellect/INTELLECT-3"), "qwen3_coder"),
(re.compile(r"^nvidia/NVIDIA-Nemotron-3"), "qwen3_coder"),
Expand All @@ -32,7 +31,6 @@
(re.compile(r"^deepseek-ai/DeepSeek-V3\.[12]"), "deepseek_r1"),
(re.compile(r"^zai-org/GLM-"), "glm45"),
(re.compile(r"^MiniMaxAI/MiniMax-M2"), "minimax_m2_append_think"),
# openai/gpt-oss has no entry here — vLLM's harmony serving path splits reasoning natively.
(re.compile(r"^poolside/Laguna"), "poolside_v1"),
(re.compile(r"^PrimeIntellect/INTELLECT-3"), "deepseek_r1"),
(re.compile(r"^nvidia/NVIDIA-Nemotron-3-Super"), "nemotron_v3"),
Expand Down
2 changes: 0 additions & 2 deletions src/prime_rl/inference/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ def apply_shared_vllm_patches():
vLLM swallows plugin load failures (``load_plugins_by_group`` logs and continues), so a broken
entry-point target silently skips ALL of these patches.
"""
from prime_rl.inference.vllm.gpt_oss_weight_loading import patch_gpt_oss_weight_loading
from prime_rl.inference.vllm.qwen38_weight_loading import patch_qwen38_weight_loading

patch_gpt_oss_weight_loading()
patch_qwen38_weight_loading()
_patch_lora_key_prefix()
_patch_qwen35_moe_lora_format()
Expand Down
145 changes: 0 additions & 145 deletions src/prime_rl/inference/vllm/gpt_oss_weight_loading.py

This file was deleted.

8 changes: 1 addition & 7 deletions src/prime_rl/trainer/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
set_multilora_scaling,
)
from prime_rl.trainer.models.layers.lora.multi_moe import (
MultiLoRAGptOssGroupedExperts,
MultiLoRAGroupedExperts,
MultiLoRANonGatedGroupedExperts,
)
Expand Down Expand Up @@ -224,9 +223,6 @@ def apply_lora_to_model(model: nn.Module, config: LoRAConfig) -> None:
lora_state = setup_lora_state(config, torch.device("cuda", get_world().local_rank))
if isinstance(model, PreTrainedModelPrimeRL):
lora_state.register_adapter_state_dict_converter(type(model).convert_adapter_to_hf)
uses_gpt_oss_moe_adapter = (
isinstance(model, PreTrainedModelPrimeRL) and getattr(model.config, "model_type", None) == "gpt_oss"
)

from torch.distributed.fsdp import FSDPModule

Expand Down Expand Up @@ -259,9 +255,7 @@ def apply_lora_to_model(model: nn.Module, config: LoRAConfig) -> None:
)
# Handle GroupedExperts (MoE)
elif isinstance(base_module, GroupedExperts):
if uses_gpt_oss_moe_adapter:
wrapper = MultiLoRAGptOssGroupedExperts
elif base_module.gate_proj is not None:
if base_module.gate_proj is not None:
wrapper = MultiLoRAGroupedExperts
else:
wrapper = MultiLoRANonGatedGroupedExperts
Expand Down
3 changes: 0 additions & 3 deletions src/prime_rl/trainer/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from prime_rl.trainer.models.deepseek_v4 import DeepseekV4Config, DeepseekV4ForCausalLM
from prime_rl.trainer.models.glm4_moe import Glm4MoeConfig, Glm4MoeForCausalLM
from prime_rl.trainer.models.glm_moe_dsa import GlmMoeDsaConfig, GlmMoeDsaForCausalLM
from prime_rl.trainer.models.gpt_oss import GptOssConfig, GptOssForCausalLM
from prime_rl.trainer.models.laguna import LagunaConfig, LagunaForCausalLM
from prime_rl.trainer.models.layers.lm_head import PrimeLmOutput, cast_float_and_contiguous
from prime_rl.trainer.models.llama import LlamaForCausalLM
Expand All @@ -41,7 +40,6 @@
AutoConfig.register("deepseek_v4", DeepseekV4Config, exist_ok=True)
AutoConfig.register("glm4_moe", Glm4MoeConfig, exist_ok=True)
AutoConfig.register("glm_moe_dsa", GlmMoeDsaConfig, exist_ok=True)
AutoConfig.register("gpt_oss", GptOssConfig, exist_ok=True)
AutoConfig.register("laguna", LagunaConfig, exist_ok=True)
AutoConfig.register("minimax_m2", MiniMaxM2Config, exist_ok=True)
AutoConfig.register("nemotron_h", NemotronHConfig, exist_ok=True)
Expand Down Expand Up @@ -75,7 +73,6 @@
(Qwen3_5MoeConfig, Qwen3_5ForCausalLM),
(Qwen3_8FlashNextTextConfig, Qwen3_8FlashNextForCausalLM),
(Qwen3_8FlashNextConfig, Qwen3_8FlashNextForCausalLM),
(GptOssConfig, GptOssForCausalLM),
)
for config_cls, model_cls in _CUSTOM_CAUSAL_LM_MODELS:
_CUSTOM_CAUSAL_LM_MAPPING.register(config_cls, model_cls, exist_ok=True)
Expand Down
13 changes: 0 additions & 13 deletions src/prime_rl/trainer/models/gpt_oss/__init__.py

This file was deleted.

Loading
Loading