-
Notifications
You must be signed in to change notification settings - Fork 972
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
Speed drop when running oneDNN in a subthread #1997
Comments
Hi @matiaslin/ From the reproducer shared, it seems that observations based on a single time measurement. Have you tried to perform multiple runs to stabilize performance numbers? I can suggest to reuse this example, build an asynchronous execution and verify using the proposed methodology. Thanks. |
Thanks for the recommendation, @dzarukin. I believe I do execute the matmul primitive multiple times to obtain the results posted above. In the TIME macro, we repeat the expression |
it is, yes. It seems I filtered macro-style variable out... Couple more questions: why do you benchmark creation execution, is it intended? What would be the proof that unintended timing is coming from the library and not from Just to be sure - is it a single threaded version? |
we dont: see that the TIME() macro only measure time for execution
because the TIME macro only repeat and measure the prim exec. |
Please attach the ONEDNN_VERBOSE=1 logs with 20 iteration for both modes. |
I ran with ONEDNN_VERBOSE=1 and REPEAT is set to 20 for both modes. See attached verbose.log. Thank you! |
As oneDNN execution doesn't change for two different modes, and given there are 8 threads, I would expect the async mode introduces a resource issue and eventually over-subscription or something along the lines due to std threading is OMP-unaware. I'd expect those numbers to be aligned once oneDNN is built with a sequential runtime (with some potential delta due to async overhead). |
Tks @dzarukin |
@onednnsupporttriage, would you be able to help with this request? |
Summary
Speed drop when running oneDNN in a subthread.
Version
oneDNN 3.4.2 with GNU OpenMP (4.5)
Environment
3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Steps to reproduce
See attached main.cpp.
main.cpp.txt
Observed behavior
We observe a ~13% speed drop when we perform a oneDNN matmul in a subthread.
Expected behavior
We would expect a similar speed when running in a subthread.
The text was updated successfully, but these errors were encountered: