Skip to content

Commit 5ac67ee

Browse files
Merge pull request #76 from CCInc/master
Add support for Anaconda installation
2 parents eff7511 + cb4714e commit 5ac67ee

File tree

7 files changed

+137
-1
lines changed

7 files changed

+137
-1
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Building Conda
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
7+
conda-build:
8+
runs-on: ${{ matrix.os }}
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: [ubuntu-16.04, macos-10.15, windows-latest]
14+
python-version: [3.6, 3.7, 3.8, 3.9]
15+
torch-version: [1.8.0, 1.9.0]
16+
cuda-version: ['cpu', 'cu101', 'cu102', 'cu111']
17+
exclude:
18+
- torch-version: 1.9.0
19+
cuda-version: 'cu101'
20+
- os: macos-10.15
21+
cuda-version: 'cu101'
22+
- os: macos-10.15
23+
cuda-version: 'cu102'
24+
- os: macos-10.15
25+
cuda-version: 'cu111'
26+
- os: windows-latest
27+
cuda-version: 'cu101'
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Set up Conda for Python ${{ matrix.python-version }}
32+
uses: conda-incubator/setup-miniconda@v2
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
36+
- name: Install Conda packages
37+
run: |
38+
conda install conda-build conda-verify --yes
39+
shell:
40+
bash -l {0}
41+
42+
- name: Build Conda package
43+
run: |
44+
./conda/torch-points-kernels/build_conda.sh ${{ matrix.python-version }} ${{ matrix.torch-version }} ${{ matrix.cuda-version }}
45+
shell:
46+
bash -l {0}
47+
48+
- name: Publish Conda package
49+
run: |
50+
conda install anaconda-client --yes
51+
anaconda upload --force --user torch-points3d --label main $HOME/conda-bld/*/*.tar.bz2
52+
env:
53+
ANACONDA_API_TOKEN: ${{ secrets.CONDA_TOKEN }}
54+
shell:
55+
bash -l {0}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.7.1
2+
## Additions
3+
- Add support for anaconda installation
4+
15
# 0.7.0
26
## Change
37
- Added some extra compilation flags: FORCE_CUDA=1 for CUDA install and FORCE_ONLY_CPU=1 for CPU only install.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```
2+
./build_conda.sh 3.9 1.9.0 cu111 # python, pytorch and cuda version
3+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
export PYTHON_VERSION=$1
4+
export TORCH_VERSION=$2
5+
export CUDA_VERSION=$3
6+
7+
export CONDA_PYTORCH_CONSTRAINT="pytorch==${TORCH_VERSION%.*}.*"
8+
9+
if [ "${CUDA_VERSION}" = "cpu" ]; then
10+
export CONDA_CUDATOOLKIT_CONSTRAINT="cpuonly # [not osx]"
11+
else
12+
case $CUDA_VERSION in
13+
cu111)
14+
export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.1.*"
15+
;;
16+
cu102)
17+
export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==10.2.*"
18+
;;
19+
cu101)
20+
export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==10.1.*"
21+
;;
22+
*)
23+
echo "Unrecognized CUDA_VERSION=$CUDA_VERSION"
24+
exit 1
25+
;;
26+
esac
27+
fi
28+
29+
echo "PyTorch $TORCH_VERSION+$CUDA_VERSION"
30+
echo "- $CONDA_PYTORCH_CONSTRAINT"
31+
echo "- $CONDA_CUDATOOLKIT_CONSTRAINT"
32+
33+
conda build . -c defaults -c pytorch -c conda-forge -c rusty1s --output-folder "$HOME/conda-bld"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
channel_sources:
2+
- conda-forge,defaults
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package:
2+
name: torch-points-kernels
3+
version: 0.7.1
4+
5+
source:
6+
path: ../..
7+
8+
requirements:
9+
build:
10+
- {{ compiler('c') }} # [win]
11+
12+
host:
13+
- pip
14+
- python {{ environ.get('PYTHON_VERSION') }}
15+
- {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }}
16+
- {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT') }}
17+
18+
run:
19+
- python {{ environ.get('PYTHON_VERSION') }}
20+
- {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }}
21+
- {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT') }}
22+
- numpy
23+
- numba
24+
- scikit-learn
25+
26+
build:
27+
string: py{{ environ.get('PYTHON_VERSION').replace('.', '') }}_torch_{{ environ['TORCH_VERSION'] }}_{{ environ['CUDA_VERSION'] }}
28+
script: pip install .
29+
script_env:
30+
- FORCE_CUDA
31+
32+
test:
33+
imports:
34+
- torch_points_kernels
35+
36+
about:
37+
home: https://github.com/nicolas-chaulet/torch-points-kernels
38+
license: MIT
39+
summary: Pytorch CPU and CUDA kernels for spatial search and interpolation for 3D point clouds.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def get_cmdclass():
8080
requirements = ["torch>=1.1.0", "numba", "numpy<1.20", "scikit-learn"]
8181

8282
url = "https://github.com/nicolas-chaulet/torch-points-kernels"
83-
__version__ = "0.7.0"
83+
__version__ = "0.7.1"
8484
setup(
8585
name="torch-points-kernels",
8686
version=__version__,

0 commit comments

Comments
 (0)