Skip to content

rocRAND integration #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 149 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
7c1e8c3
remove some unnecessary cudaGetDevices (#8089)
Jun 5, 2018
bf58bb5
Fix cuda.framework error on OSX. (#8136)
ezyang Jun 5, 2018
990c6c5
[C++ API] Improve and use OrderedDict for parameters / modules (#7823)
goldsborough Jun 5, 2018
1cdd7b5
Fix __rshift__ bug (#8161)
vishwakftw Jun 5, 2018
a3fc5ed
Move non-generic Storage code needed by TensorUtils to non-generic C+…
gchanan Jun 5, 2018
fa1bdcf
Pinning opencv to < 3.4 in conda builds (#7923)
pjh5 Jun 5, 2018
2774d83
PyTorch AMD Build Script.
Jorghi12 Apr 16, 2018
6accd1a
Python invocation for hipify
Jorghi12 Apr 16, 2018
89613c2
Adding individual hip fles.
Jorghi12 Apr 16, 2018
24c50a8
Updating CWD
Jorghi12 Apr 16, 2018
7dfb589
Updating folder path for amd_build
Jorghi12 Apr 19, 2018
7843a7c
Removing previous amd_build directory
Jorghi12 Apr 19, 2018
bb5d5ea
Updated setup.py to support WITH_ROCM
Jorghi12 Apr 19, 2018
ec577b5
Renaming the files for CuDNN BatchNorm & Conv since having two .cpp f…
Jorghi12 Apr 19, 2018
518418b
Removing old BatchNorm & Conv files since they've been renamed.
Jorghi12 Apr 19, 2018
b86db2d
Cleaned up the build path and created a FindHIP cmake file for settin…
Jorghi12 Apr 19, 2018
87edc4f
Seperated the individual patch files to make it easier to detect issu…
Jorghi12 Apr 19, 2018
54e3129
Removed CMakeLists hip files and fixed directory structure
Jorghi12 Apr 19, 2018
d5c7abb
Adding build pytorch amd script
Jorghi12 Apr 19, 2018
62a289f
Merged setup patch into PyTorch setup.py & cleaned a few issues
Jorghi12 Apr 19, 2018
1ed43f7
Removing many unnecessary patch files. Removing unnecessary .hip file…
Jorghi12 Apr 24, 2018
a67b748
Refactored the PR for supporting HIP
Jorghi12 Apr 27, 2018
d70dd6e
Minimizing the number of changes inside individual patches.
Jorghi12 May 3, 2018
f6c9fdb
Cleaned up patch files.
Jorghi12 May 4, 2018
f7572d2
Removed patch files.
Jorghi12 May 4, 2018
bf54087
Updating patches
Jorghi12 May 4, 2018
c971d55
Cleaned up patches
Jorghi12 May 4, 2018
57b1377
Added AVX/SSE avoidance due to bug with ROCms stack. Just temporary f…
Jorghi12 May 4, 2018
069cd27
Removing the other HIP file
Jorghi12 May 4, 2018
bd00d50
Removed patch file + merged ROCm into Aten/test
Jorghi12 May 5, 2018
3cda23d
Removed ATen tests patch file and updated disbale_features yaml to re…
Jorghi12 May 7, 2018
a089bd7
Reduced the number of patches down to 14 after Edward's suggestions.
Jorghi12 May 7, 2018
386b5af
Transferred deletion of certain functions from patch to yaml file.
Jorghi12 May 7, 2018
f2326c6
Set default Thrust path
wsttiger May 7, 2018
cd98cfc
Fixed aten files so we now use the templated pow/abs instead of std::…
Jorghi12 May 8, 2018
6561aa5
Removed error from aten/src/THCUNN/Abs.cu
Jorghi12 May 8, 2018
eb44a7b
Updated the locations of the cmake build files. Moved THCTensorRandom…
Jorghi12 May 9, 2018
4929b66
Removed hip extraction from the build script and removed the old hip …
Jorghi12 May 9, 2018
5548f1a
Removed the hip include from the ATen header.
Jorghi12 May 9, 2018
513510a
Can't throw exceptions on C++ AMP, using abort
Jorghi12 May 9, 2018
b5b29ea
Removed a series of patch files.
Jorghi12 May 9, 2018
9ce8109
Rebased the specific files displayed in the PR
Jorghi12 May 10, 2018
95a97d3
Updating build files after rebasing.
Jorghi12 May 11, 2018
cac72a9
Reorganization after cpu/gpu separation.
Jorghi12 May 11, 2018
cdb66e0
MIOpen Integration - Updated the PyTorch Builds Path + Added Tensor D…
Jorghi12 May 17, 2018
df4a898
Adding compiledWithMIOpen to the struct and adding a virtual function.
Jorghi12 May 18, 2018
a8d8dd3
Cleaned the syntax in the patch file.
Jorghi12 May 18, 2018
d62c071
Adding another generated kernel so HIP can find.
Jorghi12 May 22, 2018
cff79db
Cleaned up patches
Jorghi12 May 23, 2018
7d6fa62
Cleaning up CMakeLists.txt files.
Jorghi12 May 23, 2018
962ec71
Updates
Jorghi12 May 25, 2018
3a668f0
Updated the disable features yaml file
Jorghi12 May 25, 2018
d579c09
Update rocm.py
Jorghi12 May 25, 2018
b6108e8
Added import for check_env_flag
Jorghi12 May 26, 2018
a2910d4
Successfully running MIOpen
Jorghi12 May 26, 2018
b8c2f1b
Updated the miopen functions to match cudnn's naming in native_functi…
Jorghi12 May 26, 2018
f5a5459
Updates
Jorghi12 May 29, 2018
fba8233
Canceling out unnecessary changes
Jorghi12 May 29, 2018
3378cab
Submitting new versions of the files.
Jorghi12 May 31, 2018
b0f29c4
Rebased the CMakeLists.txt files.
Jorghi12 May 31, 2018
b1f334b
MIOpen Patches
Jorghi12 Jun 1, 2018
7fb5c14
ROCm changes
Jorghi12 Jun 5, 2018
295d119
PyTorch/Caffe2 merging
Jorghi12 Jun 5, 2018
ba46d3d
Adding -setup- path, and better code structure (#8122)
pjh5 Jun 5, 2018
0517623
Abstract parallelization to faciliate using threadpools (#8163)
cpuhrsch Jun 5, 2018
9243b64
[Caffe2] Update elementwise ops to support numpy style boradcast (#8070)
xiaomengy Jun 5, 2018
ccabdfe
Export getCudnnHandle (#7726)
bstriner Jun 6, 2018
e53fec0
[JIT] Support a single TensorList argument anywhere in the argument l…
Jun 6, 2018
ffde23d
use the correct datatype format (#8144)
seravee Jun 6, 2018
d7ba404
Add back onnx console scripts dropped during migration from onnx-caff…
bddppq Jun 6, 2018
c21465e
Get rid of SOVERSION (again). (#8132)
ezyang Jun 6, 2018
b2dac08
Fix a corner case for ReShapeOp (#8178)
sunnieshang Jun 6, 2018
c1bd3b3
Better conv error message basing on weight shape (#8051)
ssnl Jun 6, 2018
e8d6ac5
Add retry logic to sccache download for Windows build (#7697)
yf225 Jun 6, 2018
bae82f7
fix caffe2 docker build (#7411)
qigtang Jun 6, 2018
3b8f4d1
[ONNX] Fix type_as symbolic (#8183)
Jun 6, 2018
c496a4a
Yangqing as an ONNX codeowner (#8185)
Jun 6, 2018
005ebec
Added PyTorch HIP build path into Caffe2 CMakeLists
Jorghi12 Jun 6, 2018
a6305ea
Fix protobuf options (#8184)
bstriner Jun 6, 2018
0272f96
Build with MIOpen when using ROCm
Jorghi12 Jun 6, 2018
f45a3d5
Add a loop unrolling pass to PyTorch JIT (#7672)
apaszke Jun 6, 2018
857020b
[auto] Update onnx to 4e65fd8 - fuse consecutive squeezes (onnx/onnx#…
onnxbot Jun 6, 2018
8e6f7a1
[Caffe2] Merging setup.py with setup_caffe2.py (#8129)
pjh5 Jun 6, 2018
115a494
Fix scalar check for sparse tensors. (#8197)
zou3519 Jun 6, 2018
5e372c7
fix lint
soumith Jun 6, 2018
c0b2a2a
Add more annotations for arguments in ATen schema (#8192)
apaszke Jun 6, 2018
e6044e5
use THCThrustAllocator in BCECriterion (#8188)
Jun 6, 2018
35f08b9
Allow parallel_apply to take in list[Tensor] (#8047)
ssnl Jun 6, 2018
9af3a80
Docs for gradcheck and gradgradcheck; expose gradgradcheck (#8166)
ssnl Jun 6, 2018
edfcbfb
Implement randperm for CUDA (#7606)
yf225 Jun 6, 2018
eaea0f4
Update c10d build to link against Caffe2 (#8201)
pietern Jun 6, 2018
4d025a6
add wipe_cache option (#8204)
lly-zero-one Jun 6, 2018
f7905aa
Merge remote-tracking branch 'scott_upstream/sending_pr' into sending_pr
iotamudelta Jun 6, 2018
61fd99e
Replace (non-data) TensorUtils calls with non-generic THCTensor calls…
gchanan Jun 6, 2018
5935c5f
Fix c10d compiler warnings (#8206)
pietern Jun 6, 2018
005eef5
Bump gloo submodule (#8202)
pietern Jun 6, 2018
7ee517a
rm -rf aten/contrib (#8165)
goldsborough Jun 6, 2018
1f23043
Fix tanh_op on ios build (#8207)
xiaomengy Jun 6, 2018
f2f76e2
[auto] Update onnx to f28e2f1 - fix lrn spec (onnx/onnx#1090)
onnxbot Jun 6, 2018
56b1dcc
[cmake] deprecate caffe2_* specific cuda function in cmake. (#8200)
Yangqing Jun 6, 2018
36b8cc5
skip CUDA memory leak check on Windows altogether (#8213)
ssnl Jun 6, 2018
12229af
Record shape and type in autograd to validate gradients (#8168)
colesbury Jun 6, 2018
f3869b4
[auto] Update onnx to 18d70ff - Graph should only have one (input) kP…
onnxbot Jun 6, 2018
b03ba90
Set up a c10 source folder (#7822)
smessmer Jun 6, 2018
7cace72
Change the benchmark log format and also log flops (#8215)
lly-zero-one Jun 7, 2018
02734e3
Move helper functions to unnamed namespace. (#8224)
yyetim Jun 7, 2018
07df98a
[auto] Update onnx to e96d823 - Update Google benchmark to 1.4.1 (onn…
onnxbot Jun 7, 2018
deb56df
Change new bernoulli implementation to be fully generic. (#8218)
gchanan Jun 7, 2018
5ec3041
Structure THTensor like THCTensor is structured. (#8217)
gchanan Jun 7, 2018
1172b15
move THCP-related utils to cuda/utils.cpp. (#8221)
gchanan Jun 7, 2018
784c46b
[READY TO MERGE] Use ccache in macOS build (#8009)
yf225 Jun 7, 2018
89ea6ac
[NEEDS REVIEW] Add nan and inf probability check to multinomial (#7647)
yf225 Jun 7, 2018
c84b97b
[READY TO MERGE] Enable tests that use DataLoader with multiple worke…
yf225 Jun 7, 2018
d0ca889
Don't copy unneeded grads when using a function for several derivativ…
t-vi Jun 7, 2018
2f18f86
Fix win mkldnn (#7718)
bstriner Jun 7, 2018
8af88f3
[Caffe2] Add ADD operator for IDEEP (#8220)
Jun 7, 2018
b401e6b
Allow optional build and installation of native test binaries (#8225)
Yangqing Jun 7, 2018
4df86b6
Update MKL exporter to IDEEP ops (#8228)
viswanathgs Jun 7, 2018
832c88a
[ideep] Add IDEEP Squeeze op (#8227)
viswanathgs Jun 7, 2018
c22c55e
[auto] Update onnx to 62e63e9 - Fix build errors inside protobuf-benc…
onnxbot Jun 7, 2018
346568d
Use .cc since some downstream libraries are configured for C++ only. …
xkszltl Jun 7, 2018
7ed361a
Rename SparseTensor to SparseTensorRef. (#8237)
ezyang Jun 7, 2018
f94112e
Building PyTorch/Caffe2
Jorghi12 Jun 7, 2018
ea5d871
[caffe2] Build Android tests and binaries in CI (#7593)
Maratyszcza Jun 7, 2018
d1bdb3b
Remove core and util warnings (#8239)
orionr Jun 7, 2018
3eb9ba4
Remove .gitmodules.aten since it is in .gitmodules now (#8232)
Yangqing Jun 7, 2018
d2271dc
Fix: gradcheck forced float32 (#8230)
bhushan23 Jun 7, 2018
9a56ab8
Now installs caffe2_hip when using ROCm
Jorghi12 Jun 7, 2018
4a722aa
Changes required to build PyTorch/Caffe2 on ROCm.
Jorghi12 Jun 7, 2018
a001e57
Nitpick fixes
Jorghi12 Jun 7, 2018
14f5484
Print requires_grad and grad_fn in string repr of tensor (#8211)
colesbury Jun 7, 2018
3e15464
Updated the Caffe2_HIP_SRCS to more strictly only contain the ATen CU…
Jorghi12 Jun 7, 2018
f2c8653
Fix TEST_CUDA import in test_cuda (#8246)
yf225 Jun 7, 2018
a466c12
Fix lifting cat into its constant version (#8174)
zdevito Jun 7, 2018
93a9bb9
Don't override Tensor, Storage macros defined outside torch/csrc in t…
gchanan Jun 7, 2018
95ae09c
[auto] Update onnx to 3a035f4 - Add retry logic to model downloading …
onnxbot Jun 7, 2018
3c2994f
HIP includes the atomicAdd command now
Jorghi12 Jun 7, 2018
b4c6310
Fully genericize THC/THCUNN (except for TensorUtils and DeviceTensorU…
gchanan Jun 7, 2018
78b8821
[cmake] Use CAFFE2_USE_* for public/cuda.cmake (#8248)
pietern Jun 7, 2018
51d9fa4
Merge branch 'master' into sending_pr
Jorghi12 Jun 7, 2018
fee6a06
Update setup.py
Jorghi12 Jun 7, 2018
aeff6bd
Update setup.py
Jorghi12 Jun 7, 2018
13f6aaf
Update setup.py
Jorghi12 Jun 7, 2018
1a6df34
Merge remote-tracking branch 'scott_upstream/sending_pr' into sending_pr
iotamudelta Jun 7, 2018
a59acd6
Update Dependencies.cmake
Jorghi12 Jun 7, 2018
e22e4ad
Adapting to the revert in HIP.
Jorghi12 Jun 11, 2018
1e831fb
Merge branch 'sending_pr' of github.com:wsttiger/pytorch into sending_pr
Jorghi12 Jun 11, 2018
a81bca9
Merge remote-tracking branch 'scott_upstream/sending_pr' into sending_pr
iotamudelta Jun 11, 2018
b984c78
Remove legacy hcRNG (hiprng API) from the make system in favor of the…
iotamudelta Jun 11, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 0 additions & 10 deletions .gitmodules.aten

This file was deleted.

151 changes: 89 additions & 62 deletions .jenkins/caffe2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

set -ex

# The INSTALL_PREFIX here must match up with test.sh
INSTALL_PREFIX="/usr/local/caffe2"
LOCAL_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
ROOT_DIR=$(cd "$LOCAL_DIR"/../.. && pwd)
CMAKE_ARGS=()


# Setup SCCACHE
###############################################################################
# Setup sccache if SCCACHE_BUCKET is set
if [ -n "${SCCACHE_BUCKET}" ]; then
mkdir -p ./sccache
Expand Down Expand Up @@ -61,24 +67,29 @@ report_compile_cache_stats() {
fi
}

CMAKE_ARGS=("-DBUILD_BINARY=ON")
CMAKE_ARGS+=("-DUSE_OBSERVERS=ON")
CMAKE_ARGS+=("-DUSE_ZSTD=ON")

if [[ $BUILD_ENVIRONMENT == *-aten-* ]]; then
if [[ CMAKE_ARGS != *USE_ATEN* ]] && [[ CMAKE_ARGS != *BUILD_ATEN* ]]; then
CMAKE_ARGS+=("-DBUILD_ATEN=ON")
fi
###############################################################################
# Explicitly set Python executable.
###############################################################################
# On Ubuntu 16.04 the default Python is still 2.7.
PYTHON="$(which python)"
if [[ "${BUILD_ENVIRONMENT}" =~ py((2|3)\.?[0-9]?\.?[0-9]?) ]]; then
PYTHON=$(which "python${BASH_REMATCH[1]}")
CMAKE_ARGS+=("-DPYTHON_EXECUTABLE=${PYTHON}")
fi

# Run build script from scripts if applicable

###############################################################################
# Use special scripts for Android, conda, and setup builds
###############################################################################
if [[ "${BUILD_ENVIRONMENT}" == *-android* ]]; then
export ANDROID_NDK=/opt/ndk
CMAKE_ARGS+=("-DBUILD_BINARY=ON")
CMAKE_ARGS+=("-DBUILD_TEST=ON")
CMAKE_ARGS+=("-DUSE_OBSERVERS=ON")
CMAKE_ARGS+=("-DUSE_ZSTD=ON")
"${ROOT_DIR}/scripts/build_android.sh" ${CMAKE_ARGS[*]} "$@"
exit 0
fi
if [[ "${BUILD_ENVIRONMENT}" == conda* ]]; then

elif [[ "${BUILD_ENVIRONMENT}" == conda* ]]; then
# click (required by onnx) wants these set
# TODO don't think this fixes the problem for conda3 yet
export LANG=C.UTF-8
Expand All @@ -96,51 +107,52 @@ if [[ "${BUILD_ENVIRONMENT}" == conda* ]]; then
PROTOBUF_INCDIR=/opt/conda/include pip install -b /tmp/pip_install_onnx "file://${ROOT_DIR}/third_party/onnx#egg=onnx"
report_compile_cache_stats
exit 0
elif [[ $BUILD_ENVIRONMENT == *setup* ]]; then
rm -rf $INSTALL_PREFIX && mkdir $INSTALL_PREFIX
PYTHONPATH=$INSTALL_PREFIX $PYTHON setup_caffe2.py develop --install-dir $INSTALL_PREFIX
exit 0
fi

# Run cmake from ./build_caffe2 directory so it doesn't conflict with
# standard PyTorch build directory. Eventually these won't need to
# be separate.
rm -rf build_caffe2
mkdir build_caffe2
cd ./build_caffe2

INSTALL_PREFIX="/usr/local/caffe2"
###############################################################################
# Set cmake args
###############################################################################
CMAKE_ARGS+=("-DBUILD_BINARY=ON")
CMAKE_ARGS+=("-DBUILD_TEST=ON")
CMAKE_ARGS+=("-DINSTALL_TEST=ON")
CMAKE_ARGS+=("-DUSE_OBSERVERS=ON")
CMAKE_ARGS+=("-DUSE_ZSTD=ON")
CMAKE_ARGS+=("-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}")

# Explicitly set Python executable.
# On Ubuntu 16.04 the default Python is still 2.7.
PYTHON="$(which python)"
if [[ "${BUILD_ENVIRONMENT}" =~ py((2|3)\.?[0-9]?\.?[0-9]?) ]]; then
PYTHON=$(which "python${BASH_REMATCH[1]}")
CMAKE_ARGS+=("-DPYTHON_EXECUTABLE=${PYTHON}")
if [[ $BUILD_ENVIRONMENT == *-aten-* ]]; then
if [[ CMAKE_ARGS != *USE_ATEN* ]] && [[ CMAKE_ARGS != *BUILD_ATEN* ]]; then
CMAKE_ARGS+=("-DBUILD_ATEN=ON")
fi
fi
if [[ $BUILD_ENVIRONMENT == *mkl* ]]; then
CMAKE_ARGS+=("-DBLAS=MKL")
fi
if [[ $BUILD_ENVIRONMENT == *cuda* ]]; then
CMAKE_ARGS+=("-DUSE_CUDA=ON")
CMAKE_ARGS+=("-DCUDA_ARCH_NAME=Maxwell")
CMAKE_ARGS+=("-DUSE_NNPACK=OFF")

case "${BUILD_ENVIRONMENT}" in
*-mkl*)
CMAKE_ARGS+=("-DBLAS=MKL")
;;
*-cuda*)
CMAKE_ARGS+=("-DUSE_CUDA=ON")
CMAKE_ARGS+=("-DCUDA_ARCH_NAME=Maxwell")
CMAKE_ARGS+=("-DUSE_NNPACK=OFF")

# Explicitly set path to NVCC such that the symlink to ccache or sccache is used
CMAKE_ARGS+=("-DCUDA_NVCC_EXECUTABLE=${CACHE_WRAPPER_DIR}/nvcc")

# Ensure FindCUDA.cmake can infer the right path to the CUDA toolkit.
# Setting PATH to resolve to the right nvcc alone isn't enough.
# See /usr/share/cmake-3.5/Modules/FindCUDA.cmake, block at line 589.
export CUDA_PATH="/usr/local/cuda"

# Ensure the ccache symlink can still find the real nvcc binary.
export PATH="/usr/local/cuda/bin:$PATH"
;;
*-rocm*)
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
export HCC_AMDGPU_TARGET=gfx900
esac
# Explicitly set path to NVCC such that the symlink to ccache or sccache is used
CMAKE_ARGS+=("-DCUDA_NVCC_EXECUTABLE=${CACHE_WRAPPER_DIR}/nvcc")

# Ensure FindCUDA.cmake can infer the right path to the CUDA toolkit.
# Setting PATH to resolve to the right nvcc alone isn't enough.
# See /usr/share/cmake-3.5/Modules/FindCUDA.cmake, block at line 589.
export CUDA_PATH="/usr/local/cuda"

# Ensure the ccache symlink can still find the real nvcc binary.
export PATH="/usr/local/cuda/bin:$PATH"
fi
if [[ $BUILD_ENVIRONMENT == *rocm* ]]; then
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
export HCC_AMDGPU_TARGET=gfx900
fi

# Try to include Redis support for Linux builds
if [ "$(uname)" == "Linux" ]; then
Expand All @@ -154,14 +166,6 @@ if [ "$(uname)" == "Darwin" ]; then
CMAKE_ARGS+=("-DBUILD_CUSTOM_PROTOBUF=ON")
fi

# We test the presence of cmake3 (for platforms like Centos and Ubuntu 14.04)
# and use that if so.
if [[ -x "$(command -v cmake3)" ]]; then
CMAKE_BINARY=cmake3
else
CMAKE_BINARY=cmake
fi

# Use a speciallized onnx namespace in CI to catch hardcoded onnx namespace
CMAKE_ARGS+=("-DONNX_NAMESPACE=ONNX_NAMESPACE_FOR_C2_CI")

Expand All @@ -173,17 +177,35 @@ if [[ -n "$INTEGRATED" ]]; then
CMAKE_ARGS+=("-DCAFFE2_LINK_LOCAL_PROTOBUF=OFF")
fi

# Configure
${CMAKE_BINARY} "${ROOT_DIR}" ${CMAKE_ARGS[*]} "$@"

# Build
# We test the presence of cmake3 (for platforms like Centos and Ubuntu 14.04)
# and use that if so.
if [[ -x "$(command -v cmake3)" ]]; then
CMAKE_BINARY=cmake3
else
CMAKE_BINARY=cmake
fi
# sccache will fail for CUDA builds if all cores are used for compiling
if [[ "${BUILD_ENVIRONMENT}" == *-cuda* ]] && [ -n "${SCCACHE}" ]; then
MAX_JOBS=`expr $(nproc) - 1`
else
MAX_JOBS=$(nproc)
fi


###############################################################################
# Configure and make
###############################################################################
# Run cmake from ./build_caffe2 directory so it doesn't conflict with
# standard PyTorch build directory. Eventually these won't need to
# be separate.
rm -rf build_caffe2
mkdir build_caffe2
cd ./build_caffe2

# Configure
${CMAKE_BINARY} "${ROOT_DIR}" ${CMAKE_ARGS[*]} "$@"

# Build
if [ "$(uname)" == "Linux" ]; then
make "-j${MAX_JOBS}" install
else
Expand All @@ -193,6 +215,11 @@ fi

report_compile_cache_stats


###############################################################################
# Install ONNX
###############################################################################

# Install ONNX into a local directory
pip install --user -b /tmp/pip_install_onnx "file://${ROOT_DIR}/third_party/onnx#egg=onnx"

Expand Down
6 changes: 5 additions & 1 deletion .jenkins/pytorch/macos-build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ rm -rf ${PYTORCH_ENV_DIR}/miniconda3/lib/python3.6/site-packages/torch*
git submodule update --init --recursive
export CMAKE_PREFIX_PATH=${PYTORCH_ENV_DIR}/miniconda3/

# Build and test PyTorch
# Build PyTorch
export MACOSX_DEPLOYMENT_TARGET=10.9
export CXX=clang++
export CC=clang
if which sccache > /dev/null; then
export CXX="sccache clang++"
export CC="sccache clang"
fi
# If we run too many parallel jobs, we will OOM
export MAX_JOBS=2

Expand Down
2 changes: 1 addition & 1 deletion .jenkins/pytorch/macos-test.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ rm -rf ${PYTORCH_ENV_DIR}/miniconda3/lib/python3.6/site-packages/torch*
git submodule update --init --recursive
export CMAKE_PREFIX_PATH=${PYTORCH_ENV_DIR}/miniconda3/

# Build and test PyTorch
# Test PyTorch
export MACOSX_DEPLOYMENT_TARGET=10.9
export CXX=clang++
export CC=clang
Expand Down
12 changes: 10 additions & 2 deletions .jenkins/pytorch/win-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ set MAGMA_HOME=%cd%\\magma

:: Install sccache
mkdir %CD%\\tmp_bin
if "%REBUILD%"=="" ( aws s3 cp s3://ossci-windows/sccache.exe %CD%\\tmp_bin\\sccache.exe --quiet )
if "%REBUILD%"=="" (
:check_sccache
%CD%\\tmp_bin\\sccache.exe --show-stats || (
taskkill /im sccache.exe /f /t || set ERRORLEVEL=0
del %CD%\\tmp_bin\\sccache.exe
aws s3 cp s3://ossci-windows/sccache.exe %CD%\\tmp_bin\\sccache.exe
goto :check_sccache
)
)

:: Install Miniconda3
if "%REBUILD%"=="" (
Expand Down Expand Up @@ -73,7 +81,7 @@ set CUDNN_ROOT_DIR=C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0
:: Target only our CI GPU machine's CUDA arch to speed up the build
set TORCH_CUDA_ARCH_LIST=5.2

sccache --stop-server || set ERRORLEVEL=0
sccache --stop-server
sccache --start-server
sccache --zero-stats
set CC=sccache cl
Expand Down
23 changes: 21 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ if(NOT DEFINED BLAS_SET_BY_USER)
set(BLAS_SET_BY_USER ${BLAS_SET_BY_USER} CACHE STRING "Marks whether BLAS was manually set by user or auto-detected")
endif()

# These lines are an attempt to make find_package(cuda) pick up
# libcuda.dylib, and not cuda.framework. It doesn't work all
# the time, but it seems to help for some users.
# TODO: replace this with a more robust fix
if(APPLE)
set(CMAKE_FIND_FRAMEWORK LAST)
set(CMAKE_FIND_APPBUNDLE LAST)
endif()

# ---[ Options.
# Note to developers: if you add an option below, make sure you also add it to
# cmake/Summary.cmake so that the summary prints out the option values.
Expand All @@ -48,8 +57,11 @@ cmake_dependent_option(
CAFFE2_USE_MSVC_STATIC_RUNTIME "Using MSVC static runtime libraries" ON
"NOT BUILD_SHARED_LIBS" OFF)
cmake_dependent_option(
BUILD_TEST "Build Caffe2 C++ test binaries (need gtest and gbenchmark)" ON
BUILD_TEST "Build Caffe2 C++ test binaries (need gtest and gbenchmark)" OFF
"BUILD_CAFFE2" OFF)
cmake_dependent_option(
INSTALL_TEST "Install test binaries if BUILD_TEST is on" OFF
"BUILD_TEST" OFF)
option(USE_ACL "Use ARM Compute Library" OFF)
option(USE_ASAN "Use Address Sanitizer" OFF)
option(USE_ATEN "Use ATen" OFF)
Expand Down Expand Up @@ -210,12 +222,16 @@ if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-type-limits")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -faligned-new")
endif()
if ($ENV{WERROR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif($ENV{WERROR})
Expand Down Expand Up @@ -273,6 +289,9 @@ if(BUILD_CAFFE2)
add_subdirectory(caffe/proto)
endif()

# ---[ Shared build
add_subdirectory(c10)

# ---[ Main build
add_subdirectory(caffe2)

Expand Down
10 changes: 5 additions & 5 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
/requirements.txt @apaszke @soumith @colesbury @gchanan @zdevito @ezyang
/torch/csrc/api/ @apaszke @soumith @colesbury @gchanan @zdevito @ezyang @ebetica @goldsborough
/test/cpp/api/ @apaszke @soumith @colesbury @gchanan @zdevito @ezyang @ebetica @goldsborough
/torch/onnx/ @anderspapitto @bddppq @dzhulgakov @ezyang @houseroad @jamesr66a @smessmer
/torch/csrc/onnx/ @anderspapitto @bddppq @dzhulgakov @ezyang @houseroad @jamesr66a @smessmer
/torch/csrc/jit/passes/onnx/ @anderspapitto @bddppq @dzhulgakov @ezyang @houseroad @jamesr66a @smessmer
/test/onnx/ @anderspapitto @bddppq @dzhulgakov @ezyang @houseroad @jamesr66a @smessmer
/scripts/onnx/ @anderspapitto @bddppq @dzhulgakov @ezyang @houseroad @jamesr66a @smessmer
/torch/onnx/ @anderspapitto @bddppq @dzhulgakov @ezyang @houseroad @jamesr66a @smessmer @Yangqing
/torch/csrc/onnx/ @anderspapitto @bddppq @dzhulgakov @ezyang @houseroad @jamesr66a @smessmer @Yangqing
/torch/csrc/jit/passes/onnx/ @anderspapitto @bddppq @dzhulgakov @ezyang @houseroad @jamesr66a @smessmer @Yangqing
/test/onnx/ @anderspapitto @bddppq @dzhulgakov @ezyang @houseroad @jamesr66a @smessmer @Yangqing
/scripts/onnx/ @anderspapitto @bddppq @dzhulgakov @ezyang @houseroad @jamesr66a @smessmer @Yangqing
/torch/lib/c10d/ @apaszke @pietern @teng-li
8 changes: 0 additions & 8 deletions aten/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ else()
USE_CUDNN "Use cuDNN" ON
"USE_CUDA" OFF)
option(ATEN_NO_TEST "Do not build ATen test binaries" OFF)
option(ATEN_NO_CONTRIB "Do not build ATen contrib" OFF)

# Legacy options, which we will eventually remove
cmake_dependent_option(
Expand Down Expand Up @@ -157,13 +156,6 @@ list(APPEND ATen_CPU_INCLUDE
${CMAKE_CURRENT_BINARY_DIR}/src/ATen)
add_subdirectory(src/ATen)

if(ATEN_NO_CONTRIB)
message("disable contrib because ATEN_NO_CONTRIB is set")
else()
add_subdirectory(contrib/data)
add_subdirectory(contrib/meter)
endif()

if (CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
# Pass source, includes, and libs to parent
set(ATen_CPU_SRCS ${ATen_CPU_SRCS} PARENT_SCOPE)
Expand Down
Loading