From 48288e7b23d958925ac8020351dc3c9da5ca3d8a Mon Sep 17 00:00:00 2001 From: David Dunleavy Date: Thu, 10 Oct 2024 16:51:43 -0700 Subject: [PATCH] Don't run the `--nobuild` command for Tensorflow, MacOS builds parallel unavailable on macos VM, TF has config issues that prevent this PiperOrigin-RevId: 684622821 --- build_tools/ci/build.py | 23 +++++++++++++++++------ build_tools/ci/golden_commands.txt | 3 --- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/build_tools/ci/build.py b/build_tools/ci/build.py index 9fc579a5efa525..353ea0e73a3cb2 100755 --- a/build_tools/ci/build.py +++ b/build_tools/ci/build.py @@ -202,12 +202,23 @@ def commands(self) -> List[List[str]]: # We really want `bazel fetch` here, but it uses `bazel query` and not # `cquery`, which means that it fails due to config issues that aren't # problems in practice. - cmds.append( - maybe_docker_exec - + retry( - self.bazel_command(subcommand="build", extra_options=("--nobuild",)) - ) - ) + + # TODO(ddunleavy): Remove the condition here. Need to get parallel on the + # MacOS VM, and slightly change TF config (likely by specifying tag_filters + # manually). + if self.type_ not in ( + BuildType.TENSORFLOW_CPU, + BuildType.TENSORFLOW_GPU, + BuildType.MACOS_CPU_X86, + ): + cmds.append( + maybe_docker_exec + + retry( + self.bazel_command( + subcommand="build", extra_options=("--nobuild",) + ) + ) + ) cmds.append(maybe_docker_exec + self.bazel_command()) cmds.append( maybe_docker_exec + ["bazel", "analyze-profile", "profile.json.gz"] diff --git a/build_tools/ci/golden_commands.txt b/build_tools/ci/golden_commands.txt index 9621ca2a9f10eb..1d1c448548fdb5 100644 --- a/build_tools/ci/golden_commands.txt +++ b/build_tools/ci/golden_commands.txt @@ -52,7 +52,6 @@ sudo wget --no-verbose -O /usr/local/bin/bazel https://github.com/bazelbuild/baz chmod +x /usr/local/bin/bazel bazel --version mkdir -p /Volumes/BuildData/bazel_output -parallel --ungroup --retries 3 --delay 15 --nonall -- bazel build --build_tag_filters=-no_oss,-gpu,-no_mac,-mac_excluded,-requires-gpu-nvidia,-requires-gpu-amd --test_tag_filters=-no_oss,-gpu,-no_mac,-mac_excluded,-requires-gpu-nvidia,-requires-gpu-amd --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 --macos_minimum_os=10.15 --test_tmpdir=/Volumes/BuildData/bazel_output --nobuild -- //xla/... -//xla/hlo/experimental/... -//xla/python_api/... -//xla/python/... -//xla/service/gpu/... bazel test --build_tag_filters=-no_oss,-gpu,-no_mac,-mac_excluded,-requires-gpu-nvidia,-requires-gpu-amd --test_tag_filters=-no_oss,-gpu,-no_mac,-mac_excluded,-requires-gpu-nvidia,-requires-gpu-amd --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 --macos_minimum_os=10.15 --test_tmpdir=/Volumes/BuildData/bazel_output -- //xla/... -//xla/hlo/experimental/... -//xla/python_api/... -//xla/python/... -//xla/service/gpu/... bazel analyze-profile profile.json.gz # END BuildType.MACOS_CPU_X86 @@ -61,7 +60,6 @@ $KOKORO_ARTIFACTS_DIR/github/xla/.kokoro/generate_index_html.sh index.html git clone --depth=1 https://github.com/tensorflow/tensorflow ./github/tensorflow parallel --ungroup --retries 3 --delay 15 --nonall -- docker pull gcr.io/tensorflow-sigs/build:latest-python3.11 docker run --detach --name=xla_ci --rm --interactive --tty --volume=./github:/github --workdir=/github/tensorflow gcr.io/tensorflow-sigs/build:latest-python3.11 bash -docker exec xla_ci parallel --ungroup --retries 3 --delay 15 --nonall -- bazel build --build_tag_filters= --test_tag_filters= --config=release_cpu_linux --config=rbe_linux_cpu --config=linux_cpu_pycpp_test_filters --verbose_failures --test_output=errors --override_repository=xla=/github/xla --profile=profile.json.gz --nobuild -- //tensorflow/compiler/... -//tensorflow/compiler/tf2tensorrt/... //tensorflow/python/... -//tensorflow/python/distribute/... -//tensorflow/python/compiler/tensorrt/... docker exec xla_ci bazel test --build_tag_filters= --test_tag_filters= --config=release_cpu_linux --config=rbe_linux_cpu --config=linux_cpu_pycpp_test_filters --verbose_failures --test_output=errors --override_repository=xla=/github/xla --profile=profile.json.gz -- //tensorflow/compiler/... -//tensorflow/compiler/tf2tensorrt/... //tensorflow/python/... -//tensorflow/python/distribute/... -//tensorflow/python/compiler/tensorrt/... docker exec xla_ci bazel analyze-profile profile.json.gz docker stop xla_ci @@ -71,7 +69,6 @@ $KOKORO_ARTIFACTS_DIR/github/xla/.kokoro/generate_index_html.sh index.html git clone --depth=1 https://github.com/tensorflow/tensorflow ./github/tensorflow parallel --ungroup --retries 3 --delay 15 --nonall -- docker pull gcr.io/tensorflow-sigs/build:latest-python3.11 docker run --detach --name=xla_ci --rm --interactive --tty --volume=./github:/github --workdir=/github/tensorflow gcr.io/tensorflow-sigs/build:latest-python3.11 bash -docker exec xla_ci parallel --ungroup --retries 3 --delay 15 --nonall -- bazel build --build_tag_filters=-no_oss,+gpu --test_tag_filters=-no_oss,+gpu --config=release_gpu_linux --config=rbe_linux_cuda --config=linux_cuda_pycpp_test_filters --verbose_failures --test_output=errors --override_repository=xla=/github/xla --profile=profile.json.gz --nobuild -- //tensorflow/compiler/... -//tensorflow/compiler/tf2tensorrt/... //tensorflow/python/... -//tensorflow/python/distribute/... -//tensorflow/python/compiler/tensorrt/... docker exec xla_ci bazel test --build_tag_filters=-no_oss,+gpu --test_tag_filters=-no_oss,+gpu --config=release_gpu_linux --config=rbe_linux_cuda --config=linux_cuda_pycpp_test_filters --verbose_failures --test_output=errors --override_repository=xla=/github/xla --profile=profile.json.gz -- //tensorflow/compiler/... -//tensorflow/compiler/tf2tensorrt/... //tensorflow/python/... -//tensorflow/python/distribute/... -//tensorflow/python/compiler/tensorrt/... docker exec xla_ci bazel analyze-profile profile.json.gz docker stop xla_ci