Skip to content

Commit 18737cc

Browse files
committed
Merge profraw files before uploading.
1 parent 10760fa commit 18737cc

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

.github/workflows/_build_torch_xla.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
BAZEL_REMOTE_CACHE: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
3636
BAZEL_JOBS: '' # Let bazel decide the parallelism based on the number of CPUs.
3737
BUILD_CPP_TESTS: 1
38-
GCNO_OUTPUT_DIR: "/tmp/torch-xla-gcno"
3938
steps:
4039
# Need to check out local composite actions before using them
4140
# https://github.com/orgs/community/discussions/11771

.github/workflows/_test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,12 @@ jobs:
155155
env:
156156
COVERAGE_FILE: "${{ env.COVERAGE_DIR }}/py-coverage"
157157
LLVM_PROFILE_FILE: "${{ env.COVERAGE_DIR }}/cpp-coverage/data-%p.profraw"
158-
run: pytorch/xla/.github/scripts/run_tests.sh pytorch/ pytorch/xla/ $USE_COVERAGE
158+
run: |
159+
pytorch/xla/.github/scripts/run_tests.sh pytorch/ pytorch/xla/ $USE_COVERAGE
160+
# Merge the profraw files, so that they take less space.
161+
llvm-profdata-17 merge $COVERAGE_DIR/cpp-coverage/*.profraw -o $COVERAGE_DIR/cpp-coverage.profdata
162+
# Remove the collected raw coverage files.
163+
rm -r $COVERAGE_DIR/cpp-coverage
159164
- name: Upload coverage results
160165
uses: actions/upload-artifact@v4
161166
with:

.github/workflows/_test_requiring_torch_cuda.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,13 @@ jobs:
129129
run_coverage pytorch/xla/test/test_operations.py -v
130130
run_coverage pytorch/xla/test/dynamo/test_dynamo.py -v
131131
132+
# Combine all Python coverage files.
132133
coverage combine
133134
coverage lcov --omit="/tmp/*" --ignore-errors -o $COVERAGE_FILE.info
135+
# Merge the profraw files, so that they take less space.
136+
llvm-profdata-17 merge $COVERAGE_DIR/cpp-coverage/*.profraw -o $COVERAGE_DIR/cpp-coverage.profdata
137+
# Remove the collected raw coverage files.
138+
rm -r $COVERAGE_DIR/cpp-coverage
134139
if: ${{ matrix.run_python_tests }}
135140
- name: Triton Tests
136141
shell: bash
@@ -153,8 +158,13 @@ jobs:
153158
154159
run_coverage pytorch/xla/test/test_triton.py
155160
161+
# Combine all Python coverage files.
156162
coverage combine
157163
coverage lcov --omit="/tmp/*" --ignore-errors -o $COVERAGE_FILE.info
164+
# Merge the profraw files, so that they take less space.
165+
llvm-profdata-17 merge $COVERAGE_DIR/cpp-coverage/*.profraw -o $COVERAGE_DIR/cpp-coverage.profdata
166+
# Remove the collected raw coverage files.
167+
rm -r $COVERAGE_DIR/cpp-coverage
158168
if: ${{ matrix.run_triton_tests }}
159169
- name: Upload coverage results
160170
uses: actions/upload-artifact@v4

.github/workflows/_tpu_ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,10 @@ jobs:
6363
run: |
6464
cd pytorch/xla
6565
${{ matrix.test_script }}
66-
- name: Report no code changes
67-
# Only report the first instance
68-
if: inputs.has_code_changes == 'false' && strategy.job-index == 0
69-
run: |
70-
echo "No code changes were detected that require running the full test suite."
66+
# Merge the profraw files, so that they take less space.
67+
llvm-profdata-17 merge $COVERAGE_DIR/cpp-coverage/*.profraw -o $COVERAGE_DIR/cpp-coverage.profdata
68+
# Remove the collected raw coverage files.
69+
rm -r $COVERAGE_DIR/cpp-coverage
7170
- name: Upload coverage results
7271
uses: actions/upload-artifact@v4
7372
with:

0 commit comments

Comments
 (0)