Skip to content

Commit 6ed3ca1

Browse files
authored
Merge cpp_tests1 and cpp_tests2 into single shard (#9298)
Force merging as this PR removes some required checks.
1 parent 9166877 commit 6ed3ca1

File tree

4 files changed

+11
-24
lines changed

4 files changed

+11
-24
lines changed

.circleci/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function run_torch_xla_tests() {
202202
export PYTORCH_TESTING_DEVICE_ONLY_FOR="xla"
203203
export CXX_ABI=$(python -c "import torch;print(int(torch._C._GLIBCXX_USE_CXX11_ABI))")
204204

205-
if [[ -z "$RUN_BENCHMARK_TESTS" && -z "$RUN_CPP_TESTS1" && -z "$RUN_CPP_TESTS2" && -z "$RUN_PYTHON_TESTS" ]]; then
205+
if [[ -z "$RUN_BENCHMARK_TESTS" && -z "$RUN_CPP_TESTS" && -z "$RUN_PYTHON_TESTS" ]]; then
206206
run_torch_xla_python_tests $PYTORCH_DIR $XLA_DIR $USE_COVERAGE
207207
run_torch_xla_cpp_tests $PYTORCH_DIR $XLA_DIR $USE_COVERAGE
208208
run_torch_xla_benchmark_tests $XLA_DIR

.github/scripts/run_tests.sh

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ function run_torch_xla_cpp_tests() {
4040
fi
4141
export XLA_EXPERIMENTAL="nonzero:masked_select:nms"
4242

43-
test_names1=("test_aten_xla_tensor_1"
43+
test_names=("test_aten_xla_tensor_1"
4444
"test_aten_xla_tensor_2"
4545
"test_aten_xla_tensor_3"
4646
"test_aten_xla_tensor_4"
47-
"pjrt_computation_client_test")
47+
"pjrt_computation_client_test"
4848
# Disable IFRT test as it currently crashes
4949
#"ifrt_computation_client_test")
50-
test_names2=("test_aten_xla_tensor_5"
50+
"test_aten_xla_tensor_5"
5151
"test_aten_xla_tensor_6"
5252
"test_ir"
5353
"test_lazy"
@@ -56,14 +56,6 @@ function run_torch_xla_cpp_tests() {
5656
# disable test_xla_backend_intf since it is flaky on upstream
5757
#"test_xla_backend_intf"
5858
"test_xla_sharding")
59-
if [[ "$RUN_CPP_TESTS1" == "cpp_tests1" ]]; then
60-
test_names=("${test_names1[@]}")
61-
elif [[ "$RUN_CPP_TESTS2" == "cpp_tests2" ]]; then
62-
test_names=("${test_names2[@]}")
63-
else
64-
test_names=("${test_names1[@]}" "${test_names2[@]}")
65-
fi
66-
6759
for name in "${test_names[@]}"; do
6860
echo "Running $name cpp test..."
6961
/tmp/test/bin/${name}
@@ -95,7 +87,7 @@ fi
9587
export PYTORCH_TESTING_DEVICE_ONLY_FOR="xla"
9688
export CXX_ABI=$(python -c "import torch;print(int(torch._C._GLIBCXX_USE_CXX11_ABI))")
9789

98-
if [[ -z "$RUN_BENCHMARK_TESTS" && -z "$RUN_CPP_TESTS1" && -z "$RUN_CPP_TESTS2" && -z "$RUN_PYTHON_TESTS" ]]; then
90+
if [[ -z "$RUN_BENCHMARK_TESTS" && -z "$RUN_CPP_TESTS" && -z "$RUN_PYTHON_TESTS" ]]; then
9991
run_torch_xla_python_tests $XLA_DIR $USE_COVERAGE
10092
run_torch_xla_cpp_tests $XLA_DIR $USE_COVERAGE
10193
run_torch_xla_benchmark_tests $XLA_DIR

.github/workflows/_test.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ jobs:
6666
- run_python_tests: 'python_tests'
6767
run_torch_mp_op_tests: 'torch_mp_op'
6868
- run_cpp_tests: 'cpp_tests'
69-
run_cpp_tests1: 'cpp_tests1'
70-
- run_cpp_tests: 'cpp_tests'
71-
run_cpp_tests2: 'cpp_tests2'
7269
timeout-minutes: ${{ inputs.timeout-minutes }}
7370
env:
7471
GCLOUD_SERVICE_KEY: ${{ secrets.gcloud-service-key }}
@@ -82,8 +79,7 @@ jobs:
8279
RUN_XLA_OP_TESTS4: ${{ matrix.run_xla_op_tests4 }}
8380
RUN_XLA_OP_TESTS5: ${{ matrix.run_xla_op_tests5 }}
8481
RUN_TORCH_MP_OP_TESTS: ${{ matrix.run_torch_mp_op_tests }}
85-
RUN_CPP_TESTS1: ${{ matrix.run_cpp_tests1 }}
86-
RUN_CPP_TESTS2: ${{ matrix.run_cpp_tests2 }}
82+
RUN_CPP_TESTS: ${{ matrix.run_cpp_tests }}
8783
BAZEL_JOBS: '' # Let bazel decide the parallelism based on the number of CPUs.
8884
BAZEL_REMOTE_CACHE: 1
8985
steps:
@@ -160,7 +156,7 @@ jobs:
160156
CIRCLE_BUILD_NUM: ${{ github.run_number }}
161157
BENCHMARK_TEST_NAME: ${{ env.RUN_BENCHMARK_TESTS }}
162158
PYTHON_TEST_NAME: ${{ env.RUN_PYTHON_TESTS }}${{ env.RUN_XLA_OP_TESTS1 }}${{ env.RUN_XLA_OP_TESTS2 }}${{ env.RUN_XLA_OP_TESTS3 }}${{ env.RUN_XLA_OP_TESTS4 }}${{ env.RUN_XLA_OP_TESTS5 }}${{ env.RUN_TORCH_MP_OP_TESTS }}
163-
CPP_TEST_NAME: ${{ env.RUN_CPP_TESTS1 }}${{ env.RUN_CPP_TESTS2 }}
159+
CPP_TEST_NAME: ${{ env.RUN_CPP_TESTS }}
164160
run: |
165161
# TODO(yeounoh) collect coverage report as needed.
166162
if [ -n "${BENCHMARK_TEST_NAME}" ]; then
@@ -187,7 +183,7 @@ jobs:
187183
gsutil cp ${GITHUB_WORKSPACE}/htmlcov/cpp_lcov.info gs://ng3-metrics/ng3-pytorchxla-coverage/incremental/pytorchxla/${CIRCLE_WORKFLOW_ID}/cpu_cpp_coverage_${CPP_TEST_NAME}.out
188184
fi
189185
190-
if [ "${CPP_TEST_NAME}" == "cpp_tests1" ]; then
186+
if [ "${CPP_TEST_NAME}" == "cpp_tests" ]; then
191187
ABS_METADATA='{"host": "github", "project": "pytorchxla", "trace_type": "LCOV", "commit_id": '\"${GITHUB_SHA}\"', "ref": "HEAD", "source": "https://github.com/pytorch/xla", "owner": "cloud-tpu-pt-dev", "bug_component": "587012"}'
192188
echo $ABS_METADATA > abs_metadata.json
193189
gsutil cp abs_metadata.json gs://ng3-metrics/ng3-pytorchxla-coverage/absolute/pytorchxla/${CIRCLE_WORKFLOW_ID}/metadata.json

test/cpp/run_tests.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,12 @@ if [[ "$BAZEL_VERB" == "coverage" ]]; then
8686
fi
8787

8888
test_names=("all")
89-
if [[ "$RUN_CPP_TESTS1" == "cpp_tests1" ]]; then
89+
if [[ "$RUN_CPP_TESTS" == "cpp_tests" ]]; then
9090
test_names=("test_aten_xla_tensor_1"
9191
"test_aten_xla_tensor_2"
9292
"test_aten_xla_tensor_3"
93-
"test_aten_xla_tensor_4")
94-
elif [[ "$RUN_CPP_TESTS2" == "cpp_tests2" ]]; then
95-
test_names=("test_aten_xla_tensor_5"
93+
"test_aten_xla_tensor_4"
94+
"test_aten_xla_tensor_5"
9695
"test_aten_xla_tensor_6"
9796
"test_ir"
9897
"test_lazy"

0 commit comments

Comments
 (0)