Skip to content

Merge from upstream master into our fork. #6

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

Merged
merged 195 commits into from
Jun 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 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
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
a6305ea
Fix protobuf options (#8184)
bstriner 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
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
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
14f5484
Print requires_grad and grad_fn in string repr of tensor (#8211)
colesbury 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
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
e2be77e
Fix app size check (#8256)
xiaomengy Jun 7, 2018
73966f6
Stop BCELoss from returning negative results (#8147)
li-roy Jun 8, 2018
ce122cc
Relax CUDA_HOME detection logic, to build when libraries are found. (…
dashesy Jun 8, 2018
4c2a1a1
Added backward function for kl_div target (#7839)
weiyangfb Jun 8, 2018
0c9b5f0
Change the output format of caffe2 observers (#8261)
lly-zero-one Jun 8, 2018
8d0c3c7
Remove TensorUtils<T>::getData, provide data<T>() in TH(C)Tensor. (#8…
gchanan Jun 8, 2018
048b2f3
[caffe2] Move submodule onnx-tensorrt forward (#7659)
pooyadavoodi Jun 8, 2018
4f1440e
[ideep] Add IDEEP fallbacks for Faster-RCNN ops (#8260)
viswanathgs Jun 8, 2018
80fade8
un-genericize THCDeviceTensorUtils. (#8258)
gchanan Jun 8, 2018
49593a6
[caffe2] Fix ATen dispatch for ops with TensorList arg (#8226)
Jun 8, 2018
1a03ba5
[cmake] Add and export Modules_CUDA_fix (#8271)
Yangqing Jun 8, 2018
2928a33
[auto] Update onnx to 2508156 - Make error message more verbose (onnx…
onnxbot Jun 8, 2018
147fc6b
[auto] Update onnx to 39e4668 - fix optimizer does not set ir_version…
onnxbot Jun 8, 2018
20c516a
[cmake] Make cudnn optional (#8265)
Yangqing Jun 8, 2018
7429125
Move signal window functions to ATen; add Blackman window (#8130)
ssnl Jun 8, 2018
d301d9d
[ideep] Fuse Conv-Relu after IDEEP graph rewrite, skip group conv (#8…
viswanathgs Jun 8, 2018
a994b43
[c10d] NCCL Process Group implementation (#8182)
teng-li Jun 8, 2018
d56b4f2
Set up CI build for CUDA 9.2 + macOS (#8274)
yf225 Jun 8, 2018
efba555
c10 build setup (#8264)
smessmer Jun 8, 2018
7556367
Remove remaining TensorTypeUtils functions. (#8286)
gchanan Jun 8, 2018
695d40e
Create initial Python bindings for c10d (#8119)
pietern Jun 8, 2018
c486b87
Add option USE_NVRTC which defaults to off (#8289)
Yangqing Jun 8, 2018
37073f8
[build] Remove /torch/lib/THD/cmake in favor of /cmake (#7159)
Yangqing Jun 8, 2018
045e743
Have a single THTensor / THCTensor type. (#8288)
gchanan Jun 8, 2018
f35d7cc
[auto] Update onnx to 58efe0a - add float16 support back for math and…
onnxbot Jun 8, 2018
a34211b
Some utils for compile-time programming (#7778)
smessmer Jun 9, 2018
788f05d
Remove THC's FindMAGMA (#8299)
Yangqing Jun 9, 2018
e6ef18d
Entries for torch.distributed in CODEOWNERS (#8293)
pietern Jun 9, 2018
2ed0389
Add depthwise convolution test for IDEEP (#8301)
Jun 9, 2018
3521cd5
Fix dividing by zero segfault in Reshape (#8302)
bddppq Jun 9, 2018
29849e4
Removes unused THCTensorConv (#8229)
mruberry Jun 9, 2018
b78466a
Replace Variables to Tensors (#8309)
vishwakftw Jun 10, 2018
07d3f14
Clean up old sccache log before build (#8305)
yf225 Jun 10, 2018
5fe2496
Remove unused grad ops on mobile to reduce app size (#8297)
xiaomengy Jun 10, 2018
d33cc08
Small fixes (#8296)
smessmer Jun 10, 2018
bf8689d
[auto] Update onnx to 5ed684e - Remove/replace /MX with /WX for MSVC …
onnxbot Jun 10, 2018
0169ac5
Fix sample code for cuda stream (#8319)
Stonesjtu Jun 10, 2018
01f5ba4
[auto] Update onnx to 4b4085c - Add missing warning ignoring flags to…
onnxbot Jun 10, 2018
80b6f9e
[THD] fix broken THD build with NCCL (#8323)
teng-li Jun 11, 2018
9488810
Add docstring for `torch.sparse_coo_tensor` (#8152)
sethah Jun 11, 2018
52e4d3c
add error when backend is not supported by DDP (#8325)
ailzhang Jun 11, 2018
bed172c
Fix collect_env.py for Windows (#8326)
peterjc123 Jun 11, 2018
f4b79f9
Fix the script doesn't stop eariler on error for MSVC and Ninja (#8277)
peterjc123 Jun 11, 2018
77dea37
Skip test_multinomial_invalid_probs_cuda on Windows (#8324)
yf225 Jun 11, 2018
77660a9
Support printing sparse tensors in ATen, fixes #8333. (#8334)
ezyang Jun 11, 2018
de4e97e
[C++ API] Cursors (#8190)
goldsborough Jun 11, 2018
607b86f
Implement dim_arange operator (#8266)
Jun 11, 2018
9b1480a
Fix disabling of USE_CUDNN when not found (#8340)
orionr Jun 11, 2018
46c0b01
Revert D3314316 (#8346)
dzhulgakov Jun 11, 2018
ddab886
[caffe2] Move elementwise grad ops to separate files (#8315)
xiaomengy Jun 11, 2018
ae1ceef
Allow TypeMeta hold non-default-constructible types (#8349)
dzhulgakov Jun 11, 2018
0cced57
Build DEBUG mode with -O0, fixes #8335. (#8336)
ezyang Jun 12, 2018
38362fa
Prepare for moving 0-sized dimensions in TH/THC. (#8337)
gchanan Jun 12, 2018
78e3259
Add autograd automatic anomaly detection (#7677)
albanD Jun 12, 2018
1f02ebd
Use clang 8 to build CUDA in macOS CI (#8355)
yf225 Jun 12, 2018
87dcdf5
[auto] Update onnx to 86999f9 - Fix the LRN's doc (onnx/onnx#1107)
onnxbot Jun 12, 2018
44973a0
Add affine_channel_op (#8356)
xiaomengy Jun 12, 2018
a161639
Move copyright lines back to NOTICE file, fixes #6911 (#8310)
ezyang Jun 12, 2018
96876d9
Name the thread pools (#8137)
ot Jun 12, 2018
cc8fbc9
Revert "Name the thread pools (#8137)" (#8379)
ezyang Jun 12, 2018
5484a19
[c10d] Convenience wrappers for collective functions (#8292)
pietern Jun 12, 2018
991bdd7
[build] remove the use of NO_CUDA (#8300)
Yangqing Jun 12, 2018
922adf8
Skip calling ncclCommDestroy in destructor (#8352)
xw285cornell Jun 12, 2018
a77b391
[SpectralNorm] don't register original weight as buffer (#8170)
ssnl Jun 12, 2018
49eec35
More warning skips (#8382)
orionr Jun 12, 2018
5f5ea75
Use SYSTEM For all includes in Dependencies.cmake (#8380)
orionr Jun 12, 2018
bef1255
Check CAFFE2_USE_MSVC_STATIC_RUNTIME to set -MD vs -MT in cuda.cmake …
orionr Jun 12, 2018
c6db1bc
Add gt lt ge le to the supported operators list (#8375)
yueyericardo Jun 12, 2018
c3e4b3c
raise more informative error msg for torch.load not support seek (#7754)
weiyangfb Jun 12, 2018
712a3fa
Adding CMAKE_PREFIX_PATH and CMAKE_INSTALL_PREFIX to cmake summary (#…
pjh5 Jun 12, 2018
ffffee6
Skip test_multinomial_invalid_probs on Windows (#8360)
yf225 Jun 12, 2018
fcd9af8
changes to support ATen code generation inside fbcode (#8397)
anderspapitto Jun 12, 2018
b947ac2
Check if you forgot to specify 'variants: function' on _out (#8402)
ezyang Jun 13, 2018
4485ce6
Fix flaky RoiAlignTest, fixes #8084. (#8312)
ezyang Jun 13, 2018
5575111
Always include Modules_CUDA_fix for Caffe2 builds (#8396)
yf225 Jun 13, 2018
7c9e936
Add way of deprecating ATen functions (#8404)
goldsborough Jun 13, 2018
49d6c5f
Branch parallel if number of threads is 1 (#8401)
cpuhrsch Jun 13, 2018
81b92f7
Get ROCm building again on master (#8343)
Jorghi12 Jun 13, 2018
76f22b7
[caffe2] uprade IDEEP and hotfix for conv op accuracy issue (#8364)
gujinghui Jun 13, 2018
0450396
[ONNX] Add an ATen fallback pathway for ONNX export (#8273)
Jun 13, 2018
36bf89b
Remove imaginary file (#8415)
goldsborough Jun 13, 2018
c37e5b7
[Caffe2] Enable AMD/MIOPEN ops for Caffe2 (#8306)
petrex Jun 13, 2018
a42c12b
Enable some reduce operators' ONNX backend tests (#8418)
houseroad Jun 13, 2018
7ca8e2f
fix old comment to point to the right file (#8416)
Yangqing Jun 13, 2018
3cb45ba
Stop pinning nccl version. (#8421)
ezyang Jun 13, 2018
61f61de
Expose logsumexp docs and mark log_sum_exp in distributions for inter…
vishwakftw Jun 13, 2018
7543d0f
Enable some of the ONNX backend test on broadcasting (#8423)
houseroad Jun 13, 2018
edd4e2c
Expose proto utils and ONNX (#8073)
orionr Jun 13, 2018
09896d1
Allow nccl downgrades (#8429)
ezyang Jun 13, 2018
f1b5124
Fix #8420, defaulting the initial hidden state to 0 (#8427)
vishwakftw Jun 13, 2018
5b86c3a
Update from facebook (#8384)
sf-wind Jun 13, 2018
71a3633
change tensor.set_() argument names to match descriptions in doc (#8403)
weiyangfb Jun 13, 2018
2c9c48a
Add CODEOWNERS entry for c10d test file (#8445)
pietern Jun 13, 2018
4d287f9
Use int64_t instead of int for in loop that may overflow. (#8435)
colesbury Jun 13, 2018
8a837f0
Repairing the integrated build path to handle the Caffe2 PR. (#8441)
Jorghi12 Jun 13, 2018
dc209ed
[c10d] Rendezvous skeleton (#8294)
pietern Jun 13, 2018
df3559c
Move hip utils files to a separate directory (#8446)
bddppq Jun 13, 2018
ad378df
Adding necessary LOCAL variables in order for the perl script that HI…
Jorghi12 Jun 14, 2018
681964c
output each operator separately due to logcat truncation (#8456)
lly-zero-one Jun 14, 2018
6e314f9
update tensor clone docs (#8462)
li-roy Jun 14, 2018
64d5b14
Add is_variable tag to Tensor (#8414)
goldsborough Jun 14, 2018
f758517
[auto] Update onnx to b7d5a60 - Add stats on ONNX node tests (onnx/on…
onnxbot Jun 14, 2018
db14f3f
More efficient kernels that avoid deprecated shuffles in Embedding an…
mcarilli Jun 14, 2018
2de4ab8
remove _assert_no_grad from loss modules (#8460)
li-roy Jun 14, 2018
bb9ef8f
Support new version of Dropout (#8470)
houseroad Jun 14, 2018
6a85b13
Improve number formatting in tensor print (#7632)
li-roy Jun 14, 2018
9d88ff7
Add half cauchy, half normal distributions (#8411)
fehiepsi Jun 14, 2018
8d674c0
add comparison operators to jit (#8058)
Jun 14, 2018
2184e3f
Use MKL VML if available (#8458)
cpuhrsch Jun 14, 2018
e323f02
Fixing missing PyCObject_Type bug (#8467)
pjh5 Jun 14, 2018
2a0e98a
Move libtorch CMakeLists.txt to torch/ (#8444)
orionr Jun 14, 2018
21609e0
``bincount`` feature implementation (#6688)
chintak Jun 14, 2018
752bb95
Update RunAsyncFailure test (#8486)
sf-wind Jun 14, 2018
384936f
TypeId improvements (#8350)
smessmer Jun 14, 2018
a4bd4f6
Fix -g not passed to nvcc when DEBUG=1 (#8407)
ssnl Jun 14, 2018
fa277e6
[IDEEP] [fix bug] Fix bug in ideep SkipOutputCopy strategy (#8372)
wuhuikx Jun 14, 2018
aed9806
Pin correct clang version in macOS CI test (#8457)
yf225 Jun 14, 2018
467fc3c
[READY TO MERGE] Improve docs for Multinomial and Categorical distrib…
yf225 Jun 14, 2018
aa2c79a
Add ONLY_FOR_TEST device type into executor (#8461)
sf-wind Jun 14, 2018
2f25d1f
Enable tracing and script autograd tests (#8145)
zdevito Jun 14, 2018
c419416
Temporary solution for having access to Python installation path. (#8…
Jorghi12 Jun 14, 2018
9a8276f
Merge remote-tracking branch 'upstream/master'
iotamudelta Jun 14, 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.

159 changes: 97 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,60 @@ 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")

# 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
# TODO: This is patching the official FindHip to properly handly
# cmake generator expression. A PR is opened in the upstream repo here:
# https://github.com/ROCm-Developer-Tools/HIP/pull/516
# remove this hack once it's merged.
if [[ -f /opt/rocm/hip/cmake/FindHIP.cmake ]]; then
sudo sed -i 's/\ -I${dir}/\ $<$<BOOL:${dir}>:-I${dir}>/' /opt/rocm/hip/cmake/FindHIP.cmake
fi

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
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 +174,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 +185,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 +223,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
18 changes: 18 additions & 0 deletions .jenkins/pytorch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ gcc --version
# TODO: Don't run this...
pip install -r requirements.txt || true

if [[ "$BUILD_ENVIRONMENT" == *rocm* ]]; then
export HCC_AMDGPU_TARGET=gfx900
export LANG=C.UTF-8
export LC_ALL=C.UTF-8

# TODO: Install pyHIPIFY in the docker image
rm -rf pyHIPIFY || true
git clone https://github.com/ROCm-Developer-Tools/pyHIPIFY.git
chmod a+x pyHIPIFY/*.py
sudo cp -p pyHIPIFY/*.py /opt/rocm/bin
sudo chown -R jenkins:jenkins /usr/local
rm -rf "$(dirname "${BASH_SOURCE[0]}")/../../../pytorch_amd/" || true
python "$(dirname "${BASH_SOURCE[0]}")/../../tools/amd_build/build_pytorch_amd.py"
HIPCC_VERBOSE=7 VERBOSE=1 WITH_ROCM=1 python setup.py install
exit
fi

# TODO: Don't install this here
if ! which conda; then
pip install mkl mkl-devel
fi
Expand Down
1 change: 1 addition & 0 deletions .jenkins/pytorch/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ trap_add cleanup EXIT
if which sccache > /dev/null; then
# Save sccache logs to file
sccache --stop-server || true
rm ~/sccache_error.log || true
SCCACHE_ERROR_LOG=~/sccache_error.log RUST_LOG=sccache::server=error sccache --start-server

# Report sccache stats for easier debugging
Expand Down
5 changes: 4 additions & 1 deletion .jenkins/pytorch/enabled-configs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ pytorch-linux-trusty-pynightly-build
pytorch-linux-trusty-pynightly-test
pytorch-win-ws2016-cuda9-cudnn7-py3-build
pytorch-win-ws2016-cuda9-cudnn7-py3-test
pytorch-macos-10.13-py3-build-test
pytorch-macos-10.13-py3-build
pytorch-macos-10.13-py3-test
pytorch-macos-10.13-cuda9.2-cudnn7-py3-build
pytorch-docker-build-test
short-perf-test-cpu
short-perf-test-gpu
py2-clang3.8-rocmnightly-ubuntu16.04-build
37 changes: 33 additions & 4 deletions .jenkins/pytorch/macos-build.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/bin/bash

COMPACT_JOB_NAME=pytorch-macos-10.13-py3-build-test
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

COMPACT_JOB_NAME="${BUILD_ENVIRONMENT}-build"
export PATH="/usr/local/bin:$PATH"
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

# Set up conda environment
export PYTORCH_ENV_DIR="${HOME}/pytorch-ci-env"
Expand All @@ -21,10 +20,40 @@ 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
if [[ "${JOB_BASE_NAME}" == *cuda9.2* ]]; then
export CUDA_VERSION=9.2
export TORCH_CUDA_ARCH_LIST=5.2
export PATH=/Developer/NVIDIA/CUDA-${CUDA_VERSION}/bin${PATH:+:${PATH}}
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-${CUDA_VERSION}/lib${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
export CUDA_HOME=/Developer/NVIDIA/CUDA-${CUDA_VERSION}
export NO_CUDA=0

# Eigen gives "explicit specialization of class must precede its first use" error
# when compiling with Xcode 9.1 toolchain, so we have to use Xcode 8.2 toolchain instead.
export DEVELOPER_DIR=/Library/Developer/CommandLineTools
else
export DEVELOPER_DIR=/Applications/Xcode9.app/Contents/Developer
fi

export MACOSX_DEPLOYMENT_TARGET=10.9
export CXX=clang++
export CC=clang
if which sccache > /dev/null; then
printf "#!/bin/sh\nexec sccache $(which clang++) \$*" > "${PYTORCH_ENV_DIR}/clang++"
chmod a+x "${PYTORCH_ENV_DIR}/clang++"

printf "#!/bin/sh\nexec sccache $(which clang) \$*" > "${PYTORCH_ENV_DIR}/clang"
chmod a+x "${PYTORCH_ENV_DIR}/clang"

if [[ "${JOB_BASE_NAME}" == *cuda* ]]; then
printf "#!/bin/sh\nexec sccache $(which nvcc) \$*" > "${PYTORCH_ENV_DIR}/nvcc"
chmod a+x "${PYTORCH_ENV_DIR}/nvcc"
export CUDA_NVCC_EXECUTABLE="${PYTORCH_ENV_DIR}/nvcc"
fi

export PATH="${PYTORCH_ENV_DIR}:$PATH"
fi
# If we run too many parallel jobs, we will OOM
export MAX_JOBS=2

Expand Down
11 changes: 9 additions & 2 deletions .jenkins/pytorch/macos-test.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

COMPACT_JOB_NAME=pytorch-macos-10.13-py3-build-test
COMPACT_JOB_NAME="${BUILD_ENVIRONMENT}-test"
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

export PATH="/usr/local/bin:$PATH"
Expand All @@ -21,7 +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
# Test PyTorch
if [[ "${JOB_BASE_NAME}" == *cuda9.2* ]]; then
# Eigen gives "explicit specialization of class must precede its first use" error
# when compiling with Xcode 9.1 toolchain, so we have to use Xcode 8.2 toolchain instead.
export DEVELOPER_DIR=/Library/Developer/CommandLineTools
else
export DEVELOPER_DIR=/Applications/Xcode9.app/Contents/Developer
fi
export MACOSX_DEPLOYMENT_TARGET=10.9
export CXX=clang++
export CC=clang
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/pytorch/print_sccache_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

for line in lines:
# Ignore errors from CPU instruction set testing
if 'CMakeFiles/CMakeTmp/src.c' not in line:
if 'src.c' not in line:
print(line)
Loading