danielbodart/nemotron-speech-600m-coreml
Nemotron Speech 600M — CoreML (Streaming)
Native CoreML conversion of nvidia/nemotron-speech-streaming-en-0.6b, a 600M-parameter streaming ASR model using FastConformer encoder + RNNT decoder. Optimized for Apple Neural Engine (ANE) on Apple Silicon.
Converted directly from the original NeMo checkpoint via coremltools, with 3-level numerical validation against the PyTorch reference.
Sibling project: [danielbodart/nemotron-speech-600m-onnx](https://huggingface.co/danielbodart/nemotron-speech-600m-onnx) — ONNX Runtime version for Linux (CUDA + CPU).
Performance
No manual ANE optimizations applied — coremltools compiler routes ops automatically.
Available Precisions
Future: INT8 quantization via coremltools (can halve encoder size on ANE).
Model Architecture
Two CoreML models (decoder and joint network are fused into one):
Mel spectrogram preprocessing runs on the host (not in CoreML).
Important: ANE stride padding
CoreML output MLMultiArrays may have non-contiguous strides due to ANE alignment padding. For example, the encoder output [1, 1024, 7] may have physical strides [32768, 32, 1] instead of C-contiguous [7168, 7, 1]. Callers must use stride-aware copy, not flat memcpy.
Runtime Configuration
All parameters needed to run the model are documented in `config.json`, including I/O specs, cache shapes, the streaming protocol, and ANE profiling results.
Audio Preprocessing
Encoder Streaming
Feed cache outputs back as next chunk's cache inputs. Convert FP16 outputs to FP32 before feeding back (model expects FP32 inputs).
RNNT Decoder
For each encoder output frame: feed single frame [1, 1024, 1] to decoder, argmax logits over 1025 vocab, if not blank emit token and loop (up to 10), if blank move to next frame. Feed decoder states back for next symbol/frame.
Files
config.json # Machine-readable runtime parameters + ANE profile
fp16/
├── encoder.mlmodelc/ # Pre-compiled encoder (load directly with MLModel)
│ ├── model.mil
│ ├── coremldata.bin
│ └── weights/weight.bin
├── encoder.mlpackage/ # Source encoder (for runtime compilation fallback)
│ └── Data/com.apple.CoreML/
│ ├── model.mlmodel
│ └── weights/weight.bin
├── decoder.mlmodelc/ # Pre-compiled fused decoder+joint
├── decoder.mlpackage/ # Source fused decoder+joint
└── metadata.json # Cache shapes, vocab size, model parametersUsage
Download:
# Download compiled models (recommended)
hf download danielbodart/nemotron-speech-600m-coreml fp16/ config.json --local-dir ./model
# Download only .mlmodelc (skip .mlpackage to save space)
hf download danielbodart/nemotron-speech-600m-coreml fp16/encoder.mlmodelc/ fp16/decoder.mlmodelc/ fp16/metadata.json config.json --local-dir ./modelLoad with CoreML (Swift):
import CoreML
let config = MLModelConfiguration()
config.computeUnits = .cpuAndNeuralEngine
let encoder = try MLModel(contentsOf: URL(fileURLWithPath: "model/fp16/encoder.mlmodelc"),
configuration: config)
let decConfig = MLModelConfiguration()
decConfig.computeUnits = .cpuOnly
let decoder = try MLModel(contentsOf: URL(fileURLWithPath: "model/fp16/decoder.mlmodelc"),
configuration: decConfig)Load with CoreML (Python/coremltools):
import coremltools as ct
encoder = ct.models.MLModel("model/fp16/encoder.mlpackage")
decoder = ct.models.MLModel("model/fp16/decoder.mlpackage")Conversion Reproducibility
All conversion and validation scripts are in the companion GitHub repo: [danielbodart/nemotron-speech-600m-coreml](https://github.com/danielbodart/nemotron-speech-600m-coreml)
convert.py— NeMo → CoreML conversion (wrap, trace, convert, compile)validate.py— 3-level validation (wrapper equiv, CoreML vs PyTorch, end-to-end transcript)wrappers.py— PyTorch wrappers (EncoderWrapper, FusedDecoderJointWrapper)
Requires macOS with Apple Silicon, Python 3.10, coremltools 9.0b1.
Related
- [danielbodart/nemotron-speech-600m-onnx](https://huggingface.co/danielbodart/nemotron-speech-600m-onnx) — ONNX Runtime version for Linux (CUDA + CPU, FP16/INT8)
- [nvidia/nemotron-speech-streaming-en-0.6b](https://huggingface.co/nvidia/nemotron-speech-streaming-en-0.6b) — Original NeMo model
License
The original model is licensed under CC-BY-4.0 by NVIDIA.
