From 41581ddb11b64c3768dff98d8686a85d18451266 Mon Sep 17 00:00:00 2001 From: Harsha HS Date: Thu, 12 Mar 2026 18:01:52 -0500 Subject: [PATCH 1/4] Add both absolute and relative rocm paths to include clang headers --- third_party/gpus/rocm_configure.bzl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/third_party/gpus/rocm_configure.bzl b/third_party/gpus/rocm_configure.bzl index ffc2ca9c9d4c08..7c8c197448fd3a 100644 --- a/third_party/gpus/rocm_configure.bzl +++ b/third_party/gpus/rocm_configure.bzl @@ -140,10 +140,16 @@ def _rocm_include_path(repository_ctx, rocm_config, bash_bin): if resource_dir_result.return_code: auto_configure_fail("Failed to run hipcc -print-resource-dir: %s" % err_out(resource_dir_result)) - resource_dir = resource_dir_result.stdout.strip() + resource_dir_abs = resource_dir_result.stdout.strip() + + resource_dir_rel = relative_to(repository_ctx, str(rocm_path.realpath), resource_dir_abs, bash_bin) + + resource_dir = str(rocm_path.get_child(resource_dir_rel)) inc_dirs.append(resource_dir + "/include") inc_dirs.append(resource_dir + "/share") + inc_dirs.append(resource_dir_abs + "/include") + inc_dirs.append(resource_dir_abs + "/share") return inc_dirs From 395c6b35e2d60dc803dd2ceeac5f42efbc1d4e07 Mon Sep 17 00:00:00 2001 From: Harsha HS Date: Fri, 13 Mar 2026 07:46:38 -0500 Subject: [PATCH 2/4] Generate embedded device lib headers unconditonally --- third_party/xla/xla/service/gpu/llvm_gpu_backend/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/xla/xla/service/gpu/llvm_gpu_backend/BUILD b/third_party/xla/xla/service/gpu/llvm_gpu_backend/BUILD index e2fcf8ef9c11c9..cd987494e9624d 100644 --- a/third_party/xla/xla/service/gpu/llvm_gpu_backend/BUILD +++ b/third_party/xla/xla/service/gpu/llvm_gpu_backend/BUILD @@ -66,6 +66,7 @@ cc_library( "GOOGLE_CUDA=1", ]) + if_rocm_is_configured(["TENSORFLOW_USE_ROCM=1"]), deps = [ + ":amdgpu_device_lib_data", "//xla:status_macros", "//xla:types", "//xla:util", @@ -119,7 +120,6 @@ cc_library( "@local_config_rocm//rocm:rocm_headers", "@llvm-project//llvm:AMDGPUCodeGen", "@llvm-project//llvm:AMDGPUAsmParser", - ":amdgpu_device_lib_data", ]) + if_sycl_is_configured([ "@spirv_llvm_translator//:spirv_llvm_translator", ]), From 734cc17ea52bb2605ab5c5efe1e3baf11c116a98 Mon Sep 17 00:00:00 2001 From: Harsha HS Date: Fri, 13 Mar 2026 09:50:57 -0500 Subject: [PATCH 3/4] Fix bazelrc file in run_xla script --- tensorflow/tools/ci_build/linux/rocm/run_xla.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/tools/ci_build/linux/rocm/run_xla.sh b/tensorflow/tools/ci_build/linux/rocm/run_xla.sh index f17841259c9283..4b213511538685 100755 --- a/tensorflow/tools/ci_build/linux/rocm/run_xla.sh +++ b/tensorflow/tools/ci_build/linux/rocm/run_xla.sh @@ -55,7 +55,7 @@ if [ ! -d /tf ];then mkdir /tf fi -bazel --bazelrc=tensorflow/tools/tf_sig_build_dockerfiles/devel.usertools/cpu.bazelrc test \ +bazel --bazelrc=tensorflow/tools/tf_sig_build_dockerfiles/devel.usertools/rocm.bazelrc test \ --config=sigbuild_local_cache \ --config=rocm \ --config=xla_cpp_filters \ From 1f137325f4139acfe3fdb5dcbb5bb286a5030279 Mon Sep 17 00:00:00 2001 From: Harsha HS Date: Fri, 20 Mar 2026 08:07:31 -0500 Subject: [PATCH 4/4] Add gcn_arch_name for device description string --- third_party/xla/xla/service/compiler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/xla/xla/service/compiler.cc b/third_party/xla/xla/service/compiler.cc index 43f33e30ea418c..bbcd23413ba14b 100644 --- a/third_party/xla/xla/service/compiler.cc +++ b/third_party/xla/xla/service/compiler.cc @@ -32,7 +32,7 @@ namespace xla { Compiler::TargetConfig::TargetConfig(se::StreamExecutor* s) : device_description(s->GetDeviceDescription()), platform_name(s->GetPlatform()->Name()), - device_description_str(s->GetDeviceDescription().name()) { + device_description_str(s->GetDeviceDescription().rocm_compute_capability().gcn_arch_name()) { se::dnn::DnnSupport* dnn = s->AsDnn(); if (dnn != nullptr) { absl::StatusOr dnn_version = dnn->GetVersion();