Commit f79c8e98 authored by rusty1s's avatar rusty1s
Browse files

version up + PyTorch 1.11 support

parent 3ec1eacf
...@@ -10,21 +10,29 @@ jobs: ...@@ -10,21 +10,29 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [windows-latest] #[ubuntu-18.04, macos-10.15, windows-latest] os: [ubuntu-18.04, macos-10.15, windows-2019]
python-version: [3.6, 3.7, 3.8, 3.9] python-version: ['3.7', '3.8', '3.9', '3.10']
torch-version: [1.10.0] torch-version: [1.10.0, 1.11.0]
cuda-version: ['cu113'] #['cpu', 'cu102', 'cu111', 'cu113'] cuda-version: ['cpu', 'cu102', 'cu113', 'cu115']
exclude: exclude:
- torch-version: 1.9.0
cuda-version: 'cu113'
- torch-version: 1.10.0 - torch-version: 1.10.0
cuda-version: 'cu111' cuda-version: 'cu115'
- os: macos-10.15 - torch-version: 1.10.0
python-version: '3.10'
- os: windows-2019
torch-version: 1.11.0
cuda-version: 'cu102' cuda-version: 'cu102'
- os: macos-10.15 - os: macos-10.15
cuda-version: 'cu111' cuda-version: 'cu102'
- os: macos-10.15 - os: macos-10.15
cuda-version: 'cu113' cuda-version: 'cu113'
- os: macos-10.15
cuda-version: 'cu115'
# There is a weird `glibc=2.27` bug going on for this combination:
- os: ubuntu-18.04
python-version: '3.10'
- os: ubuntu-18.04
cuda-version: 'cu115'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
......
...@@ -10,21 +10,28 @@ jobs: ...@@ -10,21 +10,28 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-18.04, macos-10.15, windows-latest] os: [ubuntu-18.04, macos-10.15, windows-2019]
python-version: [3.6, 3.7, 3.8, 3.9] python-version: ['3.7', '3.8', '3.9', '3.10']
torch-version: [1.10.0] torch-version: [1.10.0, 1.11.0]
cuda-version: ['cpu', 'cu102', 'cu111', 'cu113'] cuda-version: ['cpu', 'cu102', 'cu113', 'cu115']
exclude: exclude:
- torch-version: 1.9.0
cuda-version: 'cu113'
- torch-version: 1.10.0 - torch-version: 1.10.0
cuda-version: 'cu111' cuda-version: 'cu115'
- os: macos-10.15 - torch-version: 1.10.0
python-version: '3.10'
- os: windows-2019
torch-version: 1.11.0
cuda-version: 'cu102' cuda-version: 'cu102'
- os: macos-10.15 - os: macos-10.15
cuda-version: 'cu111' cuda-version: 'cu102'
- os: macos-10.15 - os: macos-10.15
cuda-version: 'cu113' cuda-version: 'cu113'
- os: macos-10.15
cuda-version: 'cu115'
# There is a weird bug going on for this combination:
- os: windows-2019
python-version: '3.7'
cuda-version: 'cu115'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
......
name: Linting name: Linting
on: [push, pull_request] on:
push:
branches:
- master
pull_request:
jobs: jobs:
flake8: flake8:
runs-on: ${{ matrix.os }} runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.6]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: 3.9
- name: Install dependencies - name: Install dependencies
run: | run: |
...@@ -26,3 +26,30 @@ jobs: ...@@ -26,3 +26,30 @@ jobs:
- name: Run linting - name: Run linting
run: | run: |
flake8 . flake8 .
pyroma:
runs-on: ubuntu-latest
strategy:
matrix:
torch-version: [1.11.0]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install PyTorch ${{ matrix.torch-version }}
run: |
pip install torch==${{ matrix.torch-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install dependencies
run: |
pip install pyroma
- name: Check package metadata
run: |
pyroma --min=10 .
name: Testing name: Testing
on: [push, pull_request] on:
push:
branches:
- master
pull_request:
jobs: jobs:
...@@ -8,10 +12,11 @@ jobs: ...@@ -8,10 +12,11 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest] os: [ubuntu-latest, windows-latest]
python-version: [3.6] python-version: [3.7]
torch-version: [1.9.0, 1.10.0] torch-version: [1.10.0, 1.11.0]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
...@@ -46,16 +51,10 @@ jobs: ...@@ -46,16 +51,10 @@ jobs:
- name: Run test-suite - name: Run test-suite
run: | run: |
python setup.py test pytest --cov --cov-report=xml
- name: Generate coverage report - name: Upload coverage
if: success()
run: |
pip install coverage
coverage xml
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v1 uses: codecov/codecov-action@v1
if: success() if: success()
with: with:
file: coverage.xml fail_ci_if_error: false
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
project(torchsparse) project(torchsparse)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
set(TORCHSPARSE_VERSION 0.6.12) set(TORCHSPARSE_VERSION 0.6.13)
option(WITH_CUDA "Enable CUDA support" OFF) option(WITH_CUDA "Enable CUDA support" OFF)
option(WITH_PYTHON "Link to Python when building" ON) option(WITH_PYTHON "Link to Python when building" ON)
......
...@@ -43,39 +43,41 @@ conda install pytorch-sparse -c pyg ...@@ -43,39 +43,41 @@ conda install pytorch-sparse -c pyg
We alternatively provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://data.pyg.org/whl). We alternatively provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://data.pyg.org/whl).
#### PyTorch 1.10.0 #### PyTorch 1.11
To install the binaries for PyTorch 1.10.0, simply run To install the binaries for PyTorch 1.11.0, simply run
``` ```
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.10.0+${CUDA}.html pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.11.0+${CUDA}.html
``` ```
where `${CUDA}` should be replaced by either `cpu`, `cu102`, or `cu113` depending on your PyTorch installation. where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu115` depending on your PyTorch installation.
| | `cpu` | `cu102` | `cu113` | | | `cpu` | `cu102` | `cu113` | `cu115` |
|-------------|-------|---------|---------| |-------------|-------|---------|---------|---------|
| **Linux** | ✅ | ✅ | ✅ | | **Linux** | ✅ | ✅ | ✅ | ✅ |
| **Windows** | ✅ | ✅ | ✅ | | **Windows** | ✅ | | ✅ | ✅ |
| **macOS** | ✅ | | | | **macOS** | ✅ | | | |
#### PyTorch 1.9.0/1.9.1 #### PyTorch 1.10
To install the binaries for PyTorch 1.9.0 and 1.9.1, simply run To install the binaries for PyTorch 1.10.0, PyTorch 1.10.1 and PyTorch 1.10.2, simply run
``` ```
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.9.0+${CUDA}.html pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.10.0+${CUDA}.html
``` ```
where `${CUDA}` should be replaced by either `cpu`, `cu102`, or `cu111` depending on your PyTorch installation. where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu111`, or `cu113` depending on your PyTorch installation.
| | `cpu` | `cu102` | `cu111` | | | `cpu` | `cu102` | `cu111` | `cu113` |
|-------------|-------|---------|---------| |-------------|-------|---------|---------|---------|
| **Linux** | ✅ | ✅ | ✅ | | **Linux** | ✅ | ✅ | ✅ | ✅ |
| **Windows** | ✅ | ✅ | ✅ | | **Windows** | ✅ | ✅ | ✅ | ✅ |
| **macOS** | ✅ | | | | **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 and PyTorch 1.8.0/1.8.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 and PyTorch 1.9.0 (following the same procedure).
For older versions, you might need to explicitly specify the latest supported version number in order to prevent a manual installation from source.
You can look up the latest supported version number [here](https://data.pyg.org/whl).
### From source ### From source
...@@ -308,5 +310,5 @@ make install ...@@ -308,5 +310,5 @@ make install
## Running tests ## Running tests
``` ```
python setup.py test pytest
``` ```
``` ```
./build_conda.sh 3.9 1.9.0 cu111 # python, pytorch and cuda version ./build_conda.sh 3.9 1.11.0 cu113 # python, pytorch and cuda version
``` ```
...@@ -10,6 +10,9 @@ if [ "${CUDA_VERSION}" = "cpu" ]; then ...@@ -10,6 +10,9 @@ if [ "${CUDA_VERSION}" = "cpu" ]; then
export CONDA_CUDATOOLKIT_CONSTRAINT="cpuonly # [not osx]" export CONDA_CUDATOOLKIT_CONSTRAINT="cpuonly # [not osx]"
else else
case $CUDA_VERSION in case $CUDA_VERSION in
cu115)
export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.5.*"
;;
cu113) cu113)
export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.3.*" export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.3.*"
;; ;;
...@@ -33,4 +36,4 @@ echo "PyTorch $TORCH_VERSION+$CUDA_VERSION" ...@@ -33,4 +36,4 @@ echo "PyTorch $TORCH_VERSION+$CUDA_VERSION"
echo "- $CONDA_PYTORCH_CONSTRAINT" echo "- $CONDA_PYTORCH_CONSTRAINT"
echo "- $CONDA_CUDATOOLKIT_CONSTRAINT" echo "- $CONDA_CUDATOOLKIT_CONSTRAINT"
conda build . -c pytorch -c nvidia -c pyg -c defaults -c conda-forge --output-folder "$HOME/conda-bld" conda build . -c pytorch -c pyg -c default -c nvidia --output-folder "$HOME/conda-bld"
package: package:
name: pytorch-sparse name: pytorch-sparse
version: 0.6.12 version: 0.6.13
source: source:
path: ../.. path: ../..
......
[metadata] [metadata]
description-file = README.md long_description=file: README.md
long_description_content_type=text/markdown
classifiers =
Development Status :: 5 - Production/Stable
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3 :: Only
[aliases] [aliases]
test = pytest test = pytest
[tool:pytest] [tool:pytest]
addopts = --capture=no --cov addopts = --capture=no
import os
import sys
import glob import glob
import os
import os.path as osp import os.path as osp
from itertools import product
from setuptools import setup, find_packages
import platform import platform
import sys
from itertools import product
import torch import torch
from setuptools import find_packages, setup
from torch.__config__ import parallel_info from torch.__config__ import parallel_info
from torch.utils.cpp_extension import BuildExtension from torch.utils.cpp_extension import (CUDA_HOME, BuildExtension, CppExtension,
from torch.utils.cpp_extension import CppExtension, CUDAExtension, CUDA_HOME CUDAExtension)
__version__ = '0.6.13'
URL = 'https://github.com/rusty1s/pytorch_sparse'
WITH_CUDA = torch.cuda.is_available() and CUDA_HOME is not None WITH_CUDA = torch.cuda.is_available() and CUDA_HOME is not None
suffices = ['cpu', 'cuda'] if WITH_CUDA else ['cpu'] suffices = ['cpu', 'cuda'] if WITH_CUDA else ['cpu']
...@@ -51,6 +54,7 @@ def get_extensions(): ...@@ -51,6 +54,7 @@ def get_extensions():
define_macros += [('MTMETIS_64BIT_WEIGHTS', None)] define_macros += [('MTMETIS_64BIT_WEIGHTS', None)]
define_macros += [('MTMETIS_64BIT_PARTITIONS', None)] define_macros += [('MTMETIS_64BIT_PARTITIONS', None)]
libraries += ['mtmetis', 'wildriver'] libraries += ['mtmetis', 'wildriver']
extra_compile_args = {'cxx': ['-O2']} extra_compile_args = {'cxx': ['-O2']}
if not os.name == 'nt': # Not on Windows: if not os.name == 'nt': # Not on Windows:
extra_compile_args['cxx'] += ['-Wno-sign-compare'] extra_compile_args['cxx'] += ['-Wno-sign-compare']
...@@ -110,29 +114,40 @@ def get_extensions(): ...@@ -110,29 +114,40 @@ def get_extensions():
return extensions return extensions
install_requires = ['scipy'] install_requires = [
setup_requires = [] 'scipy',
tests_require = ['pytest', 'pytest-runner', 'pytest-cov'] ]
test_requires = [
'pytest',
'pytest-cov',
]
setup( setup(
name='torch_sparse', name='torch_sparse',
version='0.6.12', version=__version__,
author='Matthias Fey',
author_email='matthias.fey@tu-dortmund.de',
url='https://github.com/rusty1s/pytorch_sparse',
description=('PyTorch Extension Library of Optimized Autograd Sparse ' description=('PyTorch Extension Library of Optimized Autograd Sparse '
'Matrix Operations'), 'Matrix Operations'),
keywords=['pytorch', 'sparse', 'sparse-matrices', 'autograd'], author='Matthias Fey',
license='MIT', author_email='matthias.fey@tu-dortmund.de',
python_requires='>=3.6', url=URL,
download_url=f'{URL}/archive/{__version__}.tar.gz',
keywords=[
'pytorch',
'sparse',
'sparse-matrices',
'autograd',
],
python_requires='>=3.7',
install_requires=install_requires, install_requires=install_requires,
setup_requires=setup_requires, extras_require={
tests_require=tests_require, 'test': test_requires,
extras_require={'test': tests_require}, },
ext_modules=get_extensions() if not BUILD_DOCS else [], ext_modules=get_extensions() if not BUILD_DOCS else [],
cmdclass={ cmdclass={
'build_ext': 'build_ext':
BuildExtension.with_options(no_python_abi_suffix=True, use_ninja=False) BuildExtension.with_options(no_python_abi_suffix=True, use_ninja=False)
}, },
packages=find_packages(), packages=find_packages(),
include_package_data=True,
) )
...@@ -3,7 +3,7 @@ import os.path as osp ...@@ -3,7 +3,7 @@ import os.path as osp
import torch import torch
__version__ = '0.6.12' __version__ = '0.6.13'
for library in [ for library in [
'_version', '_convert', '_diag', '_spmm', '_spspmm', '_metis', '_rw', '_version', '_convert', '_diag', '_spmm', '_spspmm', '_metis', '_rw',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment