Repository navigation
parakeet: Add Koyal 120M (Conformer striding subsampling) - #309
Open
kavyamanohar wants to merge 2 commits into
Open
kavyamanohar wants to merge 2 commits into
kavyamanohar wants to merge 2 commits into
Conversation
Classic NeMo Conformer models, such as Koyal 120M, use the `striding`
pre_encode: one 3x3 conv, then one more full 3x3 stride-2 conv,
making the audio 4x shorter in time. transcribe.cpp only supports
`dw_striding` (FastConformer): one conv, then two depthwise-separable
pairs, 8x. The rest of the encoder and the decoders are already
supported, so this adds striding and nothing else.
Changes:
- convert-parakeet.py reads encoder.subsampling. A missing key means
dw_striding, because the safetensors path (parakeet-ultra) builds
its config without it.
- It writes stt.parakeet.encoder.subsampling only for striding, so
existing models convert to the same bytes as before.
- It skips conv.3, conv.5 and conv.6 for striding; striding
checkpoints don't have them.
- It resolves subsampling_conv_channels = -1 to d_model, as NeMo
does. Koyal's config uses -1.
- weights.{h,cpp} read the new key (absent = dw_striding, so existing
GGUFs load unchanged), load conv2 as a full conv instead of a
depthwise one, and use two stride-2 stages instead of three when
sizing the projection.
- The long-audio attention window is 512 frames for striding instead
of 256. Frames are 40 ms instead of 80 ms, so it still covers 20.5 s.
- conformer.cpp builds the striding stack: conv0, conv2, then the
same flatten and projection as dw_striding. That last step moves
into a shared helper (pre_encode_flatten_project), unchanged.
- encoder.cpp expects factor 4 for striding and 8 for dw_striding,
and rejects striding with chunked_limited attention, since causal
striding is not implemented.
- model.cpp uses two stages for striding when computing valid
lengths, so the padding masks match the shorter stack.
Existing models are unaffected: parakeet-tdt_ctc-110m converts to the
same bytes as main and gives the same transcripts on 22 clips, single
and batched.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Koyal 120M are small dictation models from Adalat AI, one per
language, that write punctuation and numerals. With striding support
from the previous commit they convert and run as they are; this adds
the profiles, tests, samples and docs.
- convert-parakeet.py: one profile per language. Koyal is hybrid
TDT+CTC, shipped TDT-only like parakeet-tdt_ctc-110m. The converter
decides that from "tdt_ctc" in the name, which Koyal's names don't
have, so a drop_aux_ctc profile flag does the same.
- tests/golden/parakeet/koyal-*.manifest.json: one per model, so
validate.py checks each against NeMo. The shared parakeet
tolerances are enough; no new tolerance file.
- samples/{hi,kn,ml,te}-{short,long}.wav: no clips in these languages
existed. The short ones back the golden manifests; the long ones
are for benchmarking, like the other per-language pairs. All from
the FLEURS test split, listed in samples/README.md.
- reports/porting/parakeet/koyal-*/intake.json: the pinned upstream
facts for each model (revision, config, frontend, tokenizer,
capabilities, model-card scores), as the other parakeet variants
have. preflight.py and the catalog tooling read them.
- docs/models/koyal-120m.md, plus a line in parakeet.md so it shows
up when choosing a parakeet variant.
- docs/porting/families/parakeet.md and the parakeet forward map: a
short section each, because Koyal is a classic Conformer and every
other variant in the family is a FastConformer. They say what
differs (the subsampling block) and why it runs on the parakeet
path.
This branch has not been deployed
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 Koyal 120M: four small models from Adalat AI, one each for Hindi, Kannada, Malayalam and Telugu. Fixes #308.
They are classic NeMo Conformer, not FastConformer, so their subsampling block is
striding(4x) where parakeet only haddw_striding(8x). This PR adds that block. Everything after it (Conformer layers, TDT decoder, tokenizer) is the existing parakeet code, so the models stay in the parakeet family.Two commits on current main (v0.5.2):
FLEURS test, WER, Q8_0:
Each model takes one language. No streaming, translation or language detection.
Scope
src/conformer,src/arch/parakeet: the striding block, the optionalstt.parakeet.encoder.subsamplingkey (absent meansdw_striding), and a 512-frame long-form window at 4x so it still covers 20.5 s. Striding withchunked_limitedattention is rejected, since causal striding is not implemented.scripts/convert-parakeet.py: writes the subsampling kind; four Koyal profiles; adrop_aux_ctcprofile flag, because Koyal is hybrid TDT+CTC but its names don't containtdt_ctc.tests/golden/parakeet/koyal-*.manifest.json: one per model, each on an 11 s FLEURS clip in its language, with the shared parakeet tolerances.samples/{hi,kn,ml,te}-{short,long}.wav: FLEURS test clips, listed insamples/README.md.reports/porting/parakeet/koyal-*/intake.json.docs/models/koyal-120m.md, a line indocs/models/parakeet.md, and a short section indocs/porting/families/parakeet.mdand the forward map.No catalog record, HF card or benchmark rows.
AI Assistance
I used Claude Code for the implementation, the docs and the validation runs. I reviewed the changes and the results, and I own them.
Validation
validate.py allpasses for all four models: 16/16 tensors within the shared parakeet tolerances, and transcripts exactly match NeMo. The golden clips avoid frame counts that are a multiple of 4, because there the NeMo dumper keeps a masked padding frame and its encoder dump is one frame longer.parakeet-tdt_ctc-110mconverts to a byte-identical GGUF and gives identical transcripts to a main build on 22 clips, single and batched.scripts/wer/score.py. F32, Q8_0, Q5_K_M and Q4_K_M are indocs/models/koyal-120m.md; the quantized models stay within 0.2 points of F32. As a check on the setup, I re-ran three published Hindi rows on the same machine and got within 0.11 points of each: Nemotron 3.5 8.57% (page 8.61%), Whisper large-v3 17.17% (17.06%), large-v3-turbo 18.87% (18.85%). The pages were measured at batch size 8 and I used batch size 1.ctestpasses, clang-format is clean, catalog check and render check are clean.preflight.pygate B passes for all four.Not tested: Metal, Vulkan and CPU-only WER. The WER numbers are from CUDA only, so those backends would need a check.