Files
hacksider-Deep-Live-Cam/modules
Max Buckley 890a6d41b6 onnx_optimize: widen scalar Gather indices for CoreML EP
ORT's CoreML EP GatherOpBuilder::IsOpSupportedImpl explicitly rejects
rank-0 (scalar) index tensors. StyleGAN-derived models (GFPGAN's 1024
variant has 16 of them, one per style-code slice) hit this in the
generator, and the resulting CPU fallbacks split the CoreML subgraph
into multiple partitions with boundary crossings on every inference.

Add a load-time ONNX rewrite that promotes each scalar index to [1] and
squeezes the added axis on the Gather output — semantically identical
but CoreML-compatible. GFPGAN now runs as a single CoreML partition with
zero CPU-fallback nodes; inference drops from ~87 ms to ~81 ms on an
M-series Mac.

The fix has been filed upstream as microsoft/onnxruntime#28180 — the
existing code comment in gather_op_builder.cc already describes this
exact workaround, it just isn't applied. Once the upstream fix ships
and the ORT floor is raised, this pass can be deleted.
2026-04-22 14:08:18 +02:00
..
2025-05-13 00:14:49 +08:00
2026-02-12 19:44:04 +08:00
2024-09-10 05:40:55 +05:30
2025-10-12 22:33:09 +08:00
2025-01-07 14:04:18 +08:00
2026-02-12 19:44:04 +08:00
2025-10-12 22:33:09 +08:00
2025-10-12 22:33:09 +08:00
2023-09-24 21:36:57 +08:00
2024-09-19 17:38:02 +08:00
2026-04-09 16:25:22 +08:00