-
Notifications
You must be signed in to change notification settings - Fork 58
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
Benchmarking GPU vs. CPU: Unexpected Results #11
Comments
This is normal behavior when running the very first inferences on the GPU. During startup, the CPU has to prepare and prime the GPU by copying the inputs, which, in turn, increases the execution time. When you run additional inferences after the first, things appear to go fast as expected. Quote from the ONNX runtime Docs about CPU vs GPU execution
As the docs also states, this can be addressed by allocating memory to the GPU prior to execution. I'm currently adding a new option to YoloDotNet to prime the GPU with allocated memory before execution. In my own tests with my RTX 3060, I get these approx results for the first inference: Classification, ex:
Object Detection, ex:
|
Wow! That's impressive! Thanks for the explanation. I will certainly download the new version as soon as it becomes available. |
Originally posted by @niclasastrom in #9 (comment)
The text was updated successfully, but these errors were encountered: