fix: choose cuda arthitectures based on cuda version #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Package build | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - "scalellm/**" | |
| - "tests/**" | |
| - "setup.py" | |
| - "requirements.txt" | |
| - "requirements-test.txt" | |
| - ".github/workflows/package_test.yml" | |
| branches: | |
| - main | |
| pull_request: | |
| paths: | |
| - "scalellm/**" | |
| - "tests/**" | |
| - "setup.py" | |
| - "requirements.txt" | |
| - "requirements-test.txt" | |
| - ".github/workflows/package_test.yml" | |
| branches: | |
| - main | |
| env: | |
| # Tells where to store caches. | |
| CI_CACHE_DIR: ${{ github.workspace }}/../../ci_cache | |
| # cancel all previous runs if a new one is triggered | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_wheel: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: ["3.12"] | |
| cuda: ["12.8"] | |
| torch: ["2.7.0"] | |
| runs-on: [self-hosted, linux] | |
| env: | |
| PYTHON_VERSION: ${{ matrix.python }} | |
| CUDA_VERSION: ${{ matrix.cuda }} | |
| TORCH_VERSION: ${{ matrix.torch }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Create cache directory | |
| run: | | |
| mkdir -p $CI_CACHE_DIR/.vcpkg/bincache | |
| mkdir -p $CI_CACHE_DIR/.ccache | |
| mkdir -p $CI_CACHE_DIR/.pip | |
| - name: Build wheel | |
| timeout-minutes: 60 | |
| run: | | |
| docker pull vectorchai/scalellm_manylinux2_28:cuda${CUDA_VERSION} | |
| docker run --rm -t \ | |
| -v "$CI_CACHE_DIR":/ci_cache \ | |
| -v "$GITHUB_WORKSPACE":/ScaleLLM \ | |
| -e PYTHON_VERSION=${PYTHON_VERSION} \ | |
| -e CUDA_VERSION=${CUDA_VERSION} \ | |
| -e TORCH_VERSION=${TORCH_VERSION} \ | |
| -e VCPKG_DEFAULT_BINARY_CACHE=/ci_cache/.vcpkg/bincache \ | |
| -e CCACHE_DIR=/ci_cache/.ccache \ | |
| -e PIP_CACHE_DIR=/ci_cache/.pip \ | |
| -u $(id -u):$(id -g) \ | |
| vectorchai/scalellm_manylinux2_28:cuda${CUDA_VERSION} \ | |
| bash /ScaleLLM/.ci/scripts/build_wheel.sh | |
| - name: Show whl package size | |
| run: du -h dist/* | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: scalellm-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}-python${{ matrix.python }} | |
| path: dist/* | |
| test_wheel: | |
| needs: build_wheel | |
| strategy: | |
| matrix: | |
| python: ["3.12"] | |
| cuda: ["12.8"] | |
| torch: ["2.7.0"] | |
| runs-on: [self-hosted, linux, gpu] | |
| env: | |
| PYTHON_VERSION: ${{ matrix.python }} | |
| CUDA_VERSION: ${{ matrix.cuda }} | |
| TORCH_VERSION: ${{ matrix.torch }} | |
| steps: | |
| - name: Download wheel | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| pattern: scalellm-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}-python${{ matrix.python }} | |
| - name: Show whl package size | |
| run: du -h dist/* | |
| - name: Install the package and run pytest | |
| timeout-minutes: 10 | |
| run: | | |
| docker pull pytorch/manylinux2_28-builder:cuda${CUDA_VERSION} | |
| docker run --rm -t --gpus=all \ | |
| -v "$CI_CACHE_DIR":/ci_cache \ | |
| -v "$GITHUB_WORKSPACE":/ScaleLLM \ | |
| -e PYTHON_VERSION=${PYTHON_VERSION} \ | |
| -e CUDA_VERSION=${CUDA_VERSION} \ | |
| -e TORCH_VERSION=${TORCH_VERSION} \ | |
| -e PIP_CACHE_DIR=/ci_cache/.pip \ | |
| -u $(id -u):$(id -g) \ | |
| pytorch/manylinux2_28-builder:cuda${CUDA_VERSION} \ | |
| bash /ScaleLLM/.ci/scripts/run_pytest.sh |