Compute Units
CoreML models can target different hardware accelerators on Apple devices:Neural Engine
Specialized ML accelerator (fastest, most efficient)
GPU
Graphics processor (good balance)
CPU
Central processor (most compatible)
ModelComputeOptions
Configure compute units for each model component:Available Compute Units
MLComputeUnits
CPU only - most compatible, slowest
MLComputeUnits
CPU and GPU - good for macOS < 14
MLComputeUnits
CPU and Neural Engine - recommended for macOS 14+, iOS 17+
MLComputeUnits
All available compute units - lets CoreML decide
Recommended Configurations
- macOS 14+ (Recommended)
- macOS 13 and Earlier
- iOS 18+
- Low Memory
CLI Configuration
Set compute units via command-line:Model Selection
Model size significantly impacts speed and accuracy:39M parameters
Speed: ~32x real-time | WER: ~10-15% | Size: ~75 MBBest for: Real-time applications, low-end devices, quick prototyping
74M parameters
Speed: ~16x real-time | WER: ~8-12% | Size: ~142 MBBest for: Balanced speed/quality, general transcription
244M parameters
Speed: ~6x real-time | WER: ~5-8% | Size: ~466 MBBest for: Production applications requiring accuracy
769M parameters
Speed: ~2x real-time | WER: ~4-6% | Size: ~1.5 GBBest for: High-accuracy requirements, offline processing
1550M parameters
Speed: ~1x real-time | WER: ~3-5% | Size: ~3 GBBest for: Maximum accuracy, multilingual, post-processing
Distil Models
Distilled models offer 2-3x speedup with minimal accuracy loss:Decoding Options
Temperature and Sampling
Control randomness and diversity:Float
default:"0.0"
0.0: Deterministic (always pick most likely token)0.0 - 1.0: Increasing randomness- Higher values = more creative but less accurate
Int
default:"5"
Number of top candidates to sample from when temperature > 0
Fallback Strategy
Automatically retry failed segments:Quality Thresholds
Detect and reject poor transcriptions:Timestamp Control
Parallel Processing
Concurrent Workers
Process multiple audio segments in parallel:Chunking Strategy
- Automatically splits audio at silence
- Reduces unnecessary processing
- Better for long audio with pauses
- Slightly slower initialization
- Process entire audio file
- Faster for short clips
- May hit token limits on very long audio
Prefill Optimization
KV Cache Prefill
Accelerate initial decoding with cached key-value pairs:Prefill reduces first-token latency by 2-3x but requires compatible models with prefill data.
Language and Task Prefill
- Language is specified
- Task is
.translate - Custom prompt tokens provided
Memory Management
Model Prewarming
Reduce peak memory during model loading:What is prewarming?
What is prewarming?
CoreML models need “specialization” on first load (compiling for your device). This specialized cache is maintained by Apple but evicted after OS updates.With prewarm=true:
- Models loaded sequentially
- Each model unloaded after specialization
- Lower peak memory (1 model at a time)
- 2x longer load time if cache is hit
- Models loaded in parallel
- Higher peak memory (all models + compilation)
- Faster load time when cache is hit
Performance Metrics
Real-Time Factor
Tokens Per Second
Speed Factor
Platform-Specific Tips
macOS
M1/M2/M3 Optimization
iOS/iPadOS
iPhone/iPad Optimization
watchOS
Benchmarking
Measure performance on your target devices:- WhisperKit Benchmarks Space
- Local:
fastlane/benchmark_data/
Optimization Checklist
1
Choose the right model
Start with
small for balance, tiny for speed, large-v3 for accuracy2
Configure compute units
Use
.cpuAndNeuralEngine on macOS 14+ and iOS 17+3
Enable prefill caching
Set
usePrefillCache = true for faster first-token generation4
Adjust concurrent workers
16 on macOS, 4 on iOS for optimal parallelism
5
Use VAD chunking
Enable
chunkingStrategy = .vad for long audio files6
Tune quality thresholds
Lower thresholds for better quality, higher for speed
7
Monitor metrics
Track real-time factor and tokens per second
8
Test on target devices
Always benchmark on actual hardware
Next Steps
Memory Management
Advanced memory optimization strategies
Custom Models
Fine-tune models for your domain