Comments (15)
The "com.microsoft:EPContext" op is a contrib op, for implementing TensorRT EP.
from onnxruntime.
Thanks for reporting this issue, it seems method AdjustOutputSizeAsPolicy is sometimes excluded if DISABLE_CONTRIB_OPS is on, sometimes not like here https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/core/providers/shared_library/provider_bridge_provider.cc#L586
from onnxruntime.
It indeed builds without onnxruntime_DISABLE_CONTRIB_OPS=ON
. Any tips how to fix it for 1.18.1
?
from onnxruntime.
I submitted a PR for this.
from onnxruntime.
I tried this fix already, but then I could not create CUDAExecutionProvider
:
[E:onnxruntime:Default, provider_bridge_ort.cc:1745 TryGetProviderInfo_CUDA] <redacted>/onnxruntime-1.18.1/onnxruntime/core/session/provider_bridge_ort.cc:1426 onnxruntime::Provider& onnxruntime::ProviderLibrary::Get() [ONNXRuntimeError] : 1 : FAIL : Failed to load library libonnxruntime_providers_cuda.so with error: <redacted>/python3.11/site-packages/onnxruntime/capi/libonnxruntime_providers_cuda.so: undefined symbol: _ZN11onnxruntime4cuda21BuildKernelCreateInfoINS0_57kCudaExecutionProvider_GridSample_kOnnxDomain_ver16_floatEEENS_16KernelCreateInfoEv
which is after demangling
onnxruntime::KernelCreateInfo onnxruntime::cuda::BuildKernelCreateInfo<onnxruntime::cuda::kCudaExecutionProvider_GridSample_kOnnxDomain_ver16_float>()
from onnxruntime.
A side question: may I know why do you need to set onnxruntime_DISABLE_CONTRIB_OPS to ON? The build option is for reducing binary size. However, CUDA itself is already very large. Disabling contrib ops does not help much.
from onnxruntime.
I will update the PR.
from onnxruntime.
I like the smaller size, but I also appreciate the much faster compilation. I think it's more than 2-3 times faster on my PC, and I'm currently compiling for just one CUDA architecture. This difference includes the fact that I can use more threads, as compiling contrib kernels takes up too much RAM.
from onnxruntime.
Would you mind trying it again? Now it should be good.
from onnxruntime.
I applied the patch to version 1.18.1 with TRT 8.6 as described here and CUDAExecutionProvider
works.
Probably not related to the PR:
However, when I run my model for the first time with the TensorRT Execution Provider (EP) and contrib ops disabled, it creates an .engine file and throws the following error:
RUNTIME_EXCEPTION : Exception during initialization: <path>/onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc:127 onnx::ModelProto* onnxruntime::CreateCtxModel(const onnxruntime::GraphViewer&, std::string, char*, size_t, int64_t, std::string, std::string, const onnxruntime::logging::Logger*) graph_build.Resolve().IsOK() was false.
Subsequent runs are successful if the .engine file is present in the cache. However, if I delete the .engine file, it fails again. This issue does not occur when contrib ops are enabled. I will investigate further and maybe open an another issue.
from onnxruntime.
Open onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc, find line 127, replace ORT_ENFORCE with ORT_THROW_IF_ERROR.
The new code should be:
ORT_THROW_IF_ERROR(graph_build.Resolve());
Then please let us know what error message you see.
from onnxruntime.
[E:onnxruntime:, inference_session.cc:2044 operator()] Exception during initialization: <path>/onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc:127 onnx::ModelProto* onnxruntime::CreateCtxModel(const onnxruntime::GraphViewer&, std::string, char*, size_t, int64_t, std::string, std::string, const onnxruntime::logging::Logger*) [ONNXRuntimeError] : 1 : FAIL : Fatal error: com.microsoft:EPContext(-1) is not a registered function/op
from onnxruntime.
Ok .. As it says , it is not supported. You may open a new issue for this error.
from onnxruntime.
The interesting thing is that it will create an .engine file and it works with subsequent runs, until I delete the .engine file, with no errors and correct output.
from onnxruntime.
The issue has been fixed in #20695
from onnxruntime.
Related Issues (20)
- Model saved with offline basic optimizations will not load - ShapeInferenceError HOT 1
- [Training] [ShapeInferenceError] Dimension could not be inferred: incompatible shapes
- [Build] How can I quantize the llama3 model activation to int4 ?
- [Feature Request] ORT-Profiler: Include timestamps for tensor allocations and deallocations. HOT 2
- header files path not recognized or unable to read header file HOT 1
- [Build] AllocatorTest.CUDAAllocatorFallbackTest failed HOT 1
- [Performance] Get nan value when I block all the node in fp16 conversion HOT 6
- [Bug] The per_tensor quantized weight type of matmul is wrong HOT 1
- ONNX Runtime 1.18.1 CUDA 12.4 cuDNN 9.2 breaks inference with repeated inputs when enable_mem_reuse is enabled
- Latest Release(1.18.1) Java Artifacts Unavailable HOT 1
- [Build] C++ API cannot be reliably linked with an program using CMake
- [BUG] CANN: onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError]
- [Build] Cross compilation of the library for ARMv7 32bit target with gcc 8.3 HOT 2
- CUDA 12 and session.get_providers() not showing CUDAExecutionProvider HOT 7
- [Web] Memory access out of bounds / alignment fault
- An error occurred when I installed onnxruntime-qnn in an Arm environment
- [Performance] Multiple Sessions on Same GPU is very slow
- [Models larger than 2GB :(] Specify mid-graph.output after initializing InferenceSession
- [Error] [ONNXRuntimeError] : 1 : FAIL : CUDA failure 3: initialization error HOT 1
- [Build] long paths in NuGet package breaking build on Windows
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.