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

[dev-upstream] Update llvm path + Add wrap interface #2577

Merged
merged 5 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions third_party/gpus/rocm_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ def _rocm_include_path(repository_ctx, rocm_config, bash_bin):
inc_dirs.append(rocm_config.llvm_path + "/lib/clang/17/include")
inc_dirs.append(rocm_config.llvm_path + "/lib/clang/18/include")
inc_dirs.append(rocm_config.llvm_path + "/lib/clang/19/include")
if int(rocm_config.rocm_version_number) >= 60200:
inc_dirs.append(rocm_toolkit_path + "/lib/llvm/lib/clang/17/include")
inc_dirs.append(rocm_toolkit_path + "/lib/llvm/lib/clang/18/include")
inc_dirs.append(rocm_toolkit_path + "/lib/llvm/lib/clang/19/include")

# Support hcc based off clang 10.0.0 (for ROCm 3.3)
rocm_toolkit_path = realpath(repository_ctx, rocm_config.rocm_toolkit_path, bash_bin)
Expand Down
28 changes: 16 additions & 12 deletions third_party/xla/xla/stream_executor/rocm/rocblas_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,22 @@ using stream_executor::internal::CachedDsoLoader::GetRocblasDsoHandle;
__macro(rocblas_gemm_batched_ex_get_solutions) \
__macro(rocblas_gemm_batched_ex_get_solutions_by_type) \
__macro(rocblas_gemm_strided_batched_ex_get_solutions) \
__macro(rocblas_is_managing_device_memory) \
__macro(rocblas_is_user_managing_device_memory) \
__macro(rocblas_set_workspace) \
__macro(rocblas_strsm_batched) \
__macro(rocblas_dtrsm_batched) \
__macro(rocblas_ctrsm_batched) \
__macro(rocblas_ztrsm_batched) \
__macro(rocblas_create_handle) \
__macro(rocblas_destroy_handle) \
__macro(rocblas_get_stream) \
__macro(rocblas_set_stream) \
__macro(rocblas_set_atomics_mode)
__macro(rocblas_strsm_batched) \
__macro(rocblas_dtrsm_batched) \
__macro(rocblas_ctrsm_batched) \
__macro(rocblas_ztrsm_batched) \
__macro(rocblas_create_handle) \
__macro(rocblas_destroy_handle) \
__macro(rocblas_get_stream) \
__macro(rocblas_set_stream) \
__macro(rocblas_set_atomics_mode) \
__macro(rocblas_get_version_string) \
__macro(rocblas_get_version_string_size) \
__macro(rocblas_is_managing_device_memory) \
__macro(rocblas_is_user_managing_device_memory) \
__macro(rocblas_set_workspace) \
__macro(rocblas_create_handle)


// clang-format on

Expand Down
6 changes: 3 additions & 3 deletions third_party/xla/xla/stream_executor/rocm/rocm_blas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1259,16 +1259,16 @@ IMPL_DoBlasGemmBatched(float, wrap::rocblas_sgemm_strided_batched)
}

absl::Status ROCMBlas::GetVersion(std::string *version) {
#if TF_ROCM_VERSION >= 60300 // Not yet available in ROCM-6.1
#if TF_ROCM_VERSION > 60100 // Not available in ROCM-6.1
absl::MutexLock lock{&mu_};
size_t len = 0;
if (auto res = rocblas_get_version_string_size(&len);
if (auto res = wrap::rocblas_get_version_string_size(&len);
res != rocblas_status_success) {
return absl::InternalError(
absl::StrCat("GetVersion failed with: ", ToString(res)));
}
std::vector<char> buf(len + 1);
if (auto res = rocblas_get_version_string(buf.data(), len);
if (auto res = wrap::rocblas_get_version_string(buf.data(), len);
res != rocblas_status_success) {
return absl::InternalError(
absl::StrCat("GetVersion failed with: ", ToString(res)));
Expand Down
Loading