Repository navigation
Conversation
|
thanks for submitting this i will review and get it in as its something definitely we should offer |
|
Thanks for this, @patricksamuelevans. The offline port is careful work: the converter profile, goldens, tolerances and the full LibriSpeech gate are solid, and we're keeping all of it. We want this model fully supported in the library, so we'll take the PR over and build on your branch (your commits stay). The remaining scope:
One request, since you have the GB10: anything more you can find on the CUDA batch divergence would help a lot. Which tensor first diverges between batch 1 and batch 8, and does |
…rms for prompt-conditioned parakeet - transcribe_model::set_language_aliases / accepts_language: the source-language gate accepts advertised languages plus unadvertised family aliases. - parakeet prompt variants accept every dictionary key on the slot of an advertised language, plus auto (nemotron-labs-unified, nemotron-3.5). Keys on other slots stay rejected (es-ES is an untrained slot here). - sensevoice declares "auto" (its resolve_lid_idx branch was unreachable). - Revert the CLI-only --language auto normalization. - nemotron-labs-unified advertises the card's 25 bare codes (drop en-US, fr-FR, es-ES); lang_detect stays true (implicit, like v3); header docs say detected_language may be empty for implicit-detection families. - Tests: toy prompt fixture + parakeet_prompt_language_unit; decoder_smoke auto/en-US/zz checks; real smoke expects 25 languages.
…ches; drop CUDA serial fallback A padded query whose Regular-local [256,256] band reaches no real key had every flash-mask entry at -inf (the -1e30 key-pad sentinel overflows the F16 cast). CPU and Metal flash attention return 0 for a zero rowsum; CUDA divides 0/0 and the NaN row reaches real frames through the conv (NaN * 0) and the next layer's padded keys, so short utterances batched with a clip >20.5 s longer decode empty. Reproduced on CPU by removing ggml-cpu's S==0 guard: nemotron-labs-unified and parakeet-tdt-0.6b-v3 lose 6-7 of 8 transcripts at batch 8; with the clamp both match serial. Clamp the scaled mask to -3e4 before the F16 cast when a key-pad mask is present: exact for rows with a real key (exp underflows to 0 as for -inf), finite for rows the graph drops. Single-shot graphs are unchanged. Remove the variant-string CUDA serial fallback from transcribe_run_batch.
…otron-labs-unified
…al sweep - ingest.py fleurs reads parquet-data/<config>/<split>.parquet directly (only the test split, no datasets arrow cache; ~0.5 GB vs ~2.7+ GB per language), falling back to load_dataset. Byte-identical manifest and WAVs to the load_dataset path (checked on fleurs-de, 862 utts). - run.py --language auto: no hint reaches transcribe-cli (the model's language-agnostic mode); the manifest language is still stamped on the report header so score.py routes metric/normalizer correctly; recipe language is auto-detect; default out path tagged .lang-auto. - modal_sweep.py sweep: --dataset takes a comma-separated list (one cell per dataset); --language "" = each manifest's own code, "auto" = auto mode; auto hyps are written as *.lang-auto.jsonl so they never overwrite the explicit cells.
… and language changes
…ified reference baseline Stock NeMo Speech 3.1 (card recipe) = 1.7017% (score.py) = 1.3774% under the Open ASR Leaderboard scorer (merge_compounds), matching the card's 1.38. NeMo 2.8 offline patch with full attention is byte-identical to stock 3.1; the PR oracle's 1.7055% comes only from --att-context 256,256.
…g with the language prompt - converter: drop offline_only; keep chunked_limited_with_rc + (L,C,R) menu, so offline is full attention (no [256,256] window) and streaming is advertised - emit_buffered_chunk fills the prompt one-hot per chunk (was uninitialized); per-chunk enc.final dump is pre-prompt, enc.prompted added; stream_validate rejects languages outside the prompt dictionary - buffered (L,C,R): accept any L>=0, C>=1, R>=0 frame tuple (INFO when off the training menu); card's 0.56 s row is 70/2/5 - dumper / WER runner / validate_buffered_streaming: --language passthrough mirroring NeMo's target_lang (prompt applied to the whole window per chunk); run under NeMo 2.8 and 3.1; add parakeet-nemo31 env from nlu-base - golden manifest: native-style oracle, no dump_args; block.12 budget 1.2 - docs, intake, forward-map, porting log; tests
# Conflicts: # docs/porting/families/parakeet.md
…; reconvert + quants; catalog seed - intake/golden manifest: 25 bare-code languages - batch golden re-frozen for full attention (ja-long) - PR description: attention-style/streaming and NeMo 3.1 reference sections - porting log: integration verification, F32 + quant hashes, private HF repo - catalog record seeded (new_record.py) so modal_sweep resolves the slug
The dense local/chunked masks used -INFINITY/-1e30 for masked keys. Flash casts the additive mask to F16, so those values become -inf. For a variable-length batch, a padded query can fall outside the local band and have every key masked; all -inf scores make softmax NaN. The next block then reads the NaN through K/V and the whole batch decodes empty. Use a finite F16-safe sentinel (-1e4) for the dense masks and the shared keypad mask. Real keys are unaffected (exp underflow), while an all-masked padded row becomes uniform instead of NaN. Test: batch_mask_unit now checks the F16 round-trip; the 8-utt batch golden produces 8/8 transcripts on CUDA and CPU with no NaN.
|
Thanks, and I agree with taking it over. One correction on the batch data: the To your questions: the first tensor that actually breaks is And yes, The problem looks like the mask sentinel, not the model. I pushed a small fix on top of this branch ( Happy to drop the fallback too if you want, but I left it alone so it doesn't collide with your changes. |
…gested; streaming RTF notes M4 Max and base M4 cells pending.
…sweeps for nemotron-labs-unified - run_reference_parakeet_nemo_stock.py: scoring-language header, per-call peak memory, --chunk - sweep_reference_nemo31_fleurs.sh + compare_target_lang.py: 25-language explicit/auto sweep, drift report - longform_reference_nemo31.py: full / local256 / buffered (NeMo 3.1 streaming script) with time + peak memory - ingest.py: earnings22-full (N shortest whole calls, soxr resample)
…256,256] window above NeMo's full attention is quadratic (43 GB at 14 min, OOM past ~21 min) and no more accurate than its rel_pos_local_attn [256,256] window on long audio. chunked_limited_with_rc models (nemotron-labs-unified, parakeet-unified-en) now switch their offline encoder to the existing Regular-local kLongformAttContext window above kOfflineFullAttentionMaxSeconds = 120 s (TRANSCRIBE_PARAKEET_FULL_ATTENTION_MAX_S overrides). Batches with such a clip run per utterance. Streaming unchanged. TED-LIUM C++ 3.44% vs NeMo window 3.46%; Earnings-22 16.19% = 16.19%; validate.py all and LibriSpeech 1.7017% unchanged.
|
lol didn't mean to use an agent to reply, but anyway, here we are I'll take it from here, thanks for the changes, I've got it roughly complete |
…l) ingested; base M4 speed exception
…f5487c's sentinels) 1f5487c (PR handy-computer#286 author) and e725f0b (nlu-lang) independently found the same CUDA NaN: in a variable-length batch, a padded query whose band or chunk window reaches no real key has every flash-mask entry at -inf after the F16 cast, and CUDA's flash kernel divides 0/0. Keep one mechanism: - e725f0b clamps the scaled flash mask to -3e4 before the F16 cast, only when a key-pad mask is present. It is the single point where the band padding, the dense chunked mask and the key-pad mask all meet the cast, so it covers Regular-local and ChunkedLimited (nemotron-3.5) batches alike. Single-clip graphs build no key-pad mask and are untouched. - 1f5487c changes the sentinels at three sources, including the shared fill_keypad_mask used by gigaam, sensevoice and medasr, whose full-attention batches cannot produce an all-masked row. It adds no case the clamp misses: the manual-softmax path keeps a finite -1e30 entry in every padded row, and the windowed graphs already give padded queries a finite key. This reverts the source and test changes of 1f5487c; the commit stays in history and the PR description credits its diagnosis.
|
Hehe, sorry man. I'm kinda busy rn |
…FLEURS NeMo-vs-C++ tables, paired_compare.py - publication profile asr-publication-v2: LibriSpeech test-clean x 6 presets + FLEURS x 25 (Q8_0), Modal L40S batch 8, engine 88401d9; ingested; headline_benchmark batch_size 8. Ref-dtype gate: F32 1.70 = NeMo 3.1 1.70. - reports/porting/.../fleurs-nemo-vs-cpp.md (F32/Q8_0, explicit + auto) and fleurs-quants.md (F16/Q6_K/Q5_K_M/Q4_K_M) vs stock NeMo 3.1, paired bootstrap per language. - scripts/wer/paired_compare.py: per-language table with a paired bootstrap against a reference column, from score.py's per-utterance rows. - family doc batch row + porting log: Q8_0 CPU long-mix batch divergence is Q8_0 numeric noise (F32 ref dtype byte-equal; tensor evidence).
- scripts/hf_cards/nemotron-labs-unified-asr-0.6b.yaml: pin 2026-11-29, validation c19938c (NeMo 3.1 stock) on 2026-12-03, summary and wer notes (scorer gap to the publisher's 1.38, Greek final sigma). - docs/models/nemotron-labs-unified-asr-0.6b.md: catalog regions; languages (25 bare codes, auto, aliases, untrained-slot codes rejected), guidance for el/ru/bg/uk, buffered streaming latency table and L/C/R selection (80 ms steps, trained menu), long audio (full attention to 120 s, window above, TRANSCRIBE_PARAKEET_FULL_ATTENTION_MAX_S), quant guidance (Q4_K_M pending owner sign-off), M1 stand-in. The M4 Max perf region is left out until its rows are ingested (render.py rejects an empty perf region). - README.md: rendered supported-models row.
… none; unified-en validation of the 120 s full-attention threshold
…; docs perf block Profile asr-publication-v2 at 049e0c1 (Release, validation hooks off). check.py --publication-profile is green for this model.
Blocker: - resolve_buffered_stream_geom rejects a [left | chunk | right] window longer than kOfflineFullAttentionMaxSeconds (120 s) with INVALID_ARG; int64 sample math, buf_samples_* are int64. Documented in parakeet.h; reject cases (left_ms 2e9, chunk/right 2e9) in parakeet_stream_ext_reject_unit. Should-fix: - parakeet_unified_gate_unit (new toy fixture tokenizer_minimal_prompt_buffered): stream_begin zz / es-ES -> UNSUPPORTED_LANGUAGE and IDLE, auto/en/en-US OK; env parse (-1, abc, 120abc, nan, inf fall back to 120); switch decision. - parakeet_unified_real_smoke (TRANSCRIBE_PARAKEET_UNIFIED_GGUF): batch == serial with the override at 0 and at the default (jfk + 33.9 s clip); streams jfk at off-menu 70/3/5 (toy encoder cannot run compute). - sensevoice_language_gate_smoke (TRANSCRIBE_SENSEVOICE_GGUF) + docs line. - unified-en docs: >120 s window + link to the long-form validation. - Stale 'no long-form window' text in tolerances, converter, intake. - PR description: clamp wording for kestrel parakeet-ultra, author credit and Modal table, Co-authored-by trailer. - conformer.cpp: drop the commit hash from the clamp comment. Nits: env override parsed once per run, strtod needs the whole string; limit never below the [256, 256] band span (short batches stay batched); nemotron-labs-unified in parakeet.md; converter .nemo name fallback via list_repo_files; comment on the redundant stream_validate language check.
Timestamps: word times equal NeMo 3.1 transcribe(timestamps=True) on fleurs-fr / fleurs-es / jfk with the native-style F32 GGUF (63/63 words, 0 ms difference). Batching: CPU and Metal batch 2/4/8 byte-equal to serial, CUDA batch 8 WER equals batch 1 on Modal. Granularities stay [token] per the family convention.
…rting log rig states
…se style; tighten sibling-page additions
…ne-off reference tooling; tighten family rows and forward map
Fixes #250.
Adds NVIDIA's
nemotron-labs-unified-asr-0.6b(multilingual Parakeet Unified: 25 European languages, language-ID prompt, punctuation and capitalization, offline + buffered streaming) as aparakeetvariant, pinned to upstream revision023ce907267a09a308a5cb69239447cb3d0c1597.This started as an offline-only port by @patricksamuelevans (kept in history, thank you!) and was extended by maintainers to the full model: native attention / streaming with the language prompt, library-level language handling, long-audio behaviour, a generic CUDA batch fix, multilingual WER and publication benches.
GGUFs:
handy-computer/nemotron-labs-unified-asr-0.6b-gguf(private until release). F32 SHA256994283d557f12a6e792ec2131109ae3b883a3207066c037a75aa8619087d4f42.Results at a glance
auto(mean 12.13 / 13.23 vs 12.13 / 13.24). Quants (mean of 25): F16 12.13, Q8_0 12.12, Q6_K 12.18, Q5_K_M 12.22, Q4_K_M 12.58.Summary
Native attention style, full-context offline, buffered streaming
regularattention (offline_onlyisgone). The GGUF keeps
att_context_style=chunked_limited_with_rcwith the(L, C, R)menu L={70}, C={1,2,7,13}, R={0,1,2,3,4,7,13}, exactly likeparakeet-unified-en-0.6b. Offline is full attention, as in NeMo: the
[256, 256]long-form window the PR applied to clips over 20.5 s is gone(it changed 23 of the 73 long LibriSpeech clips and was the whole source of
the PR's 1.7055%).
supports_streaming=true: the existing buffered path(
emit_buffered_chunk) now fills the language-prompt one-hot on everychunk. It read uninitialized memory before. NeMo applies the prompt to the
whole
[left | chunk | right]window's encoder output per chunk, thenslices the left frames; the C++ does the same. A language outside the
prompt dictionary is rejected at
stream_begin.(L, C, R): anyL >= 0, C >= 1, R >= 0frame tuple runs (themenu supplies the default 70/13/13; an off-menu tuple logs INFO). The
card's 0.56 s row is 70/2/5 with R=5 untrained; NeMo accepts any tuple.
Applies to parakeet-unified-en as well.
conv_context_style=dccis stored by NeMo and never read at inference;the conv is plain symmetric [4, 4] on both sides.
--languageonvalidate_buffered_streaming.py, the dumper'sbuffered branch and the buffered WER runner (mirrors NeMo's
target_lang); the WER runner now restores the prompt model class; bothscripts run under NeMo 2.8 and 3.1.
Long audio: full attention up to 2 min, then the [256, 256] window
NeMo's offline full attention is quadratic (43 GB at 14 min, out of memory
past ~21 min) and no more accurate on long audio than its
rel_pos_local_attn [256, 256]window (TED 3.46 vs 3.50, Earnings-22 16.19 vs 17.53). Forchunked_limited_with_rc GGUFs (this model and parakeet-unified-en, which had
the same blow-up) the offline encoder now runs full attention up to
kOfflineFullAttentionMaxSeconds= 120 s and the existing Regular-localkLongformAttContextwindow above it (TRANSCRIBE_PARAKEET_FULL_ATTENTION_MAX_Soverrides). No new attention mode: the long clip simply runs the hparams the
full-attention parakeets already use. C++ memory stays near-linear either way
(flash attention), so the limit is set by time: CPU full attention costs 1.7x
the window at 2 min and 7.7x at 20 min. LibriSpeech/FLEURS clips stay
bit-for-bit on the NeMo-matching path; TED-LIUM C++ 3.44% vs NeMo window
3.46%, Earnings-22 16.19% = 16.19%. A batch containing a clip past the limit
runs per utterance.
Reference (NeMo 3.1)
Stock NeMo Speech 3.1 (the checkpoint's producer line) and the in-tree NeMo 2.8 pin agree: offline
tensors within 2.7e-5 and identical hypotheses; LibriSpeech test-clean
1.7017% under
score.py(1.3774% under the Open ASR Leaderboard scorer,matching the card's 1.38). The card's buffered script under 3.1
(
att_context_size_as_chunk=true,target_lang) gives the same transcriptsas the in-tree 2.8 buffered loop on jfk / fleurs-fr / fleurs-es at 2.08,
1.12, 0.56 and 0.16 s.
Batched encoding on CUDA: fully masked flash-attention rows (root cause and fix)
Batched (run_batch) encoding of a variable-length batch on CUDA can empty
whole transcripts. It hits every conformer model that runs the Regular-local
attention band in a batch, which since the [256, 256] long-form default
includes every full-attention parakeet (tdt-0.6b-v2/v3, tdt-1.1b, rnnt/ctc,
tdt_ctc-1.1b, ...). It hit this variant while the PR forced
regularattention; with the native style restored it runs full attention and no
longer builds the band, but the fix is generic. The PR's earlier
variant-string serial fallback in
transcribe_run_batchis removed.Cause: when a batch mixes clips whose encoder lengths differ by more than the
band (about 20.5 s at [256, 256]), a padded query of a short utterance has no
real key inside its band. Its flash mask row is all -inf: the band fill is
-inf and the -1e30 key-pad sentinel overflows to -inf in the F16 cast. The
CPU and Metal flash kernels return 0 for a zero rowsum; CUDA divides 0/0.
The NaN row reaches the real frames through the conv module (NaN * 0 valid-
frame mask) and the next layer's padded keys (NaN scores), so the utterance
decodes empty.
Fix (
src/conformer/conformer.cpp): when a key-pad mask is present, clampthe scaled mask to -3e4 before the F16 cast. Rows with a real key are
unchanged (exp(-3e4 - max) underflows to 0 exactly as -inf does; batched
encoder tensors are identical with and without the clamp on CPU); rows with
no real key stay finite and are dropped by the graph as before.
Graphs without a key-pad mask (single non-kestrel utterances) are untouched.
Kestrel-masked parakeet-ultra builds a key-pad mask even for one utterance
(its in-graph length masking), so the clamp runs there too; it is exact for
it as well, since every row of a single utterance has a real key.
The PR author (patricksamuelevans, 1f5487c) found the same root cause
independently, including that nemotron-3.5-asr-streaming-0.6b's dense
chunked batches hit it, and fixed it with finite -1e4 sentinels at each mask
source (the shared key-pad util, the band padding and the parakeet chunked
masks). That commit is kept in history; the source changes are folded into
the single clamp above, which covers the same cases without touching the
shared util other families use. Modal L4, 512 LibriSpeech test-clean
utterances, unsorted, Q8_0, WER batch 1 / batch 8:
Evidence:
utterances, unsorted, batch 8: before 2.94% WER with 14 empty hypotheses;
after 1.36%, equal to batch 1 (1.36%).
S == 0guard in theflash-attention finalization (mimicking CUDA). parakeet-tdt-0.6b-v3 Q8_0
and nemotron-labs-unified on samples/{jfk,fleurs-*,ja-long,
ru-long-padded}.wav at batch 8 lose 6-7 of 8 transcripts; with the clamp
they match serial.
parakeet-unified-en, nemotron-3.5-asr-streaming, nemotron-labs-unified and
parakeet-tdt-0.6b-v3, including mixes with 56-84 s clips (windowed path).
Language hints
aliases a family declares at load (
transcribe_model::set_language_aliases/
accepts_language). Prompt-conditioned parakeet (this model,nemotron-3.5) accepts every prompt-dictionary key on the slot of an
advertised language, plus
auto(same slot as a null hint). SenseVoicedeclares
auto. The PR's CLI-only--language autonormalization isreverted; the library handles it.
same slot (
en-US,fr-FR, ...) are unadvertised aliases. Other keys ofthe inherited 118-key dictionary are rejected: their prompt-kernel columns
are untrained (init-level norm), e.g.
es-ESis slot 2 whileesis thetrained Spanish slot 3; likewise
en-GB,pt-BR,fr-CA.lang_detectstays true (transcribes without a hint via the trained autoslot, like parakeet v3); no
<lang-XX>tokens exist, sotranscribe_detected_languageis empty. Header docs say so.Scope
src/conformer (flash mask), src/transcribe-asr.cpp (language gate, batch
fallback removed), src/transcribe-model.*, src/arch/parakeet, src/arch/sensevoice,
include/transcribe.h (docs), examples/cli, scripts/convert-parakeet.py,
scripts/wer (FLEURS parquet ingest, run.py --language auto, multi-dataset
Modal sweep), tests, docs.
Validation
Offline:
validate.py all(native style, no dump_args) 20/20 tensors onjfk / fleurs-fr / fleurs-es / ru-long-padded (424 frames, full attention),
exact transcripts. LibriSpeech test-clean full F32: 1.7017%, equal to
NeMo 3.1.
Streaming: per-chunk parity (
audio_inbit-exact, promptedenc_outwithin tolerance) and equal transcripts vs NeMo on en/fr/es at 2.08 /
1.12 / 0.56 (70/2/5) / 0.16 s, apart from a trailing
.from thedocumented end-of-stream lookahead. WER at 1.12 s: LibriSpeech
test-clean-512 C++ 1.40% vs NeMo 1.36%; FLEURS fr-256 8.32% vs 8.09%
(all differences are end-of-stream punctuation / one casing).
parakeet-unified-en jfk parity unchanged.
Batch: CPU and Metal batch 2/4/8 byte-equal to serial on the 8-clip list;
golden re-frozen (ja-long changes under full attention); CPU tensor
parity bit-exact at batch 4.
Unit:
transcribe_parakeet_prompt_language_unit(toy prompt fixture:auto / en-US / English accepted on run and run_batch; es-ES, zz, "" rejected).
Real model:
transcribe_decoder_smoke(auto == no hint, en-US == en, zzrejected, detected language empty),
transcribe_parakeet_real_smoke.Batch: see the evidence above; CPU batch 2/4/8 also byte-equal to the frozen
golden
tests/golden/batch/nemotron-labs-unified-asr-0.6b.cpu.json.