Skip to content

composer: a mamba/hybrid base is accepted and its layers silently relabelled as attention #124

Description

@aviv1ron1

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomposerCompose pipelinefeature/granite-turboctc-defaultFound while landing the TurboCTC ASR default + transformers 5.16prio:mediumReal bug, not blocking a merge

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions