Repository navigation
New Community Model: Granite Speech 5.0 2B (IBM) - #1332
Merged
Merged
Conversation
Owner
|
@eutychus Thanks for contributing a new model! There are some issues and I'll make changes directly to the PR. |
- can_load installed-dir fallback and GGUF package path reject directories holding native weight files (foreign native checkpoint with a stray GGUF no longer misroutes); red-green covered by a new d_units symlink test plus predicate checks. - require_shape errors name the tensor source file; tail-rebalance comment states the real <=cap+128 bound; stale Task-E comment fixed; C1 fixtures end with a newline. - reference.py rope-dict hook fails closed with RuntimeError on partial/missing keys instead of leaking KeyError. - Validation doc: synth row scoping, natural->60s pending wording, operator-step numbering.
… count The per-window Q-Former loop adds O(100+) graph nodes per window against a fixed 65536-node budget, aborting (GGML_ASSERT n_nodes < size) on spans above ~60 s (W=600 at 180 s). Reserve base + 1024 nodes per planned window instead. Regression test: synthetic 9000-step projector run (red: same assert, green: finite outputs, A=1800).
Covers the granite_speech_2b port (checkpoint rev, architecture map, numerical contract, verification, CPU/GPU/reference RTF on Monte Cristo ch.1, release state, reproduce commands). Notes file only; no models, weights, build outputs, or audio.
Flip family status experimental -> community. Add installable granite_speech_2b_safetensors package (pinned IBM snapshot rev) since the prebuilt Q8_0 remote is not yet uploaded; repo rule requires the default package to be GGUF, so it stays the E2-gated Q8_0 entry and ui.recommended_package tracks it. Until the org upload lands, install the snapshot package id explicitly or convert locally. Verified: model_spec_system_test, loader/catalog sync (no g2b drift), clean-root snapshot install, CLI goldens (en+ja) from the installed artifact, b1/d/f/lifecycle/timestamps green.
Replace hardcoded CUDA toolkit paths with <cuda-home> placeholders (referencing docs/build/linux.md) and scratch-dir paths with $GRANITE2B_WORK/<build-dir> placeholders. Benchmark hardware provenance retained as data.
Matches the per-model validation-report convention (nemotron_transcribe, underdog_bark3, phonon2, glm_tts). No content changes beyond path updates in cross-links.
Remove stored fixtures and porting artifacts, keep independent parity tooling, and scope shared decoder extensions to neutral defaults. Reuse session-owned framework graphs, batched Q-Former windows, and the shared greedy decoder. Rename the new family to granite_speech5 while preserving granite5asr registration and aliases. Restore generic server and tensor-source behavior to main. Validated controlled FP32 parity, native and mixed-Q8 inference, CUDA/Vulkan/CPU lifecycle and warmed performance, targeted existing decoder callers, and final smoke/spec/catalog checks.
0xShug0
force-pushed
the
granite-speech-2b
branch
from
November 19, 2026 03:24
bf18533 to
2014472
Compare
0xShug0
marked this pull request as draft
November 19, 2026 04:05
0xShug0
marked this pull request as ready for review
November 19, 2026 04:41
Owner
|
I refactored the implementation to address some problematic patterns inherited from Granite5ASR. Performance has also improved. The conversion script now handles the tensor layout correctly, so no changes to the shared TensorSource are needed. I removed the bundled fixtures. The repository already provides a minimal shared fixture set; model-specific fixtures should be hosted externally rather than stored in the code repository. A = orig PR B = after refactor Native BF16 tensor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
granite_speech_2b, a community port of IBM Granite Speech 5.0 2B (pinned revec49ca6b), an autoregressive multilingual ASR model: Conformer encoder, Q-Former projector, and Granite causal LLM. This is a separate inference architecture — and therefore a separate family — from the existing TurboCTCgranite5asrloader, which is untouched (loader, packages, andgranite_speech*aliases unchanged).Scope: offline multilingual ASR (en/fr/de/es/pt/ja) with punctuation and capitalization, optional source-language hints, framework offline chunking, keyword biasing, and speech translation (en→fr/de/es/pt/it, ja→en) through the CLI and legacy server. Related: #54.
Implementation
src/community_models/granite_speech_2b/+include/engine/community_models/granite_speech_2b/, model-spec v1 (model_specs/granite_speech_2b.json,status: community).NemoMelFrontend(centered periodic Hann, reflect pad, HTK, 512/400/160,DensePowerLog101e-10 floor), per-clip max floor over all raw frames then(v/4)+1, adjacent-frame pairing with odd-row drop.--keep-typeon rank-0 tensors warns instead of throwing) with a new unit test.LlamaBpeTokenizer(Llama3 preset, proven by exact ID parity), single-turn template with model-owned audio marker100352, BOS/EOS100257, sorted-contiguous injection (A·2048), reserved-marker rejection, per-chunk language hints.make_granite_speech_2b_loader,RuntimeSessionBaseoffline session (auto/fixed/vad/none chunking, 120 s cap, VAD fallback, JP-aware join, error recovery + A/B/A isolation). Multiparttarget_languageis a loud 400 directing to JSONoptions.target_language(single-file shape has no options channel); batch multipart requires native batching this family doesn't implement.Download packages
granite_speech_2b_safetensors(pinned IBM snapshot, installs viamodel_manager_v2 install— verified from an empty root, goldens reproduce from the installed artifact).granite_speech_2b_q8_0(280 Q8_0 + 658 BF16 + 16 I64, native keys preserved): E2-gated release artifact; becomes the default once uploaded to the release remote (upload + pin + flip steps recorded in the validation report §9/§11). Convert locally meanwhile:audiocpp_gguf --family granite_speech_2b --type q8_0 --keep-type 'encoder.*=bf16' ...(full recipe indocs/models/granite_speech_2b.md).Performance & Verification
Pinned reference: Transformers 4.57.0, torch 2.8.0 CPU, FP32, eager. Audio: LibriVox Monte Cristo ch.1 (16 kHz mono; 180 s excerpt + full 1179.4 s chapter). Machine: i9-12900K, 31 GB RAM; RTX 3080 12 GB.
Matched single-span runs are at parity or better for C++ (prefill 10.0 s vs 14.5 s reference; decode parity; frontend parity). The 180 s gap is structural: the CLI chunks (120+60, 2×512-token budget) while the reference runs one 1800-placeholder prompt with a single 512 budget.
Parity gates: 19/19
compare_tracestages throughgenerateon all fixtures (rel_rms ~1e-6, logits max-abs ~1e-4 vs 2e-2 tol); 120 s segment transcript byte-identical to the reference; native≡orig≡Q8_0 transcripts byte-identical (WER 2.90%, CER 6.25%, Δ+0.00pp); IBM official Q8_0 pair agrees (one comma-only long-EN diff). Runtime integration green (CLI native/embedded, server JSON + multipart + auto-JA +xxreject, valid-after-failure, two-session repeat, TurboCTC golden + timestamps). Full matrix: custom/full composite configure,ctest -R 'granite_speech_2b|granite5asr_ctc|server_parallel'8/8 +model_spec_system_testgreen, loader/catalog sync clean for this family.Docs:
docs/models/granite_speech_2b.md(usage, conversion, options),docs/reports/granite_speech_2b_validation.md(full E2 gate table + release decision),docs/reports/granite_speech_2b_porting_notes.md(architecture map, numerical contract, gotchas, benchmarks).server.json
{ "host": "127.0.0.1", "port": 18080, "backend": "cpu", "models": [{ "id": "granite-2b", "family": "granite_speech_2b", "path": "models/Granite-Speech-5.0-2B-hf", "task": "asr", "mode": "offline" }] }CLI & Server Usage
Known limitations
AI Disclaimer: Yes, I used AI assistance to implement this port. Every milestone was task-reviewed, all gates are evidenced in-tree, and the shared-framework changes are neutral-defaulted with existing-caller regressions green.