-
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
DirectML error: The parameter is incorrect with KBNet S #21583
Comments
Additional InfoThe issue can also be reproduced using C++ with ONNXRuntime and the DirectML provider. Through debugging, I've discovered that the issue is coming from the graph fusion system. Specifically, when it attempts to process |
I wonder if specifying a lower optimization level like GraphOptimizationLevel like |
I've just confirmed that setting the optimisation level to
Interestingly, if I change the optimisation level to
That error message shows the node in which the exception is being thrown, which I mentioned in my previous message. |
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. |
@fdwr is there any more information I can provide that would help with diagnosing/fixing this? |
Are there any DirectML debug layer messages, if you enable it? |
Here's the output with the debug layer enabled:
|
Oooh, so there's a 5D matmul in this model then?
Would you know if there's an upload on HuggingFace or elsewhere of the direct .onnx model? I've not actually encountered a 5D matmul before in ONNX models, and |
No, the authors only provide the PTH files. I'll see if I can post it somewhere so you can download the ONNX file. Edit: |
|
Let me know if there's anything else I can do to help. |
Reduced to minimal repro, a single operator .onnx file: minimal-repro.zip Opened bug for DirectML.dll. I'll see what the response is, but in the meantime, we should probably attempt to flatten the leading dimensions when >4D here https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorGemm.cpp#L36. Cheers TotK fan. |
See also #21875 |
Note: This seems to have been fixed after upgrading to DirectML.dll 1.15.1. I have verified that the failures I reported above now all work. |
@fdwr out of interest: is there a way to track the bug that you opened for DirectML? |
@marovira: It's internal, but I can confirm that a teammate is working on it and looking at the change now. So there shouldn't need to be a need to update the ORT DML EP when DML directly supports it. |
@fdwr That's great! Thanks for letting me know. Looking forward to when the fix is available. |
Describe the issue
When trying to run KBNet-S (see here) using ONNXRuntime with DirectML, an error occurs during the creation of the session that reads:
This issue does not appear when trying to run using the CPU execution provider.
To reproduce
Create a new virtual environment and run:
Then copy the following files from the KBNet repo:
Open
kbnet_s_arch.py
and modify the imports as follows:Next, download
sidd.pth
into the same directory from hereFinally, create a new file called
test.py
with the following code:Run with
python3 test.py
and see that it fails when trying to create the session. If instead the providers are set toproviders=["CpuExecutionProvider"]
orproviders=["CpuExecutionProvider, DmlExecutionProvider"]
, the session is created correctly.Urgency
Medium urgency. This is blocking a research task I'm currently working on and the deadline is coming up fast. I can work around the issue for now by using the CPU, but I need the GPU for performance reasons.
Platform
Windows
OS Version
Windows 11
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.18.1
ONNX Runtime API
Python
Architecture
X64
Execution Provider
DirectML
Execution Provider Library Version
DirectML 1.14.1.0
The text was updated successfully, but these errors were encountered: