Skip to main content
Each model conversion in möbius follows a three-step workflow: export, validate, quantize. The scripts and dependencies are self-contained per model directory.

Workflow

Step 1: Export

Each model directory contains a conversion script (e.g., convert-parakeet.py, convert-coreml.py). The script:
  1. Loads the original PyTorch / NeMo / ONNX model
  2. Traces or scripts the model with fixed input shapes
  3. Converts to CoreML using coremltools
  4. Saves .mlpackage files

Fixed Input Shapes

CoreML requires static shapes at export time. Each model defines its input contract:

Step 2: Validate

Parity scripts run the PyTorch and CoreML models side-by-side on identical inputs, comparing outputs numerically and measuring latency.
This produces:
  • Numerical diff — max absolute error, max relative error, match/no-match per component
  • Latency comparison — Torch CPU vs CoreML (CPU+ANE) with speedup ratios
  • Plots — visual comparisons saved to plots/ directory
  • metadata.json — structured results for CI and reporting

Example Parity Results (Parakeet TDT v3)

Step 3: Quantize (Optional)

Quantization reduces model size and can improve latency on ANE. The sweep evaluates multiple strategies and reports the trade-offs.

Quantization Strategies

Results are saved to quantization_summary.json with per-component quality scores (1.0 = identical to baseline).

Common CoreML Modifications

PyTorch models often need modifications for CoreML tracing. Common patterns:

Adding a New Model

  1. Create the directory: models/{class}/{name}/coreml/
  2. Add pyproject.toml with dependencies
  3. Write convert-*.py — export script
  4. Write compare-*.py — validation script (optional but recommended)
  5. Add README.md documenting the conversion
  6. Push converted weights to Hugging Face

Deployment Targets

  • Minimum: iOS 17 / macOS 14
  • Format: MLProgram (.mlpackage for development, .mlmodelc for compiled)
  • Compute units: Models traced with CPU_ONLY for determinism; runtime compute units set when loading (.cpuAndNeuralEngine, .cpuAndGPU, .all)