-
Notifications
You must be signed in to change notification settings - Fork 238
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
Performance issues about tf.function #58
Comments
Can you explain why you've tagged me in this issue please? |
ok, sorry. |
Thank you for sharing! It's a library dependency so this part wasn't written by me. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! Our static bug checker has found a performance issue in ONNX/lambda-onnx/onnxruntime/transformers/benchmark.py:
run_with_tf_optimizations
(1),(2),(3) is repeatedly called in a for loop, but there is a tf.function decorated functionrun_in_graph_mode
defined and called inrun_with_tf_optimizations
.In that case, when
run_with_tf_optimizations
is called in a loop, the functionrun_in_graph_mode
will create a new graph every time, and that can trigger tf.function retracing warning.Similar problems in ONNX-ARM/lambda-onnx-arm-3.8/onnxruntime/transformers/benchmark.py.
Here is the tensorflow document to support it.
Briefly, for better efficiency, it's better to use:
than:
Looking forward to your reply.
The text was updated successfully, but these errors were encountered: