tests: add ring and llama4 aux-free smokes

- add hf tiny model coverage for Ring 2.0 and Llama 4 adapters

- broaden bailing adapter detection for ring configs
This commit is contained in:
lhl
2025-10-28 10:01:07 +00:00
committed by Wing Lian
parent 6eac9ac372
commit 46d677876e
3 changed files with 157 additions and 2 deletions

View File

@@ -189,8 +189,14 @@ class BailingAdapter(BaseMoEAdapter):
family = "bailing_moe"
def matches(self, model: nn.Module) -> bool:
model_type = getattr(getattr(model, "config", object()), "model_type", "")
return model_type in ("bailing_moe", "bailing_moe_v2")
cfg = getattr(model, "config", None)
if cfg is None:
return False
model_type = getattr(cfg, "model_type", "") or ""
if model_type in ("bailing_moe", "bailing_moe_v2", "ring_moe", "ring"):
return True
cfg_name = cfg.__class__.__name__.lower()
return "bailingmoev2" in cfg_name or "ring" in cfg_name
def find_moe_layers(self, model: nn.Module) -> Iterable[nn.Module]:
for m in model.modules():