Comments (2)
COREML_FLAG_USE_CPU_ONLY results in CoreML executing the same nodes using its reference CPU implementation. We set this as the MLModelConfiguration.computeUnits. The rest of the ORT CoreML EP code runs exactly the same. That would strongly suggest an issue with the internal CoreML handling of a large input when running on GPU/NPU.
COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES is applied on a per-node basis. Parts of the model may have fixed shapes leading to CoreML executing them. If you set the session logging severity to VERBOSE it will print out details of which nodes are/aren't assigned to CoreML. That would at least narrow down which CoreML operator could be going wrong.
from onnxruntime.
This appears to be a CoreML NeuralNetwork specific problem. There are only a few Div and Sub nodes assigned to CoreML as the rest have dynamic input shapes. Most of those produce the expected output.
There are 2 Div nodes (Div_185 and Div_143) that end up doing 2 / (2048 - 1) (one for the height and one for the width). For some reason the NeuralNetwork Div is somewhat inaccurate for this floating point operation.
Python as a reference (double precision):
2.0 / 2047.0 = 0.0009770395701025891
EP | Value name | Value |
---|---|---|
CPU EP | Mul_340 | 0.00097703957 |
CoreML NeuralNetwork | Mul_340 | 0.00097751617 |
CoreML ML Program | Mul_340 | 0.00097703957 |
That difference must become significant across all the other downstream operations in the model, leading to the output discrepancies. I would guess it comes down to floating point inaccuracies from 2 divided by a large number as to why smaller numbers for the height or width don't trigger the issue.
from onnxruntime.
Related Issues (20)
- ORT 1.18.1 Release Candidates available for testing HOT 3
- [Build] "utf8_range::utf8_validity" does not exist HOT 5
- QDQ removal optimization from around MaxPool changes results with negative scale
- [Mobile] Cocoapods release archive zips are missing HOT 5
- Cannot create arena allocator with Environment::CreateAndRegisterAllocator on MAC M2 with clang HOT 1
- [Build] How to build for Android armeabi platform? HOT 1
- Issue with performing shape inference using symbolic_shape_infer.py with Phi-3 ONNX Models HOT 4
- [Performance] Mapfile support for certain external data files is not working HOT 1
- [Documentation] Setup the CUDA Environment is not detailed enough HOT 1
- [Documentation] phi-3 vision tutorial lacks samples for languages that are actually used for desktop development. HOT 1
- [Build] Build python interface for Onnxruntime-qnn on aarch64 Linux HOT 11
- [Build] ‘struct onnxruntime::ProviderHostCPU’ has no member named ‘UpsampleBase__AdjustOutputSizeAsPolicy’ when CONTRIB ops are disabled. HOT 15
- Initialization crash using OnnxRuntime 17.0 (previously working on 16.3)
- [Web] `Error: using ceil() in shape computation is not yet supported for AveragePool` HOT 2
- ORT 1.18 crashes on exit after using Cuda EP to run inference on a specific model HOT 2
- [Transformers Optimizer] CLIP-ViT encoder attention not getting fused HOT 4
- [Documentation] How Configure CUDA 12.* and cuDNN for GPU with ONNX Runtime and C# on Windows 11 HOT 6
- Onnx Model run failed in a loop HOT 2
- [Mobile] QNN HTP Backend Setup on Android Device
- onnxruntime-gpu not working with my gpu / setup HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onnxruntime.