CoreML: Add support for Pad with 'reflect' for ML Program#28073
CoreML: Add support for Pad with 'reflect' for ML Program#28073skottmckay merged 16 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds CoreML EP (ML Program) support for Pad with mode="reflect" and introduces regression coverage around CoreML model loading/padding behavior.
Changes:
- Enable Pad op builder support for ML Program and implement MIL
padop wiring forconstant/reflect. - Tighten/adjust Pad support checks (mode gating, reflect constraints).
- Add a new CoreML EP test covering
Pad(mode=reflect)with ML Program.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| onnxruntime/test/providers/coreml/coreml_basic_test.cc | Adds a new ML Program Pad(mode=reflect) regression test alongside existing CoreML tests. |
| onnxruntime/core/providers/coreml/builders/impl/pad_op_builder.cc | Implements ML Program path for Pad (including reflect) and updates support checks/initializer skipping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ssion test Agent-Logs-Url: https://github.com/microsoft/onnxruntime/sessions/93f6c70a-6288-4790-a265-f95f6f793843 Co-authored-by: skottmckay <979079+skottmckay@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/onnxruntime/sessions/93f6c70a-6288-4790-a265-f95f6f793843 Co-authored-by: skottmckay <979079+skottmckay@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/onnxruntime/sessions/93f6c70a-6288-4790-a265-f95f6f793843 Co-authored-by: skottmckay <979079+skottmckay@users.noreply.github.com>
|
/azp run Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Linux QNN CI Pipeline |
|
Azure Pipelines successfully started running 4 pipeline(s). |
|
/azp run Windows GPU Doc Gen CI Pipeline |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@copilot resolve the merge conflicts in this pull request |
# Conflicts: # onnxruntime/test/providers/coreml/coreml_basic_test.cc Co-authored-by: skottmckay <979079+skottmckay@users.noreply.github.com>
Resolved in b6e58ca by merging latest |
|
/azp run Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Linux QNN CI Pipeline |
|
Azure Pipelines successfully started running 3 pipeline(s). |
…xruntime into skottmckay/GH28022
…han two dimensions only supports constant mode"
|
Verified this works for me in my application. Thanks a lot! :) |
…uting Bundles CoreML graph rewrites, GPU-accelerated pipeline work, Windows CUDA fixes, and Mac/Windows runtime routing into a single drop. CoreML (Apple Silicon): - Decompose Pad(reflect) → Slice+Concat in inswapper_128 so the model runs in one CoreML partition instead of 14 (TEMPORARY: fixed upstream in microsoft/onnxruntime#28073, drop when ORT >= 1.26.0). - Fold Shape/Gather chains to constants in det_10g (21ms → 4ms). - Decompose Split(axis=1) → Slice pairs in GFPGAN (155ms → 89ms). - Route detection model to GPU so the ANE is free for the swap model. - Centralize provider/config selection in create_onnx_session. Pipeline (all platforms): - Parallelize face landmark + recognition post-detection; skip landmark_2d_106 when only face_swapper is active. - Pipeline face detection with swap for ANE overlap. - GPU-accelerated paste_back, MJPEG capture, zero-copy display path. - Standalone pipeline benchmark script. Windows / CUDA: - CUDA graphs + FP16 model + all-GPU pipeline for 1080p 60 FPS. - Auto-detect GPU provider and fix DLL discovery for Windows CUDA execution. Cross-platform: - platform_info helper for Mac/Windows runtime routing. - GFPGAN 30 fps + MSMF camera 60 fps with adaptive pipeline tuning. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Description
Add support for 'reflect' if ML Program is enabled. Uses the CoreML implementation directly.
Motivation and Context
#28022