BiRefNet-lite runs fully on a phone NPU at 1024px in 23.7ms on Snapdragon 8 Elite Gen 5, open weights

subhashg547 · reddit · 2026-11-15

An independent researcher rewrote BiRefNet-lite to run tap-to-lift subject cutout entirely on a phone NPU. The original wouldn't compile: 20 deformable convs, 5D/6D Swin tensors, cyclic-shifted windows, and 1024px activations exceeding on-chip memory.

Approach: exact graph rewrites (identical output) — 4D window partition, roll-free shifted windows, per-head attention; architecture changes — plain convs instead of deformable, 640px backbone with 1024px mask from two inputs, a slim full-res tail, one global window in Swin stage 4; fully 8-bit QAT distillation through the exported NPU graph.

Results: 23.7ms for 1024×1024 masks on a Galaxy S26 (Snapdragon 8 Elite Gen 5), 31.1ms on S25, 182ms on a mid-range 7 Gen 1 — all 2,060 layers on NPU. Stock BiRefNet-lite OOMs at 1024px and falls back to CPU at 512px (677ms, 2.1GB). The int8 model matches its fp32 teacher on held-out ECSSD/DUT-OMRON S-measure.

Gotcha: during distillation a sigmoid gate on the deepest decoder branch saturated to 1e-11 and the branch died silently — the mask loss showed nothing because the rest compensated. Restored from teacher with a feature loss.

Weights, compiled files for 42 Snapdragon chips, and code are MIT-licensed on GitHub/HF. The author is also seeking a CS endorsement for arXiv.

Original post →

More from Infra

Infra channel →