From ce0bca80da7eb5d670a36163788d8f71e7ca0a3c Mon Sep 17 00:00:00 2001 From: Will Constable Date: Fri, 23 Feb 2024 16:34:16 -0800 Subject: [PATCH] Add 4GPU unit test --- .github/workflows/4GPU_test.yaml | 43 +++++++++++++++++++ .../{unit_test.yaml => cpu_test.yaml} | 0 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/4GPU_test.yaml rename .github/workflows/{unit_test.yaml => cpu_test.yaml} (100%) diff --git a/.github/workflows/4GPU_test.yaml b/.github/workflows/4GPU_test.yaml new file mode 100644 index 000000000..be7c21144 --- /dev/null +++ b/.github/workflows/4GPU_test.yaml @@ -0,0 +1,43 @@ +name: Unit Test + +on: + push: + branches: [ main ] + pull_request: + +concurrency: + group: unit-test${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash -l -eo pipefail {0} + +jobs: + unit_tests: + runs-on: linux.g5.12xlarge.nvidia.gpu + strategy: + matrix: + python-version: ['3.10'] + steps: + - name: Check out repo + uses: actions/checkout@v3 + - name: Setup conda env + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + miniconda-version: "latest" + activate-environment: test + python-version: ${{ matrix.python-version }} + - name: Update pip + run: python -m pip install --upgrade pip + - name: Install dependencies + run: | + pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121 + python -m pip install -r requirements.txt + python -m pip install -r dev-requirements.txt + python -m pip install -e . + - name: Run unit tests with coverage + run: pytest test --cov=. --cov-report=xml --durations=20 -vv + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v3 diff --git a/.github/workflows/unit_test.yaml b/.github/workflows/cpu_test.yaml similarity index 100% rename from .github/workflows/unit_test.yaml rename to .github/workflows/cpu_test.yaml