-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[ONNXRuntimeError] Non-zero status code returned while running SkipLayerNormalization node. #4779
Comments
Looks like there is some bug in the optimizer script. @tianleiwu |
Remove [line 91-92], it work for me. And i also change :
to if input.name in ["segment_ids:0", "input_mask:0", "input_ids:0"]:
But i find that model.optimizer.onnx this model does not faster than model.onnx. My tinybert model is 2-transformer layers with 12 heads and 120 hidden_dim. |
Thanks for reporting the issue. The cause of the error is a path in ONNX graph like the following:
The correct one:
For normal BERT graph, the Reshape will be removed in postprocess. However, for this model, the optimizer failed to fuse Attention and EmbedLayerNormalization (because subgraph pattern is different) so the Reshape node has not been removed. |
@tianleiwu |
meet the same error when i was used bert-base |
After changing the codes @colourful-tree referred to, still got the same error. process_embedding: Create Embedding node |
add this option in the |
This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details. |
same error here - Onnx is becoming stale! |
Describe the bug
I am trying to follow this tutorial to transfer my 2 layer bert into ONNX and optimize with
onnxruntime_tools
.It works smoothly when I transfer my tf model from .pb to .onnx.
Urgency
If there are particular important use cases blocked by this or strict project-related timelines, please share more information and dates. If there are no hard deadlines, please specify none.
System information
To Reproduce
I follow this tutorial https://github.com/microsoft/onnxruntime/blob/master/onnxruntime/python/tools/transformers/notebooks/Tensorflow_Keras_Bert-Squad_OnnxRuntime_CPU.ipynb
it works well for tf epxorted model --> export ONNX model --> inference --> export Optimized ONNX mdoel.
However it doesnt work after I
optimize_model
the optimization remove one redundant input "label_ids_1:0"
The following step would give me error on CPU
I uploaded my model here https://drive.google.com/drive/folders/1S7ekooSbXAu6UuyynW5RyGmL1FKtoYqh?usp=sharing
Expected behavior
Expect to give me a loss like non-optimized one, and much faster 👍
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here. If the issue is about a particular model, please share the model details as well to facilitate debugging.
The text was updated successfully, but these errors were encountered: