-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DML EP takes very long time and not exit compiling #21255
Comments
Did you try to disable all optimizations? You may also try to run shape inference on the model and save it https://onnx.ai/onnx/api/shape_inference.html with shape information before loading it into onnxruntime. The function taking time seems to be related to graph fusion. You can disable it with one the session option listed here https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/core/providers/dml/dml_session_options_config_keys.h and this method https://onnxruntime.ai/docs/api/python/api_summary.html#onnxruntime.SessionOptions.add_session_config_entry. How did you generate the model? Maybe it can be optimized before onnxruntime gets it. About the file you shared, you don't need to share the weights as well, only the file *.onnx is needed. |
Hi @xadupre I tried to add this config We use the torch export , I'm not sure it can be optimized by torch export or not and the original model downloaded from huggingface with following code import torch |
Hi @xadupre Is this compiling issue can be fixed ? |
This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details. |
Describe the issue
When use test data to do ort.InferenceSession, takes time and not exit
To reproduce
use the onnx file put in google drive
https://drive.google.com/file/d/1y-evMcenYe-Q0JpyQvuwO0YHBX8gSSBE/view?usp=sharing
import numpy as np
import onnxruntime as ort
EP_list = ['DmlExecutionProvider']
sess_opt = ort.SessionOptions()
sess_opt.log_severity_level = 0
sess_opt.graph_optimization_level = ort.GraphOptimizationLevel.ORT_ENABLE_BASIC
sess = ort.InferenceSession("text_encoder_3.onnx", sess_opt, providers=EP_list)
use win debug see that the system is doing TryCreateCompiledOperator (see attached picture)
No matter use Nvida 3080TI or AMD 7900XTX, the problem is same.
Urgency
Urgent
Platform
Windows
OS Version
Windows 11 Pro OS build 22631.3593
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.18.0
ONNX Runtime API
Python
Architecture
X64
Execution Provider
DirectML
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: