From 2bedc5c86dd0d7b1c73e7f18bdfeff6278fdc8df Mon Sep 17 00:00:00 2001 From: Felicity Liao Date: Tue, 25 Mar 2025 16:45:28 -0700 Subject: [PATCH] Split C++ unit tests to better debug (#2848) Summary: Pull Request resolved: https://github.com/pytorch/torchrec/pull/2848 Differential Revision: D71855286 --- .github/workflows/cpp_unittest_ci_cpu.yml | 63 +++++++++++++++++++++++ .github/workflows/unittest_ci_cpu.yml | 14 ----- 2 files changed, 63 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/cpp_unittest_ci_cpu.yml diff --git a/.github/workflows/cpp_unittest_ci_cpu.yml b/.github/workflows/cpp_unittest_ci_cpu.yml new file mode 100644 index 000000000..ad9e6e13f --- /dev/null +++ b/.github/workflows/cpp_unittest_ci_cpu.yml @@ -0,0 +1,63 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: CPU Unit Test C++ CI + +on: + push: + paths-ignore: + - "docs/*" + - "third_party/*" + - .gitignore + - "*.md" + pull_request: + paths-ignore: + - "docs/*" + - "third_party/*" + - .gitignore + - "*.md" + +jobs: + build_test: + strategy: + fail-fast: false + matrix: + include: + - os: linux.2xlarge + python-version: 3.9 + python-tag: "py39" + - os: linux.2xlarge + python-version: '3.10' + python-tag: "py310" + - os: linux.2xlarge + python-version: '3.11' + python-tag: "py311" + - os: linux.2xlarge + python-version: '3.12' + python-tag: "py312" + uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main + permissions: + id-token: write + contents: read + with: + runner: ${{ matrix.os }} + timeout: 15 + script: | + ldd --version + conda create -y --name build_binary python=${{ matrix.python-version }} + conda info + python --version + echo "Starting C++ Tests" + conda install -n build_binary -y gxx_linux-64 + conda run -n build_binary \ + x86_64-conda-linux-gnu-g++ --version + conda install -n build_binary -c anaconda redis -y + conda run -n build_binary redis-server --daemonize yes + mkdir cpp-build + cd cpp-build + conda run -n build_binary cmake \ + -DBUILD_TEST=ON \ + -DBUILD_REDIS_IO=ON \ + -DCMAKE_PREFIX_PATH=/opt/conda/envs/build_binary/lib/python${{ matrix.python-version }}/site-packages/torch/share/cmake .. + conda run -n build_binary make -j + conda run -n build_binary ctest -V . diff --git a/.github/workflows/unittest_ci_cpu.yml b/.github/workflows/unittest_ci_cpu.yml index a0b0ef9eb..df8c74ecc 100644 --- a/.github/workflows/unittest_ci_cpu.yml +++ b/.github/workflows/unittest_ci_cpu.yml @@ -75,17 +75,3 @@ jobs: conda run -n build_binary \ python -m pytest torchrec -v -s -W ignore::pytest.PytestCollectionWarning --continue-on-collection-errors \ --ignore-glob=**/test_utils/ - echo "Starting C++ Tests" - conda install -n build_binary -y gxx_linux-64 - conda run -n build_binary \ - x86_64-conda-linux-gnu-g++ --version - conda install -n build_binary -c anaconda redis -y - conda run -n build_binary redis-server --daemonize yes - mkdir cpp-build - cd cpp-build - conda run -n build_binary cmake \ - -DBUILD_TEST=ON \ - -DBUILD_REDIS_IO=ON \ - -DCMAKE_PREFIX_PATH=/opt/conda/envs/build_binary/lib/python${{ matrix.python-version }}/site-packages/torch/share/cmake .. - conda run -n build_binary make -j - conda run -n build_binary ctest -V .