Skip to content

[BLAS - cuBLAS] Fix stream synchronization#228

Merged
mmeterel merged 2 commits intouxlfoundation:developfrom
mmeterel:fix_cublas_sync
Sep 15, 2022
Merged

[BLAS - cuBLAS] Fix stream synchronization#228
mmeterel merged 2 commits intouxlfoundation:developfrom
mmeterel:fix_cublas_sync

Conversation

@mmeterel
Copy link
Contributor

@mmeterel mmeterel commented Sep 14, 2022

Description

With recent LLVM builds, multiple streams (instead of single CUstream) are enabled in each queue - which basically broke the in-order property of the queue. see here
As a result, we no longer had synchronization in cuBLAS streams. This PR is adding synchronization for cuBLAS backend.
Similar fix was implemented for cuSolver in #215

Fixes # (GitHub issue)
#223

Checklist

All Submissions

  • Do all unit tests pass locally?
    fix_cublas_sync.log

  • Have you formatted the code using clang-format?

Copy link
Contributor

@mkrainiuk mkrainiuk left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you!

Copy link
Contributor

@andrewtbarker andrewtbarker left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

CUBLAS_ERROR_FUNC(cublasGetStream, err, handle, &currentStreamId); \
cuStreamSynchronize(currentStreamId);

#define CUBLAS_ERROR_FUNC_T(name, func, err, handle, ...) \
Copy link
Contributor

Choose a reason for hiding this comment

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

Not that important, but I suggest CUBLAS_ERROR_FUNC_T_SYNC here (since it's synchronizing), I think it's more consistent with what we had before and what we did in #215.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I thought about it and got lazy. I will update all the cublas backend files with new macro name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

macro name is updated with _SYNC

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