-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotfix(MInference): fix the pip setup (#8)
Co-authored-by: Yucheng Li <[email protected]> Co-authored-by: Chengruidong Zhang <[email protected]>
- Loading branch information
1 parent
cfda78c
commit 7e06bd3
Showing
7 changed files
with
166 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,8 +50,40 @@ jobs: | |
matrix: | ||
os: ['ubuntu-20.04'] | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
pytorch-version: ['2.3.0'] # Must be the most recent version that meets requirements-cuda.txt. | ||
cuda-version: ['11.8', '12.1'] | ||
torch-version: ['2.2.2', '2.3.0'] | ||
cuda-version: ['12.2.2'] | ||
exclude: | ||
# see https://github.com/pytorch/pytorch/blob/main/RELEASE.md#release-compatibility-matrix | ||
# Pytorch < 2.2 does not support Python 3.12 | ||
- pytorch-version: '1.12.1' | ||
python-version: '3.12' | ||
- pytorch-version: '1.13.1' | ||
python-version: '3.12' | ||
- pytorch-version: '2.0.1' | ||
python-version: '3.12' | ||
- pytorch-version: '2.1.2' | ||
python-version: '3.12' | ||
# Pytorch <= 1.12 does not support Python 3.11 | ||
- pytorch-version: '1.12.1' | ||
python-version: '3.11' | ||
# Pytorch >= 2.0 only supports Python >= 3.8 | ||
- pytorch-version: '2.0.1' | ||
python-version: '3.7' | ||
- pytorch-version: '2.1.2' | ||
python-version: '3.7' | ||
- pytorch-version: '2.2.2' | ||
python-version: '3.7' | ||
- pytorch-version: '2.3.0' | ||
python-version: '3.7' | ||
- pytorch-version: '2.4.0.dev20240407' | ||
python-version: '3.7' | ||
# Pytorch <= 2.0 only supports CUDA <= 11.8 | ||
- pytorch-version: '1.12.1' | ||
cuda-version: '12.2.2' | ||
- pytorch-version: '1.13.1' | ||
cuda-version: '12.2.2' | ||
- pytorch-version: '2.0.1' | ||
cuda-version: '12.2.2' | ||
|
||
steps: | ||
- name: Checkout | ||
|
@@ -80,8 +112,18 @@ jobs: | |
echo "MATRIX_PYTHON_VERSION=$(echo ${{ matrix.python-version }} | awk -F \. {'print $1 $2'})" >> $GITHUB_ENV | ||
- name: Install CUDA ${{ matrix.cuda-version }} | ||
run: | | ||
bash -x .github/workflows/scripts/cuda-install.sh ${{ matrix.cuda-version }} ${{ matrix.os }} | ||
if: ${{ matrix.cuda-version != 'cpu' }} | ||
uses: Jimver/[email protected] | ||
id: cuda-toolkit | ||
with: | ||
cuda: ${{ matrix.cuda-version }} | ||
linux-local-args: '["--toolkit"]' | ||
# default method is "local", and we're hitting some error with caching for CUDA 11.8 and 12.1 | ||
# method: ${{ (matrix.cuda-version == '11.8.0' || matrix.cuda-version == '12.1.0') && 'network' || 'local' }} | ||
method: 'network' | ||
# We need the cuda libraries (e.g. cuSparse, cuSolver) for compiling PyTorch extensions, | ||
# not just nvcc | ||
# sub-packages: '["nvcc"]' | ||
|
||
- name: Install PyTorch ${{ matrix.pytorch-version }} with CUDA ${{ matrix.cuda-version }} | ||
run: | | ||
|
@@ -94,7 +136,7 @@ jobs: | |
run: | | ||
bash -x .github/workflows/scripts/build.sh ${{ matrix.python-version }} ${{ matrix.cuda-version }} bdist_wheel | ||
wheel_name=$(ls dist/*whl | xargs -n 1 basename) | ||
asset_name=${wheel_name//"linux"/"manylinux1"} | ||
asset_name=${wheel_name} | ||
echo "wheel_name=${wheel_name}" >> $GITHUB_ENV | ||
echo "asset_name=${asset_name}" >> $GITHUB_ENV | ||
|
@@ -114,7 +156,7 @@ jobs: | |
path: ./dist/${{ env.wheel_name }} | ||
publish_package: | ||
name: Publish Python 🐍 distribution 📦 to PyPI | ||
needs: [release] | ||
needs: [release, wheel] | ||
runs-on: ${{ matrix.os }} | ||
environment: | ||
name: pypi | ||
|
@@ -128,7 +170,7 @@ jobs: | |
os: ['ubuntu-20.04'] | ||
python-version: ['3.10'] | ||
pytorch-version: ['2.3.0'] # Must be the most recent version that meets requirements-cuda.txt. | ||
cuda-version: ['12.1'] | ||
cuda-version: ['12.2.2'] | ||
|
||
steps: | ||
- name: Checkout | ||
|
@@ -150,9 +192,25 @@ jobs: | |
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install CUDA ${{ matrix.cuda-version }} | ||
- name: Set CUDA and PyTorch versions | ||
run: | | ||
bash -x .github/workflows/scripts/cuda-install.sh ${{ matrix.cuda-version }} ${{ matrix.os }} | ||
echo "MATRIX_CUDA_VERSION=$(echo ${{ matrix.cuda-version }} | awk -F \. {'print $1 $2'})" >> $GITHUB_ENV | ||
echo "MATRIX_TORCH_VERSION=$(echo ${{ matrix.pytorch-version }} | awk -F \. {'print $1 "." $2'})" >> $GITHUB_ENV | ||
echo "MATRIX_PYTHON_VERSION=$(echo ${{ matrix.python-version }} | awk -F \. {'print $1 $2'})" >> $GITHUB_ENV | ||
- name: Install CUDA ${{ matrix.cuda-version }} | ||
if: ${{ matrix.cuda-version != 'cpu' }} | ||
uses: Jimver/[email protected] | ||
id: cuda-toolkit | ||
with: | ||
cuda: ${{ matrix.cuda-version }} | ||
linux-local-args: '["--toolkit"]' | ||
# default method is "local", and we're hitting some error with caching for CUDA 11.8 and 12.1 | ||
# method: ${{ (matrix.cuda-version == '11.8.0' || matrix.cuda-version == '12.1.0') && 'network' || 'local' }} | ||
method: 'network' | ||
# We need the cuda libraries (e.g. cuSparse, cuSolver) for compiling PyTorch extensions, | ||
# not just nvcc | ||
# sub-packages: '["nvcc"]' | ||
|
||
- name: Install PyTorch ${{ matrix.pytorch-version }} with CUDA ${{ matrix.cuda-version }} | ||
run: | | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
recursive-include csrc *.cu | ||
recursive-include csrc *.cpp |
This file contains 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
This file contains 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
This file contains 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