PiperSR-2x: ANE-Native Super Resolution for Apple Silicon
Real-time 2x AI upscaling on Apple's Neural Engine. 44.4 FPS at 720p on M2 Max, 928 KB model, every op runs natively on ANE with zero CPU/GPU fallback.
Not a converted PyTorch model — an architecture designed from ANE hardware measurements. Every dimension, operation, and data type is dictated by Neural Engine characteristics.
Key Results
Model
Params
Set5
Set14
BSD100
Urban100
Bicubic
—
33.66
30.24
29.56
26.88
FSRCNN
13K
37.05
32.66
31.53
29.88
PiperSR
453K
37.54
33.21
31.98
31.38
SAFMN
228K
38.00
~33.7
~32.2
—
Beats FSRCNN across all benchmarks. Within 0.46 dB of SAFMN on Set5 — below the perceptual threshold for most content.
Performance
Configuration
FPS
Hardware
Notes
Full-frame 640×360 → 1280×720
44.4
M2 Max
ANE predict 22.5 ms
128×128 tiles (static weights)
125.6
M2
Baked weights, 2.82× vs dynamic
128×128 tiles (dynamic weights)
44.5
M2
CoreML default
Real-time 2× upscaling at 30+ FPS on any Mac with Apple Silicon. The ANE sits idle during video playback — PiperSR puts it to work.
Architecture
453K-parameter network: 6 residual blocks at 64 channels with BatchNorm and SiLU activations, upscaling via PixelShuffle.
Compiles to 5 MIL ops: conv, add, silu, pixel_shuffle, const. All verified ANE-native.
Why ANE-native matters
Off-the-shelf super resolution models (SPAN, Real-ESRGAN) were designed for CUDA GPUs and converted to CoreML after the fact. They waste the ANE:
Misaligned channels (48 instead of 64) waste 25%+ of each ANE tile
Monolithic full-frame tensors serialize the ANE's parallel compute lanes
Silent CPU fallback from unsupported ops can 5-10× latency
No batched tiles means 60× dispatch overhead
PiperSR addresses every one of these by designing around ANE constraints.
Model Variants
File
Use Case
Input → Output
PiperSR_2x.mlpackage
Static images (128px tiles)
128×128 → 256×256
PiperSR_2x_video_720p.mlpackage
Video (full-frame, BN-fused)
640×360 → 1280×720
PiperSR_2x_256.mlpackage
Static images (256px tiles)
256×256 → 512×512
Usage
With ToolPiper (recommended)
PiperSR is integrated into ToolPiper, a local macOS AI toolkit. Install ToolPiper, enable the MediaPiper browser extension, and every 720p video on the web is upscaled to 1440p in real time.
bash
1# Via MCP tool2mcp__toolpiper__image_upscale image=/path/to/image.png
34# Via REST API5curl -X POST http://127.0.0.1:9998/v1/images/upscale \6 -F "image=@input.png"\7 -o upscaled.png
With CoreML (Swift)
swift
1importCoreML23let config =MLModelConfiguration()4config.computeUnits =.cpuAndNeuralEngine // NOT .all — .all is 23.6% slower56let model =tryPiperSR_2x(configuration: config)7let input =tryPiperSR_2xInput(x: pixelBuffer)8let output =try model.prediction(input: input)9// output.var_185 contains the 2× upscaled image
Important: Use .cpuAndNeuralEngine, not .all. CoreML's .all silently misroutes pure-ANE ops onto the GPU, causing a 23.6% slowdown for this model.
Trained on DIV2K (800 training images) with L1 loss and random augmentation (flips, rotations). Total training cost: ~$6 on RunPod A6000 instances. Full training journey documented from 33.46 dB to 37.54 dB across 12 experiment findings.
Technical Details
Compute units:.cpuAndNeuralEngine (ANE primary, CPU for I/O only)
The model weights are CC BY 4.0 — fully permissive. Use them for anything: personal, academic, or commercial. Ship them in your app, build a product, make money with it. The only ask: link back to ModelPiper.com as attribution.
Powered by PiperSR from ModelPiper — https://modelpiper.com