Commit 20fe8b6e authored by rusty1s's avatar rusty1s
Browse files

install via wheel

parent ac257581
...@@ -111,12 +111,12 @@ install: ...@@ -111,12 +111,12 @@ install:
- conda install pytorch=${TORCH_VERSION} ${TOOLKIT} -c pytorch --yes - conda install pytorch=${TORCH_VERSION} ${TOOLKIT} -c pytorch --yes
- source script/torch.sh - source script/torch.sh
- pip install flake8 codecov - pip install flake8 codecov
- python setup.py install - python setup.py bdist_wheel --dist-dir=dist
- pip install dist/*.whl
script: script:
- flake8 . - flake8 .
- python setup.py test - pytest
after_success: after_success:
- python setup.py bdist_wheel --dist-dir=dist/torch-${TORCH_VERSION}+${IDX}
- codecov - codecov
deploy: deploy:
provider: s3 provider: s3
...@@ -125,7 +125,7 @@ deploy: ...@@ -125,7 +125,7 @@ deploy:
access_key_id: ${S3_ACCESS_KEY} access_key_id: ${S3_ACCESS_KEY}
secret_access_key: ${S3_SECRET_ACCESS_KEY} secret_access_key: ${S3_SECRET_ACCESS_KEY}
bucket: pytorch-geometric.com bucket: pytorch-geometric.com
local_dir: dist/torch-${TORCH_VERSION}+${IDX} local_dir: dist
upload_dir: whl/torch-${TORCH_VERSION}+${IDX} upload_dir: whl/torch-${TORCH_VERSION}+${IDX}
acl: public_read acl: public_read
on: on:
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
PyMODINIT_FUNC PyInit__basis(void) { return NULL; } #ifdef WITH_CUDA
PyMODINIT_FUNC PyInit__basis_cuda(void) { return NULL; }
#else
PyMODINIT_FUNC PyInit__basis_cpu(void) { return NULL; }
#endif
#endif #endif
std::tuple<torch::Tensor, torch::Tensor> std::tuple<torch::Tensor, torch::Tensor>
......
...@@ -6,7 +6,11 @@ ...@@ -6,7 +6,11 @@
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
PyMODINIT_FUNC PyInit__version(void) { return NULL; } #ifdef WITH_CUDA
PyMODINIT_FUNC PyInit__version_cuda(void) { return NULL; }
#else
PyMODINIT_FUNC PyInit__version_cpu(void) { return NULL; }
#endif
#endif #endif
int64_t cuda_version() { int64_t cuda_version() {
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
PyMODINIT_FUNC PyInit__weighting(void) { return NULL; } #ifdef WITH_CUDA
PyMODINIT_FUNC PyInit__weighting_cuda(void) { return NULL; }
#else
PyMODINIT_FUNC PyInit__weighting_cpu(void) { return NULL; }
#endif
#endif #endif
torch::Tensor spline_weighting_fw(torch::Tensor x, torch::Tensor weight, torch::Tensor spline_weighting_fw(torch::Tensor x, torch::Tensor weight,
......
import sys
import os
import os.path as osp
import glob
import shutil
idx = sys.argv[1]
assert idx in ['cpu', 'cu92', 'cu101', 'cu102', 'cu110']
dist_dir = osp.join(osp.dirname(osp.abspath(__file__)), '..', 'dist')
wheels = glob.glob(osp.join('dist', '**', '*.whl'), recursive=True)
for wheel in wheels:
if idx in wheel:
continue
paths = wheel.split(osp.sep)
names = paths[-1].split('-')
name = '-'.join(names[:-4] + ['latest+' + idx] + names[-3:])
shutil.copyfile(wheel, osp.join(*paths[:-1], name))
name = '-'.join(names[:-4] + [names[-4] + '+' + idx] + names[-3:])
os.rename(wheel, osp.join(*paths[:-1], name))
...@@ -11,7 +11,7 @@ for library in ['_version', '_basis', '_weighting']: ...@@ -11,7 +11,7 @@ for library in ['_version', '_basis', '_weighting']:
torch.ops.load_library(importlib.machinery.PathFinder().find_spec( torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
f'{library}_{suffix}', [osp.dirname(__file__)]).origin) f'{library}_{suffix}', [osp.dirname(__file__)]).origin)
if torch.cuda.is_available() and torch.version.cuda is not None: if torch.cuda.is_available(): # pragma: no cover
cuda_version = torch.ops.torch_spline_conv.cuda_version() cuda_version = torch.ops.torch_spline_conv.cuda_version()
if cuda_version == -1: if cuda_version == -1:
......
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