Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,3 @@ runs:
run: |
bash ./.github/workflows/cuda/${{ runner.os }}.sh ${{ inputs.cuda-version }}
shell: bash

- name: Install PyTorch ${{ inputs.torch-version }}+${{ inputs.cuda-version }}
run: |
pip install torch==${{ inputs.torch-version }} --extra-index-url https://download.pytorch.org/whl/${{ inputs.cuda-version }}
python -c "import torch; print('PyTorch:', torch.__version__)"
python -c "import torch; print('CUDA:', torch.version.cuda)"
python -c "import torch; print('CXX11 ABI:', torch.compiled_with_cxx11_abi())"
shell: bash

- name: Disable CUDNN
if: ${{ (inputs.cuda-version != 'cpu') && ((inputs.torch-version == '1.12.0') || (inputs.torch-version == '1.13.0')) }}
run: |
Torch_DIR=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'`
sed -i '95,100d' ${Torch_DIR}/Caffe2/Caffe2Config.cmake
sed -i 's/;caffe2::cudnn-public//g' ${Torch_DIR}/Caffe2/Caffe2Targets.cmake
shell: bash

- name: Downgrade GLIBC
if: ${{ runner.os == 'Linux' }}
run: |
sed -i '1s/^/#if defined(__linux__) \&\& defined(__x86_64__)\n__asm__(".symver log,log@GLIBC_2.2.5");\n#endif\n/' third_party/METIS/GKlib/gk_proto.h
sed -i '1s/^/#if defined(__linux__) \&\& defined(__x86_64__)\n__asm__(".symver pow,pow@GLIBC_2.2.5");\n#endif\n/' third_party/METIS/libmetis/metislib.h
shell: bash

- name: Install additional dependencies
run: |
pip install setuptools ninja wheel
shell: bash
159 changes: 34 additions & 125 deletions .github/workflows/building.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Building Wheels

on: [workflow_dispatch] # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches:
- aki/manylinux

concurrency:
group: aki_hobby
cancel-in-progress: true

jobs:

Expand All @@ -10,126 +18,20 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-14, windows-2019]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
# torch-version: [1.13.0, 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.4.0, 2.5.0, 2.6.0, 2.7.0]
torch-version: [2.7.0]
cuda-version: ['cpu', 'cu117', 'cu118', 'cu121', 'cu124', 'cu126', 'cu128']
exclude:
- torch-version: 1.13.0
python-version: '3.13'
- torch-version: 2.0.0
python-version: '3.13'
- torch-version: 2.1.0
python-version: '3.13'
- torch-version: 2.2.0
python-version: '3.13'
- torch-version: 2.3.0
python-version: '3.13'
- torch-version: 2.4.0
python-version: '3.13'
- torch-version: 2.5.0
python-version: '3.13'
- torch-version: 1.13.0
python-version: '3.12'
- torch-version: 2.0.0
python-version: '3.12'
- torch-version: 2.1.0
python-version: '3.12'
- torch-version: 1.13.0
python-version: '3.11'
- torch-version: 1.13.0
cuda-version: 'cu118'
- torch-version: 1.13.0
cuda-version: 'cu121'
- torch-version: 1.13.0
cuda-version: 'cu124'
- torch-version: 1.13.0
cuda-version: 'cu126'
- torch-version: 1.13.0
cuda-version: 'cu128'
- torch-version: 2.0.0
cuda-version: 'cu124'
- torch-version: 2.0.0
cuda-version: 'cu126'
- torch-version: 2.0.0
cuda-version: 'cu128'
- torch-version: 2.1.0
cuda-version: 'cu117'
- torch-version: 2.1.0
cuda-version: 'cu124'
- torch-version: 2.1.0
cuda-version: 'cu126'
- torch-version: 2.1.0
cuda-version: 'cu128'
- torch-version: 2.2.0
cuda-version: 'cu117'
- torch-version: 2.2.0
cuda-version: 'cu124'
- torch-version: 2.2.0
cuda-version: 'cu126'
- torch-version: 2.2.0
cuda-version: 'cu128'
- torch-version: 2.3.0
cuda-version: 'cu117'
- torch-version: 2.3.0
cuda-version: 'cu124'
- torch-version: 2.3.0
cuda-version: 'cu126'
- torch-version: 2.3.0
cuda-version: 'cu128'
- torch-version: 2.4.0
cuda-version: 'cu117'
- torch-version: 2.4.0
cuda-version: 'cu126'
- torch-version: 2.4.0
cuda-version: 'cu128'
- torch-version: 2.5.0
cuda-version: 'cu117'
- torch-version: 2.5.0
cuda-version: 'cu126'
- torch-version: 2.5.0
cuda-version: 'cu128'
- torch-version: 2.6.0
cuda-version: 'cu117'
- torch-version: 2.6.0
cuda-version: 'cu121'
- torch-version: 2.6.0
cuda-version: 'cu128'
- torch-version: 2.7.0
cuda-version: 'cu117'
- torch-version: 2.7.0
cuda-version: 'cu121'
- torch-version: 2.7.0
cuda-version: 'cu124'
- os: macos-14
cuda-version: 'cu117'
- os: macos-14
cuda-version: 'cu118'
- os: macos-14
cuda-version: 'cu121'
- os: macos-14
cuda-version: 'cu124'
- os: macos-14
cuda-version: 'cu126'
- os: macos-14
cuda-version: 'cu128'
- os: windows-2019
torch-version: 2.0.0
cuda-version: 'cu121'
include:
- {os: ubuntu-22.04, torch-version: '2.6.0', python-version: '3.10', cuda-version: 'cpu'}
- {os: ubuntu-22.04, torch-version: '2.6.0', python-version: '3.10', cuda-version: 'cu118'}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
uses: ./.github/actions/setup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
torch-version: ${{ matrix.torch-version }}
cuda-version: ${{ matrix.cuda-version }}

- name: Set version on non-macOS
if: ${{ runner.os != 'macOS' }}
Expand All @@ -155,27 +57,34 @@ jobs:
- name: Build wheel
run: |
source ./.github/workflows/cuda/${{ runner.os }}-env.sh ${{ matrix.cuda-version }}
pip install build
python -m build --wheel --no-isolation --outdir dist
pip install cibuildwheel -U
python -m cibuildwheel --output-dir dist
shell: bash
env:
CIBW_BUILD: cp311-manylinux_x86_64
CIBW_BUILD_FRONTEND: 'build; args: --no-isolation'
CIBW_BEFORE_BUILD: 'dnf install -y python3.11-devel && bash ./tools/prepare_for_build.sh 2.6.0 cpu'
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28

- name: Test wheel
working-directory: dist
run: |
cd dist
ls -lah
pip install auditwheel
auditwheel repair *.whl

pip install *.whl
python -c "import pyg_lib; print('pyg-lib:', pyg_lib.__version__)"
python -c "import pyg_lib; print('CUDA:', pyg_lib.cuda_version())"
cd ..
shell: bash

- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
# - name: Configure AWS
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: us-west-1

- name: Upload wheel
run: |
aws s3 sync dist s3://data.pyg.org/whl/torch-${{ matrix.torch-version }}+${{ matrix.cuda-version }} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
# - name: Upload wheel
# run: |
# aws s3 sync dist s3://data.pyg.org/whl/torch-${{ matrix.torch-version }}+${{ matrix.cuda-version }} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
1 change: 1 addition & 0 deletions .github/workflows/cuda/Linux-env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -ex

case ${1} in
cu128)
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ if(WITH_CUDA)
set(CMAKE_CUDA_ARCHITECTURES "60;70;75")
endif()

enable_language(CUDA)
add_definitions(-DWITH_CUDA)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr -allow-unsupported-compiler")

if (NOT "$ENV{EXTERNAL_CUTLASS_INCLUDE_DIR}" STREQUAL "")
include_directories($ENV{EXTERNAL_CUTLASS_INCLUDE_DIR})
else()
Expand Down
58 changes: 58 additions & 0 deletions tools/prepare_for_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

# Usage:
# ./prepare_for_build.sh <torch_version> <cuda_version>
set -ex

# print system info:
uname -a

TORCH_VERSION="${1:?Specify torch version, e.g. 2.6.0}"
CUDA_VERSION="${2:?Specify cuda version, e.g. cu118}"

dnf install -y python3.11-devel python3.11-libs

pip install --progress-bar off -q setuptools ninja wheel build
pip install --progress-bar off -q torch=="${TORCH_VERSION}" --extra-index-url "https://download.pytorch.org/whl/${CUDA_VERSION}"
python -c "import torch; print(f'PyTorch: {torch.__version__}\nCUDA: {torch.version.cuda}\nCXX11 ABI: {torch.compiled_with_cxx11_abi()}')"

sed -i '1s/^/#if defined(__linux__) \&\& defined(__x86_64__)\n__asm__(".symver log,log@GLIBC_2.2.5");\n#endif\n/' third_party/METIS/GKlib/gk_proto.h
sed -i '1s/^/#if defined(__linux__) \&\& defined(__x86_64__)\n__asm__(".symver pow,pow@GLIBC_2.2.5");\n#endif\n/' third_party/METIS/libmetis/metislib.h

######################

# Install CUDA 12.8
# aria2c -s 16 -x 16 https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda-repo-rhel8-12-8-local-12.8.0_570.86.10-1.x86_64.rpm
# rpm -i cuda-repo-rhel8-12-8-local-12.8.0_570.86.10-1.x86_64.rpm
# dnf clean all && dnf -y install cuda-toolkit-12-8

# Install CUDA 11.8
if [ ! -f cuda-repo-rhel8-11-8-local-11.8.0_520.61.05-1.x86_64.rpm ]; then
dnf install -y aria2
aria2c -s 16 -x 16 https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-rhel8-11-8-local-11.8.0_520.61.05-1.x86_64.rpm
else
echo "cuda-repo-rhel8-11-8-local-11.8.0_520.61.05-1.x86_64.rpm already exists"
fi
rpm -i cuda-repo-rhel8-11-8-local-11.8.0_520.61.05-1.x86_64.rpm
dnf clean all
dnf -y module install nvidia-driver:latest-dkms
dnf -y install cuda

ls -al /usr/local/ | grep -i cuda

export CUDA_HOME=/usr/local/cuda-11.8
export PATH=$CUDA_HOME/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH

echo "CUDA_HOME: $CUDA_HOME"
echo "PATH: $PATH"
echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"

nvcc --version

# source .github/workflows/cuda/Linux-env.sh cu118

echo "CUDA_HOME: $CUDA_HOME"
echo "PATH: $PATH"
echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
echo "TORCH_CUDA_ARCH_LIST: $TORCH_CUDA_ARCH_LIST"
Loading