feat(asr/canary): Canary-1B-v2 AED engine + CTC-spotter custom vocab#709
feat(asr/canary): Canary-1B-v2 AED engine + CTC-spotter custom vocab#709Alex-Wengg wants to merge 2 commits into
Conversation
Add NVIDIA Canary-1B-v2 (attention encoder-decoder) as a selectable ASR engine, converted to CoreML (int4 on ANE, iOS18). Pipeline: fp32/CPU mel preprocessor -> FastConformer encoder -> autoregressive transformer decoder + 1024->16384 projection, greedy decode to EOS. - CanaryManager: actor, 15s window, reads decoder seq length from the model - CanaryModels: download/load from FluidInference/canary-1b-v2-coreml (int4/fp16/int8) - CanaryKeywordBooster: reuses the CTC keyword spotter to add custom-vocabulary support to canary (fuzzy replace + timestamp-guided insertion) - CLI: canary-transcribe, canary-earnings-benchmark (OpenBench-comparable P/R/F1) - ModelNames: Repo.canary1bV2 + ModelNames.Canary + CanaryPrecision - Tests: CanaryConfigTests Earnings22-keywords (full 772, same scorer as OpenBench): canary+vocab WER 16.5%, keyword F1 0.95 (beats Argmax parakeet-v3 0.89)
PocketTTS Smoke Test ✅
Runtime: 1m30s Note: PocketTTS uses CoreML MLState (macOS 15) KV cache + Mimi streaming state. CI VM lacks physical GPU — audio quality and performance may differ from Apple Silicon. |
Parakeet EOU Benchmark Results ✅Status: Benchmark passed Performance Metrics
Streaming Metrics
Test runtime: 1m13s • 06/17/2026, 10:20 PM EST RTFx = Real-Time Factor (higher is better) • Processing includes: Model inference, audio preprocessing, state management, and file I/O |
Offline VBx Pipeline ResultsSpeaker Diarization Performance (VBx Batch Mode)Optimal clustering with Hungarian algorithm for maximum accuracy
Offline VBx Pipeline Timing BreakdownTime spent in each stage of batch diarization
Speaker Diarization Research ComparisonOffline VBx achieves competitive accuracy with batch processing
Pipeline Details:
🎯 Offline VBx Test • AMI Corpus ES2004a • 1049.0s meeting audio • 99.2s processing • Test runtime: 1m 48s • 06/17/2026, 10:01 PM EST |
ASR Benchmark Results ✅Status: All benchmarks passed Parakeet v3 (multilingual)
Parakeet v2 (English-optimized)
Streaming (v3)
Streaming (v2)
Streaming tests use 5 files with 0.5s chunks to simulate real-time audio streaming 25 files per dataset • Test runtime: 10m39s • 06/17/2026, 10:28 PM EST RTFx = Real-Time Factor (higher is better) • Calculated as: Total audio duration ÷ Total processing time Expected RTFx Performance on Physical M1 Hardware:• M1 Mac: ~28x (clean), ~25x (other) Testing methodology follows HuggingFace Open ASR Leaderboard |
Supertonic3 Smoke Test ✅
Runtime: 0m27s Note: CI VMs lack a physical Neural Engine; the ANE-bucketed VectorEstimator falls back to CPU here. This validates download + variant resolution + synthesis, not ANE residency/perf. |
Sortformer High-Latency Benchmark ResultsES2004a Performance (30.4s latency config)
Sortformer High-Latency • ES2004a • Runtime: 2m 45s • 2026-06-18T02:09:28.329Z |
Speaker Diarization Benchmark ResultsSpeaker Diarization PerformanceEvaluating "who spoke when" detection accuracy
Diarization Pipeline Timing BreakdownTime spent in each stage of speaker diarization
Speaker Diarization Research ComparisonResearch baselines typically achieve 18-30% DER on standard datasets
Note: RTFx shown above is from GitHub Actions runner. On Apple Silicon with ANE:
🎯 Speaker Diarization Test • AMI Corpus ES2004a • 1049.0s meeting audio • 58.1s diarization time • Test runtime: 3m 26s • 06/17/2026, 10:04 PM EST |
VAD Benchmark ResultsPerformance Comparison
Dataset Details
✅: Average F1-Score above 70% |
Split audio longer than the 15s window into overlapping 15s windows (hop = 15s - 3s overlap), decode each independently, and stitch adjacent windows at the seam via token-level longest-common-substring (mergeTokenStreams, mirroring CoherePipeline). Audio <=15s is unchanged (single-window). No model change - each window still sees the fixed 15s contract and the decoder is reset per window. Unblocks >15s datasets (e.g. FDA) that the fixed-window decoder previously truncated. Adds CanaryChunkMergeTests for the seam stitcher.
Summary
Adds NVIDIA Canary-1B-v2 (attention encoder-decoder, AED) as a selectable on-device ASR engine, converted to CoreML and running int4 on the Neural Engine. Canary is a more accurate transcriber than the existing TDT/CTC paths (esp. on hard domains), and this PR also gives it custom-vocabulary support by reusing the existing CTC keyword spotter.
Users pick the engine that fits:
canary(best WER) or the existingctccustom-vocab path (fastest, top keyword recall).What's included
CanaryManager— actor; pipeline: fp32/CPU mel preprocessor → FastConformer encoder → autoregressive transformer decoder + 1024→16384 projection → greedy decode to EOS. Reads the decoder sequence length from the model so a shorter export is picked up automatically.CanaryModels— download/load fromFluidInference/canary-1b-v2-coreml(int4 ANE default / fp16 parity / int8 CPU);CanaryPrecision.CanaryKeywordBooster— custom-vocab support for canary by reusingCtcKeywordSpotter: fuzzy-replace mis-transcribed terms, plus timestamp-guided insertion of keywords canary missed entirely. Precision-protected via a score floor.canary-transcribe(file + LibriSpeech benchmark) andcanary-earnings-benchmark(Earnings22-keywords, OpenBench-comparable WER + keyword P/R/F1).Repo.canary1bV2,ModelNames.Canary, wired intogetRequiredModelNames.CanaryConfigTests(registration / precision / config contract).Benchmarks (int4, Apple Silicon ANE)
LibriSpeech test-clean (≤15s): WER ~1.7%, RTFx ~10.8x.
Earnings22-keywords (full 772 chunks), scored by the same whole-word keyword metric as Argmax's OpenBench:
Both beat Argmax's published parakeet-v2/v3 keyword F1 (0.91 / 0.89). Canary additionally wins WER by ~6 points.
Model conversion
CoreML conversion pipeline lives in the
mobiusrepo (models/stt/canary-1b-v2/coreml/): NeMo→CoreML export, int4/int8 quantization, projection model, validation (byte-exact vs PyTorch greedy decode), HF staging. Models hosted atFluidInference/canary-1b-v2-coreml.Notes / follow-ups
🤖 Generated with Claude Code