Skip to content

Load and QLoRA-train Moonshine Streaming checkpoints - #14945

Merged
danielhanchen merged 2 commits into
mainfrom
fix-audio-noarch-load
Oct 23, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
fix-audio-noarch-load

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

FastModel.from_pretrained("moonshine-ai/moonshine-streaming-tiny") (and the small / medium checkpoints) fails with ValueError: Unrecognized configuration class MoonshineStreamingConfig, and once loaded, QLoRA training crashed in the fused loss.

What was broken

Case Before Cause
Load Unrecognized configuration class ... MoonshineStreamingConfig The repo config names no architectures. With no causal-LM mapping, the loader's audio head lookup needs an architecture name, so it fell through to AutoModelForCausalLM.
QLoRA 4 bit, compiled RuntimeError: mat1 and mat2 shapes cannot be multiplied (8x64 and 1x1048576) Moonshine's LM head is proj_out, untied on the streaming checkpoints, so 4-bit loads quantized it and the fused CE loss read the packed weight.

Changes

  • loader.py: the non-VLM route moves into _resolve_non_vlm_auto_model. When no causal-LM class maps the config and the checkpoint's own audio head is not found, it tries the speech seq2seq mapping before falling back to AutoModelForCausalLM. Anything a causal-LM class maps, and any config whose architecture names an audio head, keeps its current route; only the path that raised before changes.
  • vision.py: _architecture_skip_modules keeps proj_out out of bitsandbytes for moonshine / moonshine_streaming, as lm_head is for every other model. Only the head matches the skip key.

Evidence

Tiny random-weight copy of moonshine-ai/moonshine-streaming-tiny (real config with no architectures, real processor), 5 steps, bf16 on Colab:

Case main this branch
LoRA 16 bit load error trains, loss 10.392 -> 10.282
QLoRA 4 bit load error trains, loss 10.395 -> 10.283
Moonshine, Whisper (controls) pass pass, same losses and peak memory

The 8 graph breaks Moonshine Streaming shows here are the SDPA SymBool breaks that unslothai/unsloth-zoo#2019 removes for Moonshine.

New CPU tests: tests/test_audio_load_routing.py (a config without architectures resolves to AutoModelForSpeechSeq2Seq; Llama, Whisper, bare and CTC wav2vec2 keep their route) and tests/python/test_moonshine_4bit_head_skip.py (only proj_out matches the transformers skip matcher).

@danielhanchen danielhanchen self-assigned this Oct 23, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T07:31:00.543841Z 41bbd7d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 41bbd7dec4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit a3e7ac7 into main Oct 23, 2026
3 of 30 checks passed
@danielhanchen
danielhanchen deleted the fix-audio-noarch-load branch October 23, 2026 11:03
danielhanchen added a commit that referenced this pull request Oct 23, 2026
- loader._resolve_non_vlm_auto_model: name trust_remote_code like its sibling resolvers, so test_every_resolver_probe_forwards_the_trust_decision can see the trust decision reach every class probe (#14945).
- test_kill_switch_env_is_read_at_import: the fresh interpreter had no CUDA spoof, so on CPU CI import unsloth raised before the switch was read (#14936). Install the CI spoof when there is no GPU, and check both values.
iam-knoit pushed a commit to SynhalaAI/unsloth that referenced this pull request Oct 23, 2026
…slothai#14990)

`tests/test_remote_code_class_and_expert_submodules.py::test_every_resolver_probe_forwards_the_trust_decision`
fails on `main` since unslothai#14945:

```
AssertionError: ('unsloth.models.loader', 839)
```

That test statically requires every `resolve_model_class` probe to pass
`trust_remote_code` or splat `_probe_hub_kwargs`.
`_resolve_non_vlm_auto_model` (added in unslothai#14945) received the same
`_probe_hub_kwargs` dict from `FastModel.from_pretrained`, so
`trust_remote_code` was already forwarded, but it splatted it under the
name `hub_kwargs`, which the check does not recognise.

This renames the helper's keyword collector to `_probe_hub_kwargs`. No
behaviour change. The test fails on `main` and passes here;
`tests/test_audio_load_routing.py` and
`tests/python/test_feature_extractor_only_checkpoints.py` still pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant