Skip to content

Commit fb1f2c4

Browse files
aporialiaofacebook-github-bot
authored andcommitted
Split C++ unit tests to better debug (#2848)
Summary: Pull Request resolved: #2848 AFAIK most of our changes are in Python. And the CPU unit test CI is only erroring from c++ make issue. I'm splitting the two github actions to: 1. Separation of tests - so while we work on a fix for the cmake issue, diffs aren't obscured from potential failures to unit tests. 2. Offering us the option to temporarily disable c++ tests at diff time if there is no fix. Reviewed By: TroyGarden Differential Revision: D71855286 fbshipit-source-id: 60611c78d8774f1d6ca694ae2d892ad46f188394
1 parent 4999964 commit fb1f2c4

File tree

2 files changed

+63
-14
lines changed

2 files changed

+63
-14
lines changed
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: CPU Unit Test C++ CI
5+
6+
on:
7+
push:
8+
paths-ignore:
9+
- "docs/*"
10+
- "third_party/*"
11+
- .gitignore
12+
- "*.md"
13+
pull_request:
14+
paths-ignore:
15+
- "docs/*"
16+
- "third_party/*"
17+
- .gitignore
18+
- "*.md"
19+
20+
jobs:
21+
build_test:
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
include:
26+
- os: linux.2xlarge
27+
python-version: 3.9
28+
python-tag: "py39"
29+
- os: linux.2xlarge
30+
python-version: '3.10'
31+
python-tag: "py310"
32+
- os: linux.2xlarge
33+
python-version: '3.11'
34+
python-tag: "py311"
35+
- os: linux.2xlarge
36+
python-version: '3.12'
37+
python-tag: "py312"
38+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
39+
permissions:
40+
id-token: write
41+
contents: read
42+
with:
43+
runner: ${{ matrix.os }}
44+
timeout: 15
45+
script: |
46+
ldd --version
47+
conda create -y --name build_binary python=${{ matrix.python-version }}
48+
conda info
49+
python --version
50+
echo "Starting C++ Tests"
51+
conda install -n build_binary -y gxx_linux-64
52+
conda run -n build_binary \
53+
x86_64-conda-linux-gnu-g++ --version
54+
conda install -n build_binary -c anaconda redis -y
55+
conda run -n build_binary redis-server --daemonize yes
56+
mkdir cpp-build
57+
cd cpp-build
58+
conda run -n build_binary cmake \
59+
-DBUILD_TEST=ON \
60+
-DBUILD_REDIS_IO=ON \
61+
-DCMAKE_PREFIX_PATH=/opt/conda/envs/build_binary/lib/python${{ matrix.python-version }}/site-packages/torch/share/cmake ..
62+
conda run -n build_binary make -j
63+
conda run -n build_binary ctest -V .

.github/workflows/unittest_ci_cpu.yml

-14
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,3 @@ jobs:
7575
conda run -n build_binary \
7676
python -m pytest torchrec -v -s -W ignore::pytest.PytestCollectionWarning --continue-on-collection-errors \
7777
--ignore-glob=**/test_utils/
78-
echo "Starting C++ Tests"
79-
conda install -n build_binary -y gxx_linux-64
80-
conda run -n build_binary \
81-
x86_64-conda-linux-gnu-g++ --version
82-
conda install -n build_binary -c anaconda redis -y
83-
conda run -n build_binary redis-server --daemonize yes
84-
mkdir cpp-build
85-
cd cpp-build
86-
conda run -n build_binary cmake \
87-
-DBUILD_TEST=ON \
88-
-DBUILD_REDIS_IO=ON \
89-
-DCMAKE_PREFIX_PATH=/opt/conda/envs/build_binary/lib/python${{ matrix.python-version }}/site-packages/torch/share/cmake ..
90-
conda run -n build_binary make -j
91-
conda run -n build_binary ctest -V .

0 commit comments

Comments
 (0)