chore: change default static input shapes for coreml#206
chore: change default static input shapes for coreml#206jamjamjon merged 1 commit intojamjamjon:mainfrom
Conversation
|
@wep21 Hi, thanks a lot for the PR and for working on the CoreML integration — really appreciate it 🙏 I agree that enabling static input shapes can improve CoreML performance in cases where input shapes are fixed. That said, I wanted to double-check one scenario before merging this: in this project we also support super-resolution models, where the input My understanding is that forcing static_input_shapes = true in such cases may cause CoreML EP to skip parts of the graph (or even the whole graph) and fall back to CPU, potentially hurting performance — but I’d like to confirm this with you. Have you tested this configuration with dynamic-resolution inputs (e.g. SR models with varying image sizes)? If so, I’d be very interested in the results. In the meantime, I’ll also take a closer look at the relevant CoreML / ORT APIs to better understand the exact behavior here. Thanks again for the contribution! |
|
I've encountered some error when trying some error, so I've applied static shape to all examples, some may not cause error though. dwpose rtdetr
I will try this configuration. |
|
@wep21 Hi! I made some tests and all tests were performed on Apple M4 Mac mini using ONNX Runtime CoreML Execution Provider. Overview
Detailed Findings1. DWpose (Pose Estimation)
Conclusion: 2. YOLO v26 (Object Detection)
Conclusion: 3. RT-DETR v4 (Transformer-based Detector)
Conclusion: Overall Conclusions
Recommendation
Additional NotesThank you very much for the PR — I really appreciate you taking the time to investigate this and propose a solution. Enabling That said, I think the current implementation is a bit more complex than necessary. To make this easier to maintain and more consistent with the existing config design, we can configure the CoreML ONNX engine more directly using the following APIs:
These options provide a simpler and more explicit way to enable static input shapes for CoreML. In addition to the three configuration APIs listed above, another option would be to change the default behavior and enable Lines 73 to 86 in 55ed111 If you’re interested, you’re very welcome to update the PR to take this approach, or we can iterate on it together. I’d be happy to review and help refine the change. Thanks again for the contribution! |
Signed-off-by: wep21 <daisuke.nishimatsu1021@gmail.com>
|
@jamjamjon Thank you for the further investigation and detailed implementation suggestion. |
Uh oh!
There was an error while loading. Please reload this page.