cpu wheel builds for linux and mac

Reviewed By: nikhilaravi

Differential Revision: D20073426

fbshipit-source-id: fce83c9b63d630de1e6ebe2ff4790f29d11b65cc
This commit is contained in:
Jeremy Reizenstein 2020-02-24 13:36:02 -08:00 committed by Facebook Github Bot
parent 40be4cf78b
commit 4233c32887
5 changed files with 103 additions and 3 deletions

View File

@ -182,6 +182,24 @@ jobs:
docker run --gpus all --ipc=host -v $(pwd):/remote -w /remote ${VARS_TO_PASS} ${DOCKER_IMAGE} ./packaging/build_conda.sh docker run --gpus all --ipc=host -v $(pwd):/remote -w /remote ${VARS_TO_PASS} ${DOCKER_IMAGE} ./packaging/build_conda.sh
binary_macos_wheel:
<<: *binary_common
macos:
xcode: "9.0"
steps:
- checkout
- run:
# Cannot easily deduplicate this as source'ing activate
# will set environment variables which we need to propagate
# to build_wheel.sh
command: |
curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
sh conda.sh -b
source $HOME/miniconda3/bin/activate
packaging/build_wheel.sh
- store_artifacts:
path: dist
workflows: workflows:
version: 2 version: 2
build_and_test: build_and_test:
@ -193,3 +211,21 @@ workflows:
python_version: "3.7" python_version: "3.7"
pytorch_version: "1.4" pytorch_version: "1.4"
cu_version: "cu100" cu_version: "cu100"
- binary_macos_wheel:
build_version: 0.1.0
cu_version: cpu
name: binary_linux_wheel_py3.6_cpu
python_version: '3.6'
pytorch_version: '1.4'
- binary_macos_wheel:
build_version: 0.1.0
cu_version: cpu
name: binary_linux_wheel_py3.7_cpu
python_version: '3.7'
pytorch_version: '1.4'
- binary_macos_wheel:
build_version: 0.1.0
cu_version: cpu
name: binary_linux_wheel_py3.8_cpu
python_version: '3.8'
pytorch_version: '1.4'

View File

@ -182,6 +182,24 @@ jobs:
docker run --gpus all --ipc=host -v $(pwd):/remote -w /remote ${VARS_TO_PASS} ${DOCKER_IMAGE} ./packaging/build_conda.sh docker run --gpus all --ipc=host -v $(pwd):/remote -w /remote ${VARS_TO_PASS} ${DOCKER_IMAGE} ./packaging/build_conda.sh
binary_macos_wheel:
<<: *binary_common
macos:
xcode: "9.0"
steps:
- checkout
- run:
# Cannot easily deduplicate this as source'ing activate
# will set environment variables which we need to propagate
# to build_wheel.sh
command: |
curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
sh conda.sh -b
source $HOME/miniconda3/bin/activate
packaging/build_wheel.sh
- store_artifacts:
path: dist
workflows: workflows:
version: 2 version: 2
build_and_test: build_and_test:
@ -247,8 +265,44 @@ workflows:
name: binary_linux_conda_py3.8_cu101 name: binary_linux_conda_py3.8_cu101
python_version: '3.8' python_version: '3.8'
pytorch_version: '1.4' pytorch_version: '1.4'
- binary_linux_wheel:
build_version: 0.1.0
cu_version: cpu
name: binary_linux_wheel_py3.6_cpu
python_version: '3.6'
pytorch_version: '1.4'
- binary_linux_wheel:
build_version: 0.1.0
cu_version: cpu
name: binary_linux_wheel_py3.7_cpu
python_version: '3.7'
pytorch_version: '1.4'
- binary_linux_wheel:
build_version: 0.1.0
cu_version: cpu
name: binary_linux_wheel_py3.8_cpu
python_version: '3.8'
pytorch_version: '1.4'
- binary_linux_conda_cuda: - binary_linux_conda_cuda:
name: testrun_conda_cuda_py3.7_cu100 name: testrun_conda_cuda_py3.7_cu100
python_version: "3.7" python_version: "3.7"
pytorch_version: "1.4" pytorch_version: "1.4"
cu_version: "cu100" cu_version: "cu100"
- binary_macos_wheel:
build_version: 0.1.0
cu_version: cpu
name: binary_linux_wheel_py3.6_cpu
python_version: '3.6'
pytorch_version: '1.4'
- binary_macos_wheel:
build_version: 0.1.0
cu_version: cpu
name: binary_linux_wheel_py3.7_cpu
python_version: '3.7'
pytorch_version: '1.4'
- binary_macos_wheel:
build_version: 0.1.0
cu_version: cpu
name: binary_linux_wheel_py3.8_cpu
python_version: '3.8'
pytorch_version: '1.4'

View File

@ -14,7 +14,6 @@ import yaml
def workflows(prefix="", filter_branch=None, upload=False, indentation=6): def workflows(prefix="", filter_branch=None, upload=False, indentation=6):
w = [] w = []
# add "wheel" here for pypi
for btype in ["conda"]: for btype in ["conda"]:
for python_version in ["3.6", "3.7", "3.8"]: for python_version in ["3.6", "3.7", "3.8"]:
for cu_version in ["cu92", "cu100", "cu101"]: for cu_version in ["cu92", "cu100", "cu101"]:
@ -26,6 +25,17 @@ def workflows(prefix="", filter_branch=None, upload=False, indentation=6):
upload=upload, upload=upload,
filter_branch=filter_branch, filter_branch=filter_branch,
) )
for btype in ["wheel"]:
for python_version in ["3.6", "3.7", "3.8"]:
for cu_version in ["cpu"]:
w += workflow_pair(
btype=btype,
python_version=python_version,
cu_version=cu_version,
prefix=prefix,
upload=upload,
filter_branch=filter_branch,
)
return indent(indentation, w) return indent(indentation, w)

View File

@ -113,7 +113,7 @@ setup_build_version() {
# Set some useful variables for OS X, if applicable # Set some useful variables for OS X, if applicable
setup_macos() { setup_macos() {
if [[ "$(uname)" == Darwin ]]; then if [[ "$(uname)" == Darwin ]]; then
export MACOSX_DEPLOYMENT_TARGET=10.14 CC=clang CXX=clang++ export MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++
fi fi
} }

View File

@ -20,7 +20,7 @@ def get_extensions():
extension = CppExtension extension = CppExtension
extra_compile_args = {"cxx": ["-std=c++17"]} extra_compile_args = {"cxx": ["-std=c++14"]}
define_macros = [] define_macros = []
force_cuda = os.getenv("FORCE_CUDA", "0") == "1" force_cuda = os.getenv("FORCE_CUDA", "0") == "1"