Views
No views yet
| Input | mix [1, 2, 343980] fp32 (stereo, 44.1 kHz, 7.8 s chunk) |
| Output | sources [1, 8, 343980] fp32 |
| Channel layout | drums(0,1), bass(2,3), other(4,5), vocals(6,7) |
| Precision | fp32 (FLOAT16 catastrophically destroys spectral reconstruction; do not retry) |
| Compute units | .all (CPU+GPU) on macOS 15+ — GPU dispatch verified working without watchdog issues. ANE compiler rejects the loop-unrolled ISTFT graph and falls back to CPU, so .cpuAndNeuralEngine is no faster than CPU-only; use .all to let GPU take the bulk. |
| Throughput | 3.9× faster on GPU vs CPU: warm chunk latency 0.18 s (.all) vs 0.70 s (.cpuOnly) on M1 Ultra. End-to-end ~42× real-time at .all, ~11.5× at .cpuOnly. |
| File size | ~405 MB unzipped, ~395 MB zipped |
| Stem | SI-SDR (dB) |
|---|---|
| drums | 73.66 |
| bass | 62.56 |
| other | 77.91 |
| vocals | 68.47 |
1let config = MLModelConfiguration()
2config.computeUnits = .cpuOnly // required — see "CPU_ONLY" above
3
4let model = try MLModel(
5 contentsOf: URL(fileURLWithPath: "htdemucs.mlpackage"),
6 configuration: config
7)
8
9// Input: MLMultiArray, shape [1, 2, 343980], fp32
10// Output: MLMultiArray, shape [1, 8, 343980], fp32
11// Stems are paired stereo channels in order: drums, bass, other, vocals.patch_segment_to_float — Fraction(39, 5) → 7.8 (tracer rejects int(Fraction))patch_spec_slice_on_real — slice real tensor before reconstructing complex (coremltools 9's slice rejects complex64)patch_multihead_attention — explicit SDPA path (avoids _native_multi_head_attention)patch_mask_no_view_as_complex — torch.complex(real, imag) instead of view_as_complex + stride-slicepatch_ispec_manual_istft — manual ISTFT via torch.fft.irfft + loop-unrolled overlap-add (torch.istft not registered)patch_crosstransformer_pos_embedding — deterministic shift=0 (avoids random.randrange in graph)