xref: /aosp_15_r20/external/tensorflow/tensorflow/tools/ci_build/xla/linux/gpu/run_py3.sh (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1#!/usr/bin/env bash
2# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16# ==============================================================================
17
18set -e
19set -x
20
21N_JOBS=$(grep -c ^processor /proc/cpuinfo)
22
23echo ""
24echo "Bazel will use ${N_JOBS} concurrent job(s)."
25echo ""
26
27# Run configure.
28export PYTHON_BIN_PATH=`which python3`
29
30export TF_NEED_CUDA=1
31export TF_CUDA_COMPUTE_CAPABILITIES=3.7
32
33yes "" | $PYTHON_BIN_PATH configure.py
34echo "build --distinct_host_configuration=false" >> .tf_configure.bazelrc
35
36bazel clean
37# Run bazel test command. Double test timeouts to avoid flakes.
38bazel test --config=cuda --test_tag_filters=-no_gpu,-benchmark-test,-no_oss -k \
39    --jobs=${N_JOBS} --test_timeout 300,450,1200,3600 \
40    --test_size_filters=small,medium \
41    --build_tests_only --test_output=errors --local_test_jobs=8 \
42    --run_under=//tensorflow/tools/ci_build/gpu_build:parallel_gpu_execute \
43    --config=xla -- \
44    //tensorflow/compiler/...
45