Browse Source

Revert "CI: use self-hosted runner for the build job"

This reverts commit c71d2cf814171ccec74b03c121b890be1ff088ba.
AlpinDale 1 month ago
parent
commit
2bb9c9c399
2 changed files with 15 additions and 10 deletions
  1. 13 8
      .github/workflows/publish.yml
  2. 2 2
      .github/workflows/scripts/build.sh

+ 13 - 8
.github/workflows/publish.yml

@@ -41,16 +41,17 @@ jobs:
 
   wheel:
     name: Build Wheel
-    runs-on: self-hosted
+    runs-on: ${{ matrix.os }}
     needs: release
+
     strategy:
       fail-fast: false
       matrix:
-        python-version: ['3.12']
-        pytorch-version: ['2.4.0']
-        cuda-version: ['12.4']
-    container:
-      image: nvidia/cuda:12.4.0-devel-ubuntu22.04
+          os: ['ubuntu-22.04']
+          python-version: ['3.12']
+          pytorch-version: ['2.4.0']  # Must be the most recent version that meets requirements-cuda.txt.
+          cuda-version: ['12.4']
+
     steps:
       - name: Checkout
         uses: actions/checkout@v3
@@ -69,7 +70,11 @@ jobs:
       - name: Set up Python
         uses: actions/setup-python@v4
         with:
-          python-version: ${{ matrix.python-version }}
+            python-version: ${{ matrix.python-version }}
+
+      - name: Install CUDA ${{ matrix.cuda-version }}
+        run: |
+          bash -x .github/workflows/scripts/cuda-install.sh ${{ matrix.cuda-version }} ${{ matrix.os }}
 
       - name: Install PyTorch ${{ matrix.pytorch-version }} with CUDA ${{ matrix.cuda-version }}
         run: |
@@ -78,7 +83,7 @@ jobs:
       - name: Build wheel
         shell: bash
         env:
-          CMAKE_BUILD_TYPE: Release
+          CMAKE_BUILD_TYPE: Release # do not compile with debug symbol to reduce wheel size
         run: |
           bash -x .github/workflows/scripts/build.sh ${{ matrix.python-version }} ${{ matrix.cuda-version }}
           wheel_name=$(ls dist/*whl | xargs -n 1 basename)

+ 2 - 2
.github/workflows/scripts/build.sh

@@ -12,9 +12,9 @@ $python_executable -m pip install wheel packaging
 $python_executable -m pip install -r requirements-cuda.txt
 
 # Limit the number of parallel jobs to avoid OOM
-export MAX_JOBS=28
+export MAX_JOBS=2
 
 export TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX"
 
 # Build
-$python_executable setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38
+$python_executable setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38