Skip to content
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
1 change: 1 addition & 0 deletions build_tools/lint/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"multi_gpu_h100": (
"Used by `xla_test` to signal that multiple H100s are needed."
),
"skip_rocprofiler_sdk": "used to skip rocmtracer test as it calls rocprofiler-sdk via rocprofiler_force_configure",
}


Expand Down
2 changes: 1 addition & 1 deletion build_tools/rocm/run_xla.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ BAZEL_DISK_CACHE_DIR="/tf/disk_cache/rocm-jaxlib-v0.6.0"
mkdir -p ${BAZEL_DISK_CACHE_DIR}

SCRIPT_DIR=$(realpath $(dirname $0))
TAG_FILTERS=$($SCRIPT_DIR/rocm_tag_filters.sh),gpu,-multigpu,-multi_gpu_h100,requires-gpu-amd
TAG_FILTERS=$($SCRIPT_DIR/rocm_tag_filters.sh),gpu,-multigpu,-multi_gpu_h100,requires-gpu-amd,-skip_rocprofiler_sdk

SANITIZER_ARGS=()
if [[ $1 == "asan" ]]; then
Expand Down
13 changes: 13 additions & 0 deletions third_party/gpus/rocm/BUILD.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,19 @@ cc_library(
deps = [":rocm_config"],
)

cc_library(
name = "rocprofiler-sdk",
srcs = glob(["%{rocm_root}/lib/librocprofiler-sdk*.so*"]),
hdrs = glob(["%{rocm_root}/include/rocprofiler-sdk/**"]),
include_prefix = "rocm",
includes = [
"%{rocm_root}/include/",
],
strip_include_prefix = "%{rocm_root}",
visibility = ["//visibility:public"],
deps = [":rocm_config"],
)

cc_library(
name = "rocsolver",
srcs = glob(["%{rocm_root}/lib/librocsolver*.so*"]),
Expand Down
1 change: 1 addition & 0 deletions third_party/gpus/rocm_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ def _find_libs(repository_ctx, rocm_config, miopen_path, rccl_path, bash_bin):
("rocsolver", rocm_config.rocm_toolkit_path),
("hipfft", rocm_config.rocm_toolkit_path),
("rocrand", rocm_config.rocm_toolkit_path),
("rocprofiler-sdk", rocm_config.rocm_toolkit_path),
]
]
if int(rocm_config.rocm_version_number) >= 40500:
Expand Down
16 changes: 3 additions & 13 deletions xla/backends/profiler/gpu/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,6 @@ cc_library(
"manual",
"rocm-only",
],
linkopts = [
"-Wl,--no-as-needed",
"-L/opt/rocm/lib",
"-Wl,-rpath,/opt/rocm/lib",
"-lhsa-runtime64",
],
deps = [
"//xla/tsl/profiler/backends/cpu:annotation_stack",
"//xla/tsl/profiler/utils:time_utils",
Expand All @@ -266,6 +260,7 @@ cc_library(
"@tsl//tsl/platform:errors",
"@tsl//tsl/platform:logging",
"@tsl//tsl/platform:macros",
"@local_config_rocm//rocm:rocprofiler-sdk",
],
visibility = ["//visibility:public"],
)
Expand All @@ -274,13 +269,6 @@ cc_library(
name = "rocm_collector",
srcs = ["rocm_collector.cc"],
hdrs = ["rocm_collector.h"],
# copybara:uncomment compatible_with = ["//buildenv/target:non_prod"],
linkopts = select({
"//conditions:default": [
"-L/opt/rocm/lib", # search path for all ROCm shared objects
"-lrocprofiler-sdk", # the library that owns the missing symbols
],
}),
tags = [
"gpu",
"rocm-only",
Expand Down Expand Up @@ -315,6 +303,7 @@ cc_library(
"@tsl//tsl/platform:types",
"@tsl//tsl/profiler/lib:profiler_factory",
"@tsl//tsl/profiler/lib:profiler_interface",
"@local_config_rocm//rocm:rocprofiler-sdk",
],
)

Expand Down Expand Up @@ -401,6 +390,7 @@ xla_test(
tags = [
"gpu",
"rocm-only",
"skip_rocprofiler_sdk", # due to rocprofiler-sdk's rocprofiler_force_configure
] + if_google([
# Optional: only run internally if ROCm config is enabled
"manual",
Expand Down