Unverified Commit 68e085ec authored by Matthias Fey's avatar Matthias Fey Committed by GitHub
Browse files

PyTorch 1.11 Support (#277)

* check pytorch 1.11

* updatE

* update

* typo

* update

* typo
parent 3e36ea5c
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
...@@ -30,16 +35,10 @@ jobs: ...@@ -30,16 +35,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
...@@ -141,7 +141,7 @@ tensor([[5, 5, 3, 4, 0, 1] ...@@ -141,7 +141,7 @@ tensor([[5, 5, 3, 4, 0, 1]
## Running tests ## Running tests
``` ```
python setup.py test pytest
``` ```
## C++ API ## C++ API
......
numpy
https://download.pytorch.org/whl/cpu/torch-1.5.0%2Bcpu-cp37-cp37m-linux_x86_64.whl https://download.pytorch.org/whl/cpu/torch-1.5.0%2Bcpu-cp37-cp37m-linux_x86_64.whl
sphinx>=3 sphinx>=3
sphinx_rtd_theme sphinx_rtd_theme
...@@ -4,7 +4,7 @@ build: ...@@ -4,7 +4,7 @@ build:
image: latest image: latest
python: python:
version: 3.7 version: 3.8
system_packages: true system_packages: true
install: install:
- requirements: docs/requirements.txt - requirements: docs/requirements.txt
......
[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__ = '2.0.9'
URL = 'https://github.com/rusty1s/pytorch_scatter'
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']
...@@ -85,27 +88,31 @@ def get_extensions(): ...@@ -85,27 +88,31 @@ def get_extensions():
install_requires = [] install_requires = []
setup_requires = []
tests_require = ['pytest', 'pytest-runner', 'pytest-cov'] test_require = [
'pytest',
'pytest-cov',
]
setup( setup(
name='torch_scatter', name='torch_scatter',
version='2.0.9', version=__version__,
description='PyTorch Extension Library of Optimized Scatter Operations',
author='Matthias Fey', author='Matthias Fey',
author_email='matthias.fey@tu-dortmund.de', author_email='matthias.fey@tu-dortmund.de',
url='https://github.com/rusty1s/pytorch_scatter', url=URL,
description='PyTorch Extension Library of Optimized Scatter Operations', download_url=f'{URL}/archive/{__version__}.tar.gz',
keywords=['pytorch', 'scatter', 'segment', 'gather'], keywords=['pytorch', 'scatter', 'segment', 'gather'],
license='MIT', python_requires='>=3.7',
python_requires='>=3.6',
install_requires=install_requires, install_requires=install_requires,
setup_requires=setup_requires, extras_require={
tests_require=tests_require, 'test': test_require,
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,
) )
...@@ -2,10 +2,10 @@ from itertools import product ...@@ -2,10 +2,10 @@ from itertools import product
import pytest import pytest
import torch import torch
from torch.autograd import gradcheck
import torch_scatter import torch_scatter
from torch.autograd import gradcheck
from .utils import reductions, tensor, dtypes, devices from .utils import devices, dtypes, reductions, tensor
reductions = reductions + ['mul'] reductions = reductions + ['mul']
...@@ -13,7 +13,7 @@ tests = [ ...@@ -13,7 +13,7 @@ tests = [
{ {
'src': [1, 3, 2, 4, 5, 6], 'src': [1, 3, 2, 4, 5, 6],
'index': [0, 1, 0, 1, 1, 3], 'index': [0, 1, 0, 1, 1, 3],
'dim': 0, 'dim': -1,
'sum': [3, 12, 0, 6], 'sum': [3, 12, 0, 6],
'add': [3, 12, 0, 6], 'add': [3, 12, 0, 6],
'mul': [2, 60, 1, 6], 'mul': [2, 60, 1, 6],
......
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