Repository navigation
fix(sensevoice): pad to the lengths the loaded encoder accepts, so fp32 runs - #1096
Conversation
…32 runs The fp32 encoder has one fixed 1800-frame input, but the manager padded every input to the fp16 buckets, so every --fp32 call failed in Core ML. The accepted lengths now come from the encoder's own input description.
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 • 36.8s diarization time • Test runtime: 2m 54s • 11/01/2026, 04:08 PM EST |
Parakeet EOU Benchmark Results ✅Status: Benchmark passed Performance Metrics
Streaming Metrics
Test runtime: 1m53s • 11/01/2026, 04:25 PM EST RTFx = Real-Time Factor (higher is better) • Processing includes: Model inference, audio preprocessing, state management, and file I/O |
PocketTTS Smoke Test ✅
Runtime: 0m28s 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. |
VAD Benchmark ResultsPerformance Comparison
Dataset Details
✅: Average F1-Score above 70% |
Why is this change needed?
Every
SenseVoiceEncoderPrecision.fp32transcription fails. The fp32 encoder (SenseVoiceSmall_fp32.mlmodelc) has one fixed[1, 1800, 560]input, butrunEncoderpads to the fp16 encoder's buckets (SenseVoiceConfig.buckets), so Core ML rejects it:Found while reviewing #1082, on FLEURS
en_uswithfluidaudiocli sensevoice-transcribe <wav> --fp32.What changes?
SenseVoiceManagerreads the lengths its encoder'sspeechinput accepts from the model description once, at init:It then pads to the smallest one that fits.
Verification (macOS 27, M5 Pro, cached HF models)
--fp32now transcribes. It decodes FLEURSen_us_0001anden_us_0002correctly; the fp16 encoder returns empty text on those clips (below).SenseVoiceEncoderFrameCountsTests, gated on the cached models: fp16 resolves toSenseVoiceConfig.buckets, fp32 to[1800], and fp32 transcribes the real 16.9 s fixture. 11 SenseVoice tests pass.Not fixed here
The fp16 and int8 encoders output all-NaN
ctc_logitson some clips (2 of 6 FLEURS en clips), so the transcript and tags come back empty. It depends on the content, happens on every compute unit, and the fp32 encoder is clean. That needs a fixed fp16 conversion, not a host change.🤖 Generated with Claude Code