Skip to content

Commit ddceb96

Browse files
ddunltensorflower-gardener
authored andcommitted
Add GitHub Actions based XLA ARM64 CPU build
PiperOrigin-RevId: 721177984
1 parent 1a227be commit ddceb96

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

third_party/xla/.github/workflows/ci.yml

+11
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,28 @@ on:
2121
branches:
2222
- main
2323

24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
26+
cancel-in-progress: ${{ github.ref != 'main' }}
2427

2528
jobs:
2629
Tests:
2730
strategy:
31+
# Don't fail fast - want to see results for all builds even if one fails.
32+
fail-fast: false
2833
matrix:
2934
job_info: [
3035
{
3136
pool: "linux-x86-n2-16",
3237
container: "us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/ml-build:latest",
3338
kokoro_job_name: "xla-linux-x86-cpu",
3439
pretty_name: "XLA Linux x86 CPU",
40+
},
41+
{
42+
pool: "linux-arm64-c4a-16",
43+
container: "us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/ml-build-arm64:latest",
44+
kokoro_job_name: "xla-linux-arm64-cpu",
45+
pretty_name: "XLA Linux ARM64 CPU",
3546
}
3647
]
3748
name: ${{ matrix.job_info.pretty_name }}

third_party/xla/build_tools/ci/build.py

+12
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class BuildType(enum.Enum):
8989
"""Enum representing all types of builds."""
9090
CPU_X86_SELF_HOSTED = enum.auto()
9191
CPU_ARM64 = enum.auto()
92+
CPU_ARM64_SELF_HOSTED = enum.auto()
9293
GPU = enum.auto()
9394
GPU_CONTINUOUS = enum.auto()
9495

@@ -312,6 +313,16 @@ def nvidia_gpu_build_with_compute_capability(
312313
build_tag_filters=cpu_arm_tag_filter,
313314
test_tag_filters=cpu_arm_tag_filter,
314315
)
316+
_CPU_ARM64_SELF_HOSTED_BUILD = Build(
317+
type_=BuildType.CPU_ARM64_SELF_HOSTED,
318+
repo="openxla/xla",
319+
image_url=None,
320+
configs=("warnings", "rbe_cross_compile_linux_arm64", "nonccl"),
321+
target_patterns=_XLA_DEFAULT_TARGET_PATTERNS,
322+
options={**_DEFAULT_BAZEL_OPTIONS, "build_tests_only": True},
323+
build_tag_filters=cpu_arm_tag_filter,
324+
test_tag_filters=cpu_arm_tag_filter,
325+
)
315326
# TODO(ddunleavy): Setup additional build for a100 tests once L4 RBE is ready.
316327
_GPU_BUILD = nvidia_gpu_build_with_compute_capability(
317328
type_=BuildType.GPU,
@@ -464,6 +475,7 @@ def nvidia_gpu_build_with_compute_capability(
464475
"tensorflow/xla/tensorflow/cpu/build_cpu": _TENSORFLOW_CPU_BUILD,
465476
"tensorflow/xla/tensorflow/gpu/build_gpu": _TENSORFLOW_GPU_BUILD,
466477
"xla-linux-x86-cpu": _CPU_X86_SELF_HOSTED_BUILD,
478+
"xla-linux-arm64-cpu": _CPU_ARM64_SELF_HOSTED_BUILD,
467479
}
468480

469481

third_party/xla/build_tools/ci/golden_commands.txt

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ docker exec xla_ci bazel test --build_tag_filters=-no_oss,-gpu,-requires-gpu-nvi
77
docker exec xla_ci bazel analyze-profile profile.json.gz
88
docker stop xla_ci
99
# END BuildType.CPU_ARM64
10+
# BEGIN BuildType.CPU_ARM64_SELF_HOSTED
11+
parallel --ungroup --retries 3 --delay 15 --nonall -- bazel build --build_tag_filters=-no_oss,-gpu,-requires-gpu-nvidia,-requires-gpu-amd,-not_run:arm --test_tag_filters=-no_oss,-gpu,-requires-gpu-nvidia,-requires-gpu-amd,-not_run:arm --config=warnings --config=rbe_cross_compile_linux_arm64 --config=nonccl --test_output=errors --verbose_failures --keep_going --nobuild_tests_only --profile=profile.json.gz --flaky_test_attempts=3 --jobs=150 --bes_upload_mode=fully_async --build_tests_only --nobuild -- //xla/... //build_tools/... @local_tsl//tsl/...
12+
bazel test --build_tag_filters=-no_oss,-gpu,-requires-gpu-nvidia,-requires-gpu-amd,-not_run:arm --test_tag_filters=-no_oss,-gpu,-requires-gpu-nvidia,-requires-gpu-amd,-not_run:arm --config=warnings --config=rbe_cross_compile_linux_arm64 --config=nonccl --test_output=errors --verbose_failures --keep_going --nobuild_tests_only --profile=profile.json.gz --flaky_test_attempts=3 --jobs=150 --bes_upload_mode=fully_async --build_tests_only -- //xla/... //build_tools/... @local_tsl//tsl/...
13+
bazel analyze-profile profile.json.gz
14+
# END BuildType.CPU_ARM64_SELF_HOSTED
1015
# BEGIN BuildType.CPU_X86_SELF_HOSTED
1116
parallel --ungroup --retries 3 --delay 15 --nonall -- bazel build --build_tag_filters=-no_oss,-gpu,-requires-gpu-nvidia,-requires-gpu-amd --test_tag_filters=-no_oss,-gpu,-requires-gpu-nvidia,-requires-gpu-amd --config=warnings --config=nonccl --config=rbe_linux_cpu --test_output=errors --verbose_failures --keep_going --nobuild_tests_only --profile=profile.json.gz --flaky_test_attempts=3 --jobs=150 --bes_upload_mode=fully_async --nobuild -- //xla/... //build_tools/... @local_tsl//tsl/...
1217
bazel test --build_tag_filters=-no_oss,-gpu,-requires-gpu-nvidia,-requires-gpu-amd --test_tag_filters=-no_oss,-gpu,-requires-gpu-nvidia,-requires-gpu-amd --config=warnings --config=nonccl --config=rbe_linux_cpu --test_output=errors --verbose_failures --keep_going --nobuild_tests_only --profile=profile.json.gz --flaky_test_attempts=3 --jobs=150 --bes_upload_mode=fully_async -- //xla/... //build_tools/... @local_tsl//tsl/...

0 commit comments

Comments
 (0)