Validation for Muon optimizer with DS/FSDP

This commit is contained in:
Wing Lian
2025-04-01 09:29:54 -04:00
parent f4ae8816bb
commit c578c8f256
2 changed files with 56 additions and 0 deletions

View File

@@ -1135,6 +1135,17 @@ class AxolotlInputConfig(
return value
@model_validator(mode="before")
@classmethod
def check_muon_deepspeed_fsdp(cls, data):
if data.get("optimizer") == "muon" and (
data.get("deepspeed") or data.get("fsdp") or data.get("fsdp_config")
):
raise ValueError(
"Muon optimizer is currently incompatible with DeepSpeed and FSDP"
)
return data
class AxolotlConfigWCapabilities(AxolotlInputConfig):
"""wrapper to valdiate gpu capabilities with the configured options"""