Commit 1488dee0 authored by rusty1s's avatar rusty1s
Browse files

torch version check

parent 75a0b265
......@@ -67,17 +67,17 @@ jobs:
before_install:
- choco install python --version 3.7.6
- python -m pip install --upgrade --user pip
# - name: windows/cu92
# os: windows
# language: shell
# env:
# - FORCE_CUDA=1
# - CUDA_SHORT=9.2
# - CUDA=9.2.148
# - TORCH=${TORCH_VERSION}+92
# - PATH=/c/Python37:/c/Python37/Scripts:$PATH
# before_install:
# - choco install python --version 3.7.6
- name: windows/cu92
os: windows
language: shell
env:
- IDX=cu92
- CUDA_SHORT=9.2
- CUDA=9.2.148
- TORCH=${TORCH_VERSION}+${IDX}
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
before_install:
- choco install python --version 3.7.6
# - name: windows/cu100
# os: windows
# language: shell
......@@ -115,8 +115,7 @@ script:
- flake8 .
- python3 setup.py test || python setup.py test
after_success:
- if [ "${TRAVIS_OS_NAME}" != "windows" ]; then python3 setup.py bdist_wheel --dist-dir=dist/${IDX}; fi
- if [ "${TRAVIS_OS_NAME}" = "windows" ]; then python setup.py bdist_wheel --dist-dir=dist/${IDX}; fi
python3 setup.py bdist_wheel --dist-dir=dist/${IDX} || python setup.py bdist_wheel --dist-dir=dist/${IDX}
- codecov
deploy:
provider: s3
......
......@@ -17,5 +17,6 @@ fi
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then
wget "https://developer.nvidia.com/compute/cuda/${CUDA_SHORT}/Prod2/local_installers2/cuda_${CUDA}_win10"
ls
# ./cuda_${CUDA}_win10.exe
fi
# flake8: noqa
import importlib
import os.path as osp
import torch
expected_torch_version = '1.4'
try:
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
'_version', [osp.dirname(__file__)]).origin)
except OSError as e:
major, minor = [int(x) for x in torch.__version__.split('.')[:2]]
if 'undefined symbol' in str(e) and major != 1 and minor != 4:
raise RuntimeError('Expected PyTorch version {} but found version '
'{}.{}.'.format(torch_version, major, minor))
raise OSError(e)
cuda_version = torch.ops.torch_scatter.cuda_version()
from .scatter import (scatter_sum, scatter_add, scatter_mean, scatter_min,
scatter_max, scatter)
from .segment_csr import (segment_sum_csr, segment_add_csr, segment_mean_csr,
......@@ -14,10 +30,6 @@ from .segment_coo import (segment_sum_coo, segment_add_coo, segment_mean_coo,
from .composite import (scatter_std, scatter_logsumexp, scatter_softmax,
scatter_log_softmax)
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
'_version', [osp.dirname(__file__)]).origin)
cuda_version = torch.ops.torch_scatter.cuda_version()
if cuda_version != -1 and torch.version.cuda is not None: # pragma: no cover
if cuda_version < 10000:
major, minor = int(str(cuda_version)[0]), int(str(cuda_version)[2])
......
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