Skip to content

Commit 69b5e05

Browse files
authored
Make rbe image parametrized (#425)
1 parent be9da6d commit 69b5e05

File tree

5 files changed

+24
-52
lines changed

5 files changed

+24
-52
lines changed

build_tools/rocm/platform/BUILD

Lines changed: 0 additions & 16 deletions
This file was deleted.

build_tools/rocm/platform/linux_x64/BUILD

Lines changed: 0 additions & 33 deletions
This file was deleted.

build_tools/rocm/rocm_xla.bazelrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ build:rocm_dev --remote_cache="https://wardite.cluster.engflow.com"
55

66
build:rocm_rbe --bes_backend="grpcs://wardite.cluster.engflow.com"
77
build:rocm_rbe --bes_results_url="https://wardite.cluster.engflow.com/invocation/"
8-
build:rocm_rbe --host_platform="//build_tools/rocm/platform/linux_x64:linux_x64"
9-
build:rocm_rbe --extra_execution_platforms="//build_tools/rocm/platform/linux_x64:linux_x64"
10-
build:rocm_rbe --platforms="//build_tools/rocm/platform/linux_x64:linux_x64"
8+
build:rocm_rbe --host_platform="@local_config_rocm//rocm:linux_x64"
9+
build:rocm_rbe --extra_execution_platforms="@local_config_rocm//rocm:linux_x64"
10+
build:rocm_rbe --platforms="@local_config_rocm//rocm:linux_x64"
1111
build:rocm_rbe --bes_timeout=600s
1212
build:rocm_rbe --tls_client_certificate="/tf/certificates/ci-cert.crt"
1313
build:rocm_rbe --tls_client_key="/tf/certificates/ci-cert.key"

third_party/gpus/rocm/BUILD.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,3 +584,17 @@ filegroup(
584584
srcs = glob(["%{rocm_root}/**"]),
585585
visibility = ["//visibility:public"],
586586
)
587+
588+
platform(
589+
name = "linux_x64",
590+
constraint_values = [
591+
"@platforms//os:linux",
592+
"@platforms//cpu:x86_64",
593+
"@bazel_tools//tools/cpp:clang",
594+
],
595+
596+
exec_properties = {
597+
"container-image": "docker://%{rocm_rbe_docker_image}",
598+
"OSFamily": "Linux",
599+
},
600+
)

third_party/gpus/rocm_configure.bzl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ _DISTRIBUTION_PATH = "rocm/rocm_dist"
5252
_OS = "OS"
5353
_ROCM_VERSION = "ROCM_VERSION"
5454

55+
_TF_ROCM_RBE_DOCKER_IMAGE = "TF_ROCM_RBE_DOCKER_IMAGE"
56+
# rocm/tensorflow-build:latest-jammy-python3.11-rocm7.0.2
57+
_DEFAULT_TF_ROCM_RBE_DOCKER_IMAGE = "rocm/tensorflow-build@sha256:a2672ff2510b369b4a5f034272a518dc93c2e492894e3befaeef19649632ccaa"
58+
5559
_DEFAULT_ROCM_TOOLKIT_PATH = "/opt/rocm"
5660
_TF_ROCM_MULTIPLE_PATHS = "TF_ROCM_MULTIPLE_PATHS"
5761
_LLVM_PATH = "LLVM_PATH"
@@ -655,6 +659,7 @@ def _create_local_rocm_repository(repository_ctx):
655659
repository_dict = {
656660
"%{rocm_root}": rocm_toolkit_path,
657661
"%{rocm_toolkit_path}": str(repository_ctx.path(rocm_config.rocm_toolkit_path)),
662+
"%{rocm_rbe_docker_image}": repository_ctx.os.environ.get(_TF_ROCM_RBE_DOCKER_IMAGE, _DEFAULT_TF_ROCM_RBE_DOCKER_IMAGE),
658663
}
659664

660665
is_rocm_clang = _use_rocm_clang(repository_ctx)
@@ -873,6 +878,8 @@ _ENVIRONS = [
873878
_TF_ROCM_AMDGPU_TARGETS,
874879
_OS,
875880
_ROCM_VERSION,
881+
_TF_ROCM_RBE_DOCKER_IMAGE,
882+
_TF_ROCM_MULTIPLE_PATHS,
876883
]
877884

878885
remote_rocm_configure = repository_rule(

0 commit comments

Comments
 (0)