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

Integrating cuBLASLt into XLA #55518

Closed
wants to merge 2 commits into from

Conversation

philipphack
Copy link
Contributor

Adds support for the cuBLASLt library for GEMM operations to XLA. The library can be activated by setting the XLA flag xla_gpu_enable_cublaslt=true.

@SandSnip3r can you run the test before merging?

@google-ml-butler google-ml-butler bot added the size:XL CL Change Size:Extra Large label Apr 6, 2022
BlasPlansCompatibleType(element_type)) {
TF_RETURN_IF_ERROR(
DoBlasPlansAutotune(stream, instr, allocator, gemm_config));
return {se::blas::kNoAlgorithm};
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the significance of returning kNoAlgorithm here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The cuBLASLt autotuner operates on se::blas::AlgorithmConfig instead of se::blas::AlgorithmType used in non-cuBLASLt autotuning. As such, the result of cuBLASLt autotuning is incompatible with the return value of DoGemmAutotune and the se::blas::kNoAlgorithm dummy value is returned instead. The outcome of cuBLASLt autotuning is stored in the instance of BlasPlansAutotuneCacheSingleton.

GemmCacheKey key =
std::make_tuple(stream->parent(), lhs->shape(), rhs->shape(),
instr->shape(), gemm_config.SerializeAsString());
if (stream->parent()->SupportsBlasPlans() && config.use_cublaslt &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe slightly pedantic, but we ought to check the flag first, lest SupportBlasPlans has some kind of side effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SupportsBlasPlans() is introduced in this PR and has no side effects. It returns true if the CUDA version is greater than or equal to 11, and false otherwise.

@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Apr 7, 2022
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Apr 12, 2022
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Apr 12, 2022
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Apr 12, 2022
@google-ml-butler google-ml-butler bot removed the ready to pull PR ready for merge process label Apr 12, 2022
@gbaned gbaned requested a review from SandSnip3r April 13, 2022 14:47
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label Apr 13, 2022
@gbaned
Copy link
Contributor

gbaned commented Apr 14, 2022

@philipphack Can you please resolve conflicts? Thank you!

@gbaned gbaned added stat:awaiting response Status - Awaiting response from author and removed awaiting review Pull request awaiting review labels Apr 14, 2022
copybara-service bot pushed a commit that referenced this pull request Apr 14, 2022
@SandSnip3r
Copy link
Contributor

FYI @philipphack, this was merged. I'm not sure why this PR hasn't been updated.

@gbaned gbaned removed the stat:awaiting response Status - Awaiting response from author label Apr 18, 2022
@gbaned
Copy link
Contributor

gbaned commented Apr 18, 2022

Seems auto-merge is not happening but the changes are merged into master now, so we can close this. Thank you for the PR.

@gbaned gbaned closed this Apr 18, 2022
PR Queue automation moved this from Approved by Reviewer to Closed/Rejected Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL CL Change Size:Extra Large
Projects
PR Queue
  
Closed/Rejected
Development

Successfully merging this pull request may close these issues.

None yet

4 participants