Skip to content
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

hipblaslt-bench performance improvements #1202

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

pghysels
Copy link

@pghysels pghysels commented Oct 3, 2024

This improves performance of hipblaslt-bench when timing a large number of matmuls.

There are 2 main changes

  • Initialization of A, B and C matrices is done on the device instead of the host. This also avoids the hipMemcpy from host to device. But when a host copy is needed for the correctness check, the device matrix is still copied back to the host.
  • A memory pool to reuse memory allocated with hipMalloc/hipMallocManaged or hipHostMalloc. This might slightly increase memory use.

Both changes together significantly improve performance.
I have a test yaml input file with ~500K tests.
With these changes, the code runs in ~42 minutes, compared to 8 hours before (on MI300).

I initially used rocRAND, but then removed this dependency. I can add that back if it is preferred over my own naive random number generator.

This is based on a commit by @bethune-bryant

@jichangjichang
Copy link
Collaborator

Do we have the execution time of hipblaslt-test with/wo this PR?

@pghysels
Copy link
Author

pghysels commented Oct 4, 2024

With these changes ./hipblaslt-test took

real    19m58.491s
user    35m32.051s
sys     0m38.180s

while the develop branch took

real    21m12.295s
user    114m49.692s
sys     2m34.752s

On an MI210, 16 OpenMP threads.

Copy link
Contributor

@bethune-bryant bethune-bryant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is significantly speeding up my benchmark collection!
Thank you for getting this finished!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants