Where it lives: main. Found while working on feature/granite-turboctc-default (ef43e69).
resolve_arch gates on model_type, but whether a Granite 4.0 checkpoint contains mamba lives in layer_types:
ibm-granite/granite-4.0-h-small granitemoehybrid {'mamba': 36, 'attention': 4}
ibm-granite/granite-4.0-h-tiny granitemoehybrid {'mamba': 36, 'attention': 4}
ibm-granite/granite-4.0-micro granitemoehybrid {'attention': 40}
granitemoehybrid is in _ARCH_REGISTRY, so all three pass the gate — micro correctly, the other two wrongly. Then:
# compose_utils.py:222-226
# Normalize layer_types: map everything to "attention" (only attention
# layers are supported).
config_kwargs["layer_types"] = ["attention" for _ in lt]
That is a label rewrite, not a conversion. 36 mamba layers get relabelled.
It does fail rather than emit a broken checkpoint — weight_transfer.py:366 raises ValueError because mamba's mixer.in_proj, conv1d, A_log, D, dt_bias and out_proj have no destination. But the message is "Base model has N parameters that couldn't be matched", which nobody would read as "mamba is not supported".
Fix: move the gate to where hybridness actually lives — reject a base whose layer_types contains anything other than attention, with a message naming mamba and saying it is unsupported. Hybrid support is explicitly out of scope, so this is the honest boundary, and it puts the limitation in one place a future mamba branch would delete.
Where it lives:
main. Found while working onfeature/granite-turboctc-default(ef43e69).resolve_archgates onmodel_type, but whether a Granite 4.0 checkpoint contains mamba lives inlayer_types:granitemoehybridis in_ARCH_REGISTRY, so all three pass the gate — micro correctly, the other two wrongly. Then:That is a label rewrite, not a conversion. 36 mamba layers get relabelled.
It does fail rather than emit a broken checkpoint —
weight_transfer.py:366raisesValueErrorbecause mamba'smixer.in_proj,conv1d,A_log,D,dt_biasandout_projhave no destination. But the message is "Base model has N parameters that couldn't be matched", which nobody would read as "mamba is not supported".Fix: move the gate to where hybridness actually lives — reject a base whose
layer_typescontains anything other than attention, with a message naming mamba and saying it is unsupported. Hybrid support is explicitly out of scope, so this is the honest boundary, and it puts the limitation in one place a future mamba branch would delete.