From 079c92f84a8a9d17c35aa596337b895d28e503a6 Mon Sep 17 00:00:00 2001 From: pramenku <7664080+pramenku@users.noreply.github.com> Date: Thu, 4 Jul 2024 21:29:32 +0530 Subject: [PATCH 1/4] [dev-upstream] Update llvm path after compiler change Added the logic to add new path from ROCm >=6.3.0 To fix, https://ontrack-internal.amd.com/browse/SWDEV-470815 Pushing https://github.com/ROCm/tensorflow-upstream/pull/2575 to all branches as need. --- third_party/gpus/rocm_configure.bzl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/third_party/gpus/rocm_configure.bzl b/third_party/gpus/rocm_configure.bzl index 7395f73ff4c7a8..95d30d54fc557a 100644 --- a/third_party/gpus/rocm_configure.bzl +++ b/third_party/gpus/rocm_configure.bzl @@ -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) >= 60300: + 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) From 7e398f23510ebdb54dbf21fa4f8b778a9e00a249 Mon Sep 17 00:00:00 2001 From: pramenku <7664080+pramenku@users.noreply.github.com> Date: Thu, 11 Jul 2024 19:10:35 +0530 Subject: [PATCH 2/4] Update rocm_configure.bzl --- third_party/gpus/rocm_configure.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/gpus/rocm_configure.bzl b/third_party/gpus/rocm_configure.bzl index 95d30d54fc557a..68d9821b1f451b 100644 --- a/third_party/gpus/rocm_configure.bzl +++ b/third_party/gpus/rocm_configure.bzl @@ -210,7 +210,7 @@ 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) >= 60300: + 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") From 34a595992c6cf07e990b9b0d47229eddf8670bf4 Mon Sep 17 00:00:00 2001 From: pramenku <7664080+pramenku@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:48:40 +0530 Subject: [PATCH 3/4] Update rocblas_wrapper.h Merging back https://github.com/ROCm/tensorflow-upstream/pull/2572/files --- third_party/xla/xla/stream_executor/rocm/rocblas_wrapper.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/third_party/xla/xla/stream_executor/rocm/rocblas_wrapper.h b/third_party/xla/xla/stream_executor/rocm/rocblas_wrapper.h index 436b3d3692822b..140f464f6956b0 100644 --- a/third_party/xla/xla/stream_executor/rocm/rocblas_wrapper.h +++ b/third_party/xla/xla/stream_executor/rocm/rocblas_wrapper.h @@ -270,7 +270,9 @@ using stream_executor::internal::CachedDsoLoader::GetRocblasDsoHandle; __macro(rocblas_destroy_handle) \ __macro(rocblas_get_stream) \ __macro(rocblas_set_stream) \ - __macro(rocblas_set_atomics_mode) + __macro(rocblas_set_atomics_mode) \ + __macro(rocblas_get_version_string) \ + __macro(rocblas_get_version_string_size) // clang-format on From 59c3f3bbc43531e61d63c8d775b0a19cbc3c20d6 Mon Sep 17 00:00:00 2001 From: pramenku <7664080+pramenku@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:49:51 +0530 Subject: [PATCH 4/4] Update rocm_blas.cc --- third_party/xla/xla/stream_executor/rocm/rocm_blas.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/xla/xla/stream_executor/rocm/rocm_blas.cc b/third_party/xla/xla/stream_executor/rocm/rocm_blas.cc index 837f20bca3e440..f907b944ae3a40 100644 --- a/third_party/xla/xla/stream_executor/rocm/rocm_blas.cc +++ b/third_party/xla/xla/stream_executor/rocm/rocm_blas.cc @@ -1251,16 +1251,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 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)));