Commit 19deedfc authored by rusty1s's avatar rusty1s
Browse files

rquire python 3.6

parent 3c4582ed
......@@ -17,14 +17,10 @@ env:
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu92
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu100
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu101
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cpu
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cpu
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu101
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cpu
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu92
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu100
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu101
jobs:
exclude: # Exclude *all* macOS CUDA jobs and Windows CUDA 9.2/10.0 jobs.
......@@ -46,12 +42,6 @@ jobs:
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
- os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu101
- os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu92
- os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu100
- os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu101
- os: windows
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu92
- os: windows
......@@ -64,24 +54,21 @@ jobs:
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92
- os: windows
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
- os: windows
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu92
- os: windows
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu100
install:
- source script/cuda.sh
- source script/conda.sh
- pip install flake8 codecov
- python setup.py install
script:
- if [ "${PYTHON_VERSION}" != "3.5" ]; then pip install flake8 && flake8 .; fi
- flake8 .
- python setup.py test
after_success:
- python setup.py bdist_wheel --dist-dir=dist/torch-${TORCH_VERSION}
- python script/rename_wheel.py ${IDX}
- pip install codecov && codecov
- codecov
deploy:
provider: s3
region: eu-central-1
......
......@@ -37,11 +37,11 @@ def get_extensions():
sources = [main]
path = osp.join(extensions_dir, 'cpu', name + '_cpu.cpp')
path = osp.join(extensions_dir, 'cpu', f'{name}_cpu.cpp')
if osp.exists(path):
sources += [path]
path = osp.join(extensions_dir, 'cuda', name + '_cuda.cu')
path = osp.join(extensions_dir, 'cuda', f'{name}_cuda.cu')
if WITH_CUDA and osp.exists(path):
sources += [path]
......@@ -70,7 +70,7 @@ setup(
description='PyTorch Extension Library of Optimized Scatter Operations',
keywords=['pytorch', 'scatter', 'segment', 'gather'],
license='MIT',
python_requires='>=3.5',
python_requires='>=3.6',
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
......
# flake8: noqa
import glob
import importlib
import os.path as osp
import torch
......@@ -9,16 +9,16 @@ __version__ = '2.0.3'
expected_torch_version = (1, 4)
try:
torch.ops.load_library(
glob.glob(osp.join(osp.dirname(__file__), '_version.*'))[0])
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
'_version', [osp.dirname(__file__)]).origin)
except OSError as e:
if 'undefined symbol' in str(e):
major, minor = [int(x) for x in torch.__version__.split('.')[:2]]
t_major, t_minor = expected_torch_version
if major != t_major or (major == t_major and minor != t_minor):
raise RuntimeError(
'Expected PyTorch version {}.{} but found version '
'{}.{}.'.format(t_major, t_minor, major, minor))
f'Expected PyTorch version {t_major}.{t_minor} but found '
f'version {major}.{minor}.')
raise OSError(e)
from .scatter import (scatter_sum, scatter_add, scatter_mean, scatter_min,
......@@ -43,11 +43,11 @@ if cuda_version != -1 and torch.version.cuda is not None: # pragma: no cover
if t_major != major or t_minor != minor:
raise RuntimeError(
'Detected that PyTorch and torch_scatter were compiled with '
'different CUDA versions. PyTorch has CUDA version={}.{} and '
'torch_scatter has CUDA version={}.{}. Please reinstall the '
'torch_scatter that matches your PyTorch install.'.format(
t_major, t_minor, major, minor))
f'Detected that PyTorch and torch_scatter were compiled with '
f'different CUDA versions. PyTorch has CUDA version '
f'{t_major}.{t_minor} and torch_scatter has CUDA version '
f'{major}.{minor}. Please reinstall the torch_scatter that '
f'matches your PyTorch install.')
__all__ = [
'scatter_sum',
......
import glob
import importlib
import os.path as osp
from typing import Optional, Tuple
......@@ -6,8 +6,8 @@ import torch
from .utils import broadcast
torch.ops.load_library(
glob.glob(osp.join(osp.dirname(__file__), '_scatter.*'))[0])
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
'_scatter', [osp.dirname(__file__)]).origin)
@torch.jit.script
......
import glob
import importlib
import os.path as osp
from typing import Optional, Tuple
import torch
torch.ops.load_library(
glob.glob(osp.join(osp.dirname(__file__), '_segment_coo.*'))[0])
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
'_segment_coo', [osp.dirname(__file__)]).origin)
@torch.jit.script
......
import glob
import importlib
import os.path as osp
from typing import Optional, Tuple
import torch
torch.ops.load_library(
glob.glob(osp.join(osp.dirname(__file__), '_segment_csr.*'))[0])
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
'_segment_csr', [osp.dirname(__file__)]).origin)
@torch.jit.script
......
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