diff --git a/.github/workflows/building-conda.yml b/.github/workflows/building-conda.yml deleted file mode 100644 index 24d3ba54..00000000 --- a/.github/workflows/building-conda.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Building Conda - -on: [workflow_dispatch] - -jobs: - - conda-build: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - os: [ubuntu-20.04, macos-14, windows-2019] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - torch-version: [2.5.0] # [2.3.0, 2.4.0, 2.5.0] - cuda-version: ['cpu', 'cu118', 'cu121', 'cu124'] - exclude: - - torch-version: 2.5.0 - python-version: '3.8' - - torch-version: 2.3.0 - cuda-version: 'cu124' - - os: macos-14 - cuda-version: 'cu118' - - os: macos-14 - cuda-version: 'cu121' - - os: macos-14 - cuda-version: 'cu124' - - steps: - - uses: actions/checkout@v2 - - name: Set up Conda for Python ${{ matrix.python-version }} - uses: conda-incubator/setup-miniconda@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Free Disk Space (Ubuntu) - if: ${{ runner.os == 'Linux' }} - uses: jlumbroso/free-disk-space@main - - - name: Install Conda packages - run: | - conda install conda-build conda-verify --yes - shell: - bash -l {0} - - - name: Install CUDA ${{ matrix.cuda-version }} - if: ${{ matrix.cuda-version != 'cpu' }} - run: | - bash .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}.sh - shell: - bash - - - name: Build Conda package for CPU - if: ${{ matrix.cuda-version == 'cpu' }} - run: | - FORCE_CUDA=0 TORCH_CUDA_ARCH_LIST=0 ./conda/pytorch-scatter/build_conda.sh ${{ matrix.python-version }} ${{ matrix.torch-version }} ${{ matrix.cuda-version }} - shell: - bash -l {0} - - - name: Build Conda package for GPU - if: ${{ matrix.cuda-version != 'cpu' }} - run: | - source .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}-env.sh - ./conda/pytorch-scatter/build_conda.sh ${{ matrix.python-version }} ${{ matrix.torch-version }} ${{ matrix.cuda-version }} - shell: - bash -l {0} - - - name: Publish Conda package on organization channel - run: | - conda install anaconda-client --yes - anaconda upload --force --label main $HOME/conda-bld/*/*.tar.bz2 - env: - ANACONDA_API_TOKEN: ${{ secrets.PYG_ANACONDA_TOKEN }} - shell: - bash -l {0} - - - name: Publish Conda package on personal channel - run: | - conda install anaconda-client --yes - anaconda upload --force --label main $HOME/conda-bld/*/*.tar.bz2 - env: - ANACONDA_API_TOKEN: ${{ secrets.RUSTY1S_ANACONDA_TOKEN }} - shell: - bash -l {0} diff --git a/.github/workflows/building.yml b/.github/workflows/building.yml index a4bbb38d..e00c2935 100644 --- a/.github/workflows/building.yml +++ b/.github/workflows/building.yml @@ -11,20 +11,22 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, macos-14, windows-2019] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - torch-version: [2.5.0] # [2.3.0, 2.4.0, 2.5.0] - cuda-version: ['cpu', 'cu118', 'cu121', 'cu124'] + python-version: ['3.9', '3.10', '3.11', '3.12'] + torch-version: [2.6.0] # [2.5.0] + cuda-version: ['cpu', 'cu118', 'cu121', 'cu124', 'cu126'] exclude: - torch-version: 2.5.0 - python-version: '3.8' - - torch-version: 2.3.0 - cuda-version: 'cu124' + cuda-version: 'cu126' + - torch-version: 2.6.0 + cuda-version: 'cu121' - os: macos-14 cuda-version: 'cu118' - os: macos-14 cuda-version: 'cu121' - os: macos-14 cuda-version: 'cu124' + - os: macos-14 + cuda-version: 'cu126' steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/cuda/cu126-Linux-env.sh b/.github/workflows/cuda/cu126-Linux-env.sh new file mode 100644 index 00000000..bad961ef --- /dev/null +++ b/.github/workflows/cuda/cu126-Linux-env.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +CUDA_HOME=/usr/local/cuda-12.6 +LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH} +PATH=${CUDA_HOME}/bin:${PATH} + +export FORCE_CUDA=1 +export TORCH_CUDA_ARCH_LIST="5.0+PTX;6.0;7.0;7.5;8.0;8.6;9.0" diff --git a/.github/workflows/cuda/cu126-Linux.sh b/.github/workflows/cuda/cu126-Linux.sh new file mode 100755 index 00000000..99759545 --- /dev/null +++ b/.github/workflows/cuda/cu126-Linux.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +OS=ubuntu2004 + +wget -nv https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/cuda-${OS}.pin +sudo mv cuda-${OS}.pin /etc/apt/preferences.d/cuda-repository-pin-600 +wget -nv https://developer.download.nvidia.com/compute/cuda/12.6.0/local_installers/cuda-repo-${OS}-12-6-local_12.6.0-560.28.03-1_amd64.deb +sudo dpkg -i cuda-repo-${OS}-12-6-local_12.6.0-560.28.03-1_amd64.deb +sudo cp /var/cuda-repo-${OS}-12-6-local/cuda-*-keyring.gpg /usr/share/keyrings/ + +sudo apt-get -qq update +sudo apt install cuda-nvcc-12-6 cuda-libraries-dev-12-6 +sudo apt clean + +rm -f https://developer.download.nvidia.com/compute/cuda/12.6.0/local_installers/cuda-repo-${OS}-12-6-local_12.6.0-560.28.03-1_amd64.deb diff --git a/.github/workflows/cuda/cu126-Windows-env.sh b/.github/workflows/cuda/cu126-Windows-env.sh new file mode 100644 index 00000000..c68771bd --- /dev/null +++ b/.github/workflows/cuda/cu126-Windows-env.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v12.6 +PATH=${CUDA_HOME}/bin:$PATH +PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH + +export FORCE_CUDA=1 +export TORCH_CUDA_ARCH_LIST="6.0+PTX" diff --git a/.github/workflows/cuda/cu126-Windows.sh b/.github/workflows/cuda/cu126-Windows.sh new file mode 100755 index 00000000..193d014b --- /dev/null +++ b/.github/workflows/cuda/cu126-Windows.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Install NVIDIA drivers, see: +# https://github.com/pytorch/vision/blob/master/packaging/windows/internal/cuda_install.bat#L99-L102 +curl -k -L "https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output "/tmp/gpu_driver_dlls.zip" +7z x "/tmp/gpu_driver_dlls.zip" -o"/c/Windows/System32" + +export CUDA_SHORT=12.6 +export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers +export CUDA_FILE=cuda_${CUDA_SHORT}.0_560.76_windows.exe + +# Install CUDA: +curl -k -L "${CUDA_URL}/${CUDA_FILE}" --output "${CUDA_FILE}" +echo "" +echo "Installing from ${CUDA_FILE}..." +PowerShell -Command "Start-Process -FilePath \"${CUDA_FILE}\" -ArgumentList \"-s nvcc_${CUDA_SHORT} cuobjdump_${CUDA_SHORT} nvprune_${CUDA_SHORT} cupti_${CUDA_SHORT} cublas_dev_${CUDA_SHORT} cudart_${CUDA_SHORT} cufft_dev_${CUDA_SHORT} curand_dev_${CUDA_SHORT} cusolver_dev_${CUDA_SHORT} cusparse_dev_${CUDA_SHORT} thrust_${CUDA_SHORT} npp_dev_${CUDA_SHORT} nvrtc_dev_${CUDA_SHORT} nvml_dev_${CUDA_SHORT}\" -Wait -NoNewWindow" +echo "Done!" +rm -f "${CUDA_FILE}" diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index b99298f9..6eb49464 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -16,7 +16,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] python-version: [3.9] - torch-version: [2.4.0, 2.5.0] + torch-version: [2.5.0, 2.6.0] steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 2039c83e..64e6bca9 100644 --- a/README.md +++ b/README.md @@ -41,42 +41,33 @@ All included operations are broadcastable, work on varying data types, are imple ## Installation -### Anaconda - -**Update:** You can now install `pytorch-scatter` via [Anaconda](https://anaconda.org/pyg/pytorch-scatter) for all major OS/PyTorch/CUDA combinations 🤗 -Given that you have [`pytorch >= 1.8.0` installed](https://pytorch.org/get-started/locally/), simply run - -``` -conda install pytorch-scatter -c pyg -``` - ### Binaries -We alternatively provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://data.pyg.org/whl). +We provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://data.pyg.org/whl). -#### PyTorch 2.5 +#### PyTorch 2.6 -To install the binaries for PyTorch 2.5.0, simply run +To install the binaries for PyTorch 2.6.0, simply run ``` -pip install torch-scatter -f https://data.pyg.org/whl/torch-2.5.0+${CUDA}.html +pip install torch-scatter -f https://data.pyg.org/whl/torch-2.6.0+${CUDA}.html ``` -where `${CUDA}` should be replaced by either `cpu`, `cu118`, `cu121`, or `cu124` depending on your PyTorch installation. +where `${CUDA}` should be replaced by either `cpu`, `cu118`, `cu124`, or `cu126` depending on your PyTorch installation. -| | `cpu` | `cu118` | `cu121` | `cu124` | +| | `cpu` | `cu118` | `cu124` | `cu126` | |-------------|-------|---------|---------|---------| | **Linux** | ✅ | ✅ | ✅ | ✅ | | **Windows** | ✅ | ✅ | ✅ | ✅ | | **macOS** | ✅ | | | | -#### PyTorch 2.4 +#### PyTorch 2.5 -To install the binaries for PyTorch 2.4.0, simply run +To install the binaries for PyTorch 2.5.0/2.5.1, simply run ``` -pip install torch-scatter -f https://data.pyg.org/whl/torch-2.4.0+${CUDA}.html +pip install torch-scatter -f https://data.pyg.org/whl/torch-2.5.0+${CUDA}.html ``` where `${CUDA}` should be replaced by either `cpu`, `cu118`, `cu121`, or `cu124` depending on your PyTorch installation. @@ -87,7 +78,7 @@ where `${CUDA}` should be replaced by either `cpu`, `cu118`, `cu121`, or `cu124` | **Windows** | ✅ | ✅ | ✅ | ✅ | | **macOS** | ✅ | | | | -**Note:** Binaries of older versions are also provided for PyTorch 1.4.0, PyTorch 1.5.0, PyTorch 1.6.0, PyTorch 1.7.0/1.7.1, PyTorch 1.8.0/1.8.1, PyTorch 1.9.0, PyTorch 1.10.0/1.10.1/1.10.2, PyTorch 1.11.0, PyTorch 1.12.0/1.12.1, PyTorch 1.13.0/1.13.1, PyTorch 2.0.0/2.0.1, PyTorch 2.1.0/2.1.1/2.1.2, PyTorch 2.2.0/2.2.1/2.2.2, and PyTorch 2.3.0/2.3.1 (following the same procedure). +**Note:** Binaries of older versions are also provided for PyTorch 1.4.0, PyTorch 1.5.0, PyTorch 1.6.0, PyTorch 1.7.0/1.7.1, PyTorch 1.8.0/1.8.1, PyTorch 1.9.0, PyTorch 1.10.0/1.10.1/1.10.2, PyTorch 1.11.0, PyTorch 1.12.0/1.12.1, PyTorch 1.13.0/1.13.1, PyTorch 2.0.0/2.0.1, PyTorch 2.1.0/2.1.1/2.1.2, PyTorch 2.2.0/2.2.1/2.2.2, PyTorch 2.3.0/2.3.1, and PyTorch 2.4.0/2.4.1 (following the same procedure). For older versions, you need to explicitly specify the latest supported version number or install via `pip install --no-index` in order to prevent a manual installation from source. You can look up the latest supported version number [here](https://data.pyg.org/whl). diff --git a/conda/pytorch-scatter/README.md b/conda/pytorch-scatter/README.md deleted file mode 100644 index 80d3bf62..00000000 --- a/conda/pytorch-scatter/README.md +++ /dev/null @@ -1,3 +0,0 @@ -``` -./build_conda.sh 3.11 2.5.0 cu118 # python, pytorch and cuda version -``` diff --git a/conda/pytorch-scatter/build_conda.sh b/conda/pytorch-scatter/build_conda.sh deleted file mode 100755 index 05c04e36..00000000 --- a/conda/pytorch-scatter/build_conda.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -export PYTHON_VERSION=$1 -export TORCH_VERSION=$2 -export CUDA_VERSION=$3 - -export CONDA_PYTORCH_CONSTRAINT="pytorch==${TORCH_VERSION%.*}.*" - -if [ "${CUDA_VERSION}" = "cpu" ]; then - export CONDA_CUDATOOLKIT_CONSTRAINT="cpuonly # [not osx]" -else - case $CUDA_VERSION in - cu124) - export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda==12.4.*" - ;; - cu121) - export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda==12.1.*" - ;; - cu118) - export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda==11.8.*" - ;; - cu117) - export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda==11.7.*" - ;; - cu116) - if [ "${TORCH_VERSION}" = "1.12.0" ]; then - export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.6.*" - else - export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda==11.6.*" - fi - ;; - cu115) - export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.5.*" - ;; - cu113) - export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.3.*" - ;; - cu111) - export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.1.*" - ;; - cu102) - export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==10.2.*" - ;; - cu101) - export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==10.1.*" - ;; - *) - echo "Unrecognized CUDA_VERSION=$CUDA_VERSION" - exit 1 - ;; - esac -fi - -echo "PyTorch $TORCH_VERSION+$CUDA_VERSION" -echo "- $CONDA_PYTORCH_CONSTRAINT" -echo "- $CONDA_CUDATOOLKIT_CONSTRAINT" - -if [ "${TORCH_VERSION}" = "1.12.0" ] && [ "${CUDA_VERSION}" = "cu116" ]; then - conda build . -c pytorch -c default -c nvidia -c conda-forge --output-folder "$HOME/conda-bld" -else - conda build . -c pytorch -c default -c nvidia --output-folder "$HOME/conda-bld" -fi diff --git a/conda/pytorch-scatter/meta.yaml b/conda/pytorch-scatter/meta.yaml deleted file mode 100644 index 03f10875..00000000 --- a/conda/pytorch-scatter/meta.yaml +++ /dev/null @@ -1,37 +0,0 @@ -package: - name: pytorch-scatter - version: 2.1.2 - -source: - path: ../.. - -requirements: - build: - - {{ compiler('c') }} # [win] - - host: - - pip - - python {{ environ.get('PYTHON_VERSION') }} - - {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }} - - {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT') }} - - run: - - python {{ environ.get('PYTHON_VERSION') }} - - {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }} - - {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT') }} - -build: - string: py{{ environ.get('PYTHON_VERSION').replace('.', '') }}_torch_{{ environ['TORCH_VERSION'] }}_{{ environ['CUDA_VERSION'] }} - script: pip install . - script_env: - - FORCE_CUDA - - TORCH_CUDA_ARCH_LIST - -test: - imports: - - torch_scatter - -about: - home: https://github.com/rusty1s/pytorch_scatter - license: MIT - summary: PyTorch Extension Library of Optimized Scatter Operations