Skip to content

Add PyTorch v2.3.1

Add PyTorch v2.3.1 #37

Workflow file for this run

name: Build Package
on:
push:
branches:
- main
jobs:
build-package:
runs-on: ubuntu-latest
strategy:
matrix:
include:
# torch 2.1.2
- cuda: "11.8.0"
python: "3.11"
torch_install_cmd: pip install torch==2.1.2 --index-url https://download.pytorch.org/whl/cu118
path: torch_cpp-1.0.0+torch212cu118-cp311-cp311-linux_x86_64.whl
- cuda: "11.8.0"
python: "3.10"
torch_install_cmd: pip install torch==2.1.2 --index-url https://download.pytorch.org/whl/cu118
path: torch_cpp-1.0.0+torch212cu118-cp310-cp310-linux_x86_64.whl
- cuda: "12.1.1"
python: "3.11"
torch_install_cmd: pip install torch==2.1.2 --index-url https://download.pytorch.org/whl/cu121
path: torch_cpp-1.0.0+torch212cu121-cp311-cp311-linux_x86_64.whl
- cuda: "12.1.1"
python: "3.10"
torch_install_cmd: pip install torch==2.1.2 --index-url https://download.pytorch.org/whl/cu121
path: torch_cpp-1.0.0+torch212cu121-cp310-cp310-linux_x86_64.whl
# torch 2.2.1
- cuda: "11.8.0"
python: "3.11"
torch_install_cmd: pip install torch==2.2.1 --index-url https://download.pytorch.org/whl/cu118
path: torch_cpp-1.0.0+torch221cu118-cp311-cp311-linux_x86_64.whl
- cuda: "11.8.0"
python: "3.10"
torch_install_cmd: pip install torch==2.2.1 --index-url https://download.pytorch.org/whl/cu118
path: torch_cpp-1.0.0+torch221cu118-cp310-cp310-linux_x86_64.whl
- cuda: "12.1.1"
python: "3.11"
torch_install_cmd: pip install torch==2.2.1 --index-url https://download.pytorch.org/whl/cu121
path: torch_cpp-1.0.0+torch221cu121-cp311-cp311-linux_x86_64.whl
- cuda: "12.1.1"
python: "3.10"
torch_install_cmd: pip install torch==2.2.1 --index-url https://download.pytorch.org/whl/cu121
path: torch_cpp-1.0.0+torch221cu121-cp310-cp310-linux_x86_64.whl
# torch 2.3.1
- cuda: "11.8.0"
python: "3.11"
torch_install_cmd: pip install torch==2.3.1 --index-url https://download.pytorch.org/whl/cu118
path: torch_cpp-1.0.0+torch231cu118-cp311-cp311-linux_x86_64.whl
- cuda: "11.8.0"
python: "3.10"
torch_install_cmd: pip install torch==2.3.1 --index-url https://download.pytorch.org/whl/cu118
path: torch_cpp-1.0.0+torch231cu118-cp310-cp310-linux_x86_64.whl
- cuda: "12.1.1"
python: "3.11"
torch_install_cmd: pip install torch==2.3.1 --index-url https://download.pytorch.org/whl/cu121
path: torch_cpp-1.0.0+torch231cu121-cp311-cp311-linux_x86_64.whl
- cuda: "12.1.1"
python: "3.10"
torch_install_cmd: pip install torch==2.3.1 --index-url https://download.pytorch.org/whl/cu121
path: torch_cpp-1.0.0+torch231cu121-cp310-cp310-linux_x86_64.whl
steps:
- name: Maximize build space
run: |
df -h
echo "\n\n"
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
df -h
echo "\n\n"
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: Jimver/[email protected]
id: cuda-toolkit
with:
cuda: ${{ matrix.cuda }}
linux-local-args: '["--toolkit"]'
use-github-cache: true
method: "network"
- run: sudo apt-get install ninja-build
- name: Install PyTorch
run: |
pip install wheel numpy && ${{ matrix.torch_install_cmd }}
- name: Save cache
id: cache-save
uses: actions/cache/@v4
with:
path: |
build
dist
torch_cpp.egg-info
key: ${{ matrix.python }}-${{ matrix.cuda }}-build-${{ github.sha }}
restore-keys: ${{ matrix.python }}-${{ matrix.cuda }}-build-
- name: Build
run: |
export TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6;8.9;9.0+PTX"
python setup.py bdist_wheel
- name: upload
uses: actions/upload-artifact@v4
with:
name: whl-${{ matrix.path }}
path: dist/${{ matrix.path }}
retention-days: 1
commit:
needs: build-package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Downloads
uses: actions/download-artifact@v4
with:
path: dist
pattern: whl-*
merge-multiple: true
- name: Commit push
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git pull --no-edit
git add -f ./dist/*
git commit -m 'update wheel' || echo "No Commit File"
git push