Skip to content
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

Merge from upstream #121

Merged
merged 77 commits into from
Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
f59cce9
Some symbol annotation fixes for Windows
peterjc123 Aug 13, 2018
216961b
Remove is_zero_dim_ bool in THTensor.
gchanan Aug 13, 2018
c6fc3ab
fixes printing non-contiguous tensors
Aug 13, 2018
ffb59e5
adding stochastic quantization caffe2 operators (encoder and decoder …
Aug 13, 2018
f6eb966
Fix TanhGradientOperator linker errors (#10426)
wesolwsk Aug 14, 2018
9a9224e
Remove "locally" from CONTRIBUTING.md (#10495)
goldsborough Aug 14, 2018
099a545
Hipify Caffe2 binaries (#10468)
bddppq Aug 14, 2018
fed05cf
Fix prim::FusedConcat bug (#10466)
zou3519 Aug 14, 2018
facb293
Fix FindMKL.cmake for Windows (#10453)
peterjc123 Aug 14, 2018
7d16e87
Fix byte ordering issue in from_numpy (#9508)
vishwakftw Aug 14, 2018
c618df1
Add intrinsic support for external_input/output to nomnigraph (#10100)
bwasti Aug 14, 2018
329d901
Fold AffineChannel to Conv, the same way as BN (for Detectron models)…
jgong5 Aug 14, 2018
8d626b6
Merge remote-tracking branch 'upstream/master'
iotamudelta Aug 14, 2018
ef44fae
check attribute existence in torch.legay.nn.SpatialFullConvolution in…
Aug 14, 2018
3a40baa
fix a grammatical error: accelerate compute (#10204)
ladyrick Aug 14, 2018
61bedc9
Schema-based creation of graph nodes (#10198)
zdevito Aug 14, 2018
9497383
Fix some warnings (#10297)
orionr Aug 14, 2018
01a7213
Merge remote-tracking branch 'upstream/master'
iotamudelta Aug 14, 2018
e5811be
Add tags for onnx tensor descriptors (#10502)
Aug 14, 2018
b446251
Add LSTMCell backward pass expect tests (#10506)
zou3519 Aug 14, 2018
d043f83
Add tests for Tensor.* nn.* F.* docs (#10311)
ssnl Aug 14, 2018
520f4f6
Added some unit test for box_with_nms_limit_op. (#10389)
newstzpz Aug 14, 2018
d1442b3
add a rebuild_libtorch command for speedier iteration. (#10036)
anderspapitto Aug 14, 2018
2400512
Remove unnecessary include
ezyang Aug 14, 2018
bd49780
CAFFE_ENFORCE -> CAFFE_ENFORCE_EQ for error with more information (#1…
jspark1105 Aug 14, 2018
eea8ab1
Move common code to RNNCellBase. (#10399)
striajan Aug 14, 2018
bdb11e7
Split the dependence of ONNX from test_operators.py (#10151)
houseroad Aug 14, 2018
13814d6
Remove use of data() in optimizers (#10490)
goldsborough Aug 14, 2018
3f3a30f
Added Reduce,AllGather,Gather,Scatter Ops for NCCL and MPI process gr…
teng-li Aug 14, 2018
b6ebf5a
Merge remote-tracking branch 'upstream/master'
iotamudelta Aug 14, 2018
16ecd6f
Fix Debug Build On Windows (#10359)
lara-hdr Aug 14, 2018
3c39e85
Python binding for reduce,allgather,scatter,gather ops and python tes…
teng-li Aug 14, 2018
39bfc2d
Nomnigraph - add diagnostic ability for Subgraph matching API (#10267)
duc0 Aug 14, 2018
b69b1c4
Adding python binding for MPI process group (#10199)
teng-li Aug 14, 2018
32bb404
Unified type annotation parsing for script frontends (#10279)
Aug 15, 2018
60aa416
Re-purpose setup_caffe2.py for faster caffe2 build iterations (#10520)
bddppq Aug 15, 2018
c69fa6d
Workaround with explicit casts for ROCm compiler issue.
iotamudelta Aug 15, 2018
17ecc06
static casting TIndex (#10514)
Aug 15, 2018
26e40fa
Tensor.accessor now fails on rvalue reference (#10518)
ebetica Aug 15, 2018
b6cc65a
Send, Recv, RecvAnysource, Barrier Op for MPI PG and Python Bindings …
teng-li Aug 15, 2018
964e30d
Workaround for Cuda9.2 and GCC7 compilation errors (#10510)
mingzhe09088 Aug 15, 2018
19ad55c
set coalesced=false at sparse transpose() and removed transpose invar…
weiyangfb Aug 15, 2018
f1631c3
Modify build.sh and test.sh scripts for ppc64le jenkins build and tes…
avmgithub Aug 15, 2018
e41528a
Also set stdin to subprocess pipe in FindCUDA windows popen call (#10…
mattdawkins Aug 15, 2018
ce8e8fe
Fixed a bug in box_with_nms_limit where it may produce more bounding …
newstzpz Aug 15, 2018
6a4893a
Multiplication by stride not necessary.
iotamudelta Aug 15, 2018
0f05f5f
ATen layer norm symbolic (#10513)
Aug 15, 2018
2786198
Rework this a bit for better performance and readability.
iotamudelta Aug 15, 2018
d8ff7ad
generalize order switch ops for 1-3d (#10395)
jspark1105 Aug 15, 2018
f0b6a5f
Strides are not needed any longer.
iotamudelta Aug 15, 2018
23965bb
Fix miscast.
iotamudelta Aug 15, 2018
f5a4dd8
Implements volumetric (5d) affine grid generation. (#8322)
elistevens Aug 15, 2018
44b029f
move matrix formation for dot products to precompute/request-only (#1…
Aug 15, 2018
87cbc98
Merge remote-tracking branch 'upstream/master'
iotamudelta Aug 15, 2018
f967e15
Revert "Rework this a bit for better performance and readability." and a
iotamudelta Aug 15, 2018
0f144bc
Apply the reinterpret_cast fix also to fn(a,b).
iotamudelta Aug 15, 2018
f59bcea
parallel max and min for ATen on CPU (#10343)
mingfeima Aug 15, 2018
d93e8ab
Nomnigraph - Refactor SubtreeMatchCriteria to become a Graph of Match…
duc0 Aug 15, 2018
9cffe78
relax tolerance for two torch.half (float16) tests (#10519)
hartb Aug 15, 2018
5d27d68
remove implicit conversion to cpu (#10416)
Aug 15, 2018
05a260d
Bump gloo to latest master (#10545)
orionr Aug 15, 2018
9646d68
support broadcasting in _kl_categorical_categorical (#10533)
joh4n Aug 15, 2018
85408e7
Move filler interface to operator schema (#10522)
highker Aug 15, 2018
0bbcc7b
Don't assume curl version in Windows build script (#10476)
Aug 15, 2018
254dedf
Propagate NaN through threshold (#10277)
ssnl Aug 15, 2018
fb09292
Increase tolerance in ConvBN test
bwasti Aug 15, 2018
484395e
Fix corner case with torch.multinomial (#9960)
t-vi Aug 15, 2018
86363e1
Move RNN implementations to C++ (#10481)
apaszke Aug 15, 2018
5adcac3
Cuda half macros cleanup (#10147)
syed-ahmed Aug 15, 2018
6f14202
Revert D9276252: [pytorch][PR] remove implicit conversion to cpu
ezyang Aug 15, 2018
c5b1aa9
Export uint8 tensors as byte string in mobile_exporter and add GivenT…
3l1 Aug 15, 2018
021b488
Remove setup_requires and tests_require from setup.py for FULL_CAFFE2…
orionr Aug 15, 2018
26c764a
Update FP16 submodule. Close #10523 (#10548)
Aug 15, 2018
fb45ec5
Don't set DEBUG=1 in ASAN build (#9902)
Aug 15, 2018
e78954a
Strides not needed.
iotamudelta Aug 15, 2018
7987f8f
Merge remote-tracking branch 'upstream/master'
iotamudelta Aug 15, 2018
e408df1
Try another way to workaround the compiler bug on ROCm.
iotamudelta Aug 16, 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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .jenkins/pytorch/build-asan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export ASAN_OPTIONS=detect_leaks=0:symbolize=1
# TODO: Make the ASAN flags a more unified env var
CC="clang" CXX="clang++" LDSHARED="clang --shared" \
CFLAGS="-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -shared-libasan" \
NO_CUDA=1 DEBUG=1 \
NO_CUDA=1 \
python setup.py install
20 changes: 16 additions & 4 deletions .jenkins/pytorch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ if [[ "$BUILD_ENVIRONMENT" == *rocm* ]]; then
# This environment variable enabled HCC Optimizations that speed up the linking stage.
# https://github.com/RadeonOpenCompute/hcc#hcc-with-thinlto-linking
export KMTHINLTO=1

# Need the libc++1 and libc++abi1 libraries to allow torch._C to load at runtime
sudo apt-get install libc++1
sudo apt-get install libc++abi1

python tools/amd_build/build_pytorch_amd.py
USE_ROCM=1 python setup.py install --user
exit 0
Expand All @@ -64,13 +64,25 @@ if ([[ "$BUILD_ENVIRONMENT" == *cuda* ]] || [[ "$BUILD_ENVIRONMENT" == *gcc7* ]]
fi

# Target only our CI GPU machine's CUDA arch to speed up the build
export TORCH_CUDA_ARCH_LIST=5.2
export TORCH_CUDA_ARCH_LIST="5.2"

if [[ "$BUILD_ENVIRONMENT" == *ppc64le* ]]; then
export TORCH_CUDA_ARCH_LIST="6.0"
fi

if [[ "$BUILD_ENVIRONMENT" == *trusty-py3.6-gcc5.4* ]]; then
export DEBUG=1
fi

WERROR=1 python setup.py install
# ppc64le build fails when WERROR=1
# set only when building other architectures
# only use for "python setup.py install" line
if [[ "$BUILD_ENVIRONMENT" != *ppc64le* ]]; then
WERROR=1 python setup.py install
elif [[ "$BUILD_ENVIRONMENT" == *ppc64le* ]]; then
python setup.py install
fi


# Add the test binaries so that they won't be git clean'ed away
git add -f build/bin
Expand Down
4 changes: 4 additions & 0 deletions .jenkins/pytorch/enabled-configs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ short-perf-test-cpu
short-perf-test-gpu
py2-clang3.8-rocm1.7.1-ubuntu16.04-build
py2-clang3.8-rocm1.7.1-ubuntu16.04-test
pytorch-ppc64le-cuda9.2-cudnn7-py3-build
pytorch-ppc64le-cuda9.2-cudnn7-py3-test
pytorch-ppc64le-cuda9.1-cudnn7-py3-build
pytorch-ppc64le-cuda9.1-cudnn7-py3-test
9 changes: 7 additions & 2 deletions .jenkins/pytorch/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,13 @@ test_aten() {
# NB: the ATen test binaries don't have RPATH set, so it's necessary to
# put the dynamic libraries somewhere were the dynamic linker can find them.
# This is a bit of a hack.
ln -s "$TORCH_LIB_PATH"/libcaffe2* build/bin
ln -s "$TORCH_LIB_PATH"/libnccl* build/bin
if [[ "$BUILD_ENVIRONMENT" == *ppc64le* ]]; then
SUDO=sudo
fi

${SUDO} ln -s "$TORCH_LIB_PATH"/libcaffe2* build/bin
${SUDO} ln -s "$TORCH_LIB_PATH"/libnccl* build/bin

ls build/bin
aten/tools/run_tests.sh build/bin
fi
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/pytorch/win-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ EOL

cat >ci_scripts/build_pytorch.bat <<EOL

set PATH=C:\\Program Files\\CMake\\bin;C:\\Program Files\\7-Zip;C:\\curl-7.57.0-win64-mingw\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Amazon\\AWSCLI;%PATH%
set PATH=C:\\Program Files\\CMake\\bin;C:\\Program Files\\7-Zip;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Amazon\\AWSCLI;%PATH%

:: Install MKL
if "%REBUILD%"=="" (
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/pytorch/win-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ EOL

cat >ci_scripts/setup_pytorch_env.bat <<EOL

set PATH=C:\\Program Files\\CMake\\bin;C:\\Program Files\\7-Zip;C:\\curl-7.57.0-win64-mingw\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Amazon\\AWSCLI;%PATH%
set PATH=C:\\Program Files\\CMake\\bin;C:\\Program Files\\7-Zip;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Amazon\\AWSCLI;%PATH%

:: Install Miniconda3
IF EXIST C:\\Jenkins\\Miniconda3 ( rd /s /q C:\\Jenkins\\Miniconda3 )
Expand Down
15 changes: 9 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ If you are not familiar with creating a Pull Request, here are some guides:
- https://help.github.com/articles/creating-a-pull-request/


## Developing locally with PyTorch
## Developing PyTorch

To locally develop with PyTorch, here are some tips:
To develop PyTorch on your machine, here are some tips:

1. Uninstall all existing pytorch installs
```
Expand All @@ -30,7 +30,7 @@ pip uninstall torch
pip uninstall torch # run this command twice
```

2. Locally clone a copy of PyTorch from source:
2. Clone a copy of PyTorch from source:

```
git clone https://github.com/pytorch/pytorch
Expand Down Expand Up @@ -142,10 +142,13 @@ working on:
- Working on the Python bindings? Run `python setup.py develop` to rebuild
(NB: no `build` here!)

- Working on `torch/csrc` or `aten`? Run `python setup.py build_caffe2` to
- Working on `torch/csrc` or `aten`? Run `python setup.py rebuild_libtorch` to
rebuild and avoid having to rebuild other dependent libraries we
depend on. The other valid targets are listed in `dep_libs` in `setup.py`
(prepend `build_` to get a target).
depend on.

- Working on one of the other dependent libraries? The other valid
targets are listed in `dep_libs` in `setup.py`. prepend `build_` to
get a target, and run as e.g. `python setup.py build_gloo`.

- Working on a test binary? Run `(cd build && ninja bin/test_binary_name)` to
rebuild only that test binary (without rerunning cmake). (Replace `ninja` with
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ If you use NumPy, then you have used Tensors (a.k.a ndarray).

![Tensor illustration](https://github.com/pytorch/pytorch/blob/master/docs/source/_static/img/tensor_illustration.png)

PyTorch provides Tensors that can live either on the CPU or the GPU, and accelerate
compute by a huge amount.
PyTorch provides Tensors that can live either on the CPU or the GPU, and accelerates the
computation by a huge amount.

We provide a wide variety of tensor routines to accelerate and fit your scientific computation needs
such as slicing, indexing, math operations, linear algebra, reductions.
Expand Down
1 change: 0 additions & 1 deletion aten/src/ATen/Allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <stddef.h>

#include <ATen/Device.h>
#include <ATen/Retainable.h>
#include <ATen/core/Error.h>
#include <ATen/core/UniqueVoidPtr.h>

Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/Layout.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <ATen/ScalarType.h>
#include <ATen/Backend.h>
#include <ATen/core/Error.h>

#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/Registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class AT_API Registry {
};

template <class SrcType, class ObjectPtrType, class... Args>
class AT_API Registerer {
class Registerer {
public:
Registerer(
const SrcType& key,
Expand Down
2 changes: 0 additions & 2 deletions aten/src/ATen/TensorAccessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#include <cstddef>
#include <stdint.h>

#include "ATen/ScalarType.h"

namespace at {


Expand Down
3 changes: 0 additions & 3 deletions aten/src/ATen/TensorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ void TensorImpl::release_resources() {
}

int64_t TensorImpl::dim() const {
if(THTensor_isZeroDim(tensor)) {
return 0;
}
return tensor->dim();
}

Expand Down
48 changes: 24 additions & 24 deletions aten/src/ATen/core/typeid.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,34 +457,34 @@ class Tensor;

struct _CaffeHighestPreallocatedTypeId final {};

CAFFE_DECLARE_KNOWN_TYPE(0, uint8_t);
CAFFE_DECLARE_KNOWN_TYPE(1, int8_t);
CAFFE_DECLARE_KNOWN_TYPE(2, int16_t);
CAFFE_DECLARE_KNOWN_TYPE(3, int);
CAFFE_DECLARE_KNOWN_TYPE(4, int64_t);
CAFFE_DECLARE_KNOWN_TYPE(5, at::Half);
CAFFE_DECLARE_KNOWN_TYPE(6, float);
CAFFE_DECLARE_KNOWN_TYPE(7, double);
CAFFE_DECLARE_KNOWN_TYPE(0, uint8_t)
CAFFE_DECLARE_KNOWN_TYPE(1, int8_t)
CAFFE_DECLARE_KNOWN_TYPE(2, int16_t)
CAFFE_DECLARE_KNOWN_TYPE(3, int)
CAFFE_DECLARE_KNOWN_TYPE(4, int64_t)
CAFFE_DECLARE_KNOWN_TYPE(5, at::Half)
CAFFE_DECLARE_KNOWN_TYPE(6, float)
CAFFE_DECLARE_KNOWN_TYPE(7, double)
// 8 = undefined type id

CAFFE_DECLARE_KNOWN_TYPE(9, Tensor);
CAFFE_DECLARE_KNOWN_TYPE(10, std::string);
CAFFE_DECLARE_KNOWN_TYPE(11, bool);
CAFFE_DECLARE_KNOWN_TYPE(12, uint16_t);
CAFFE_DECLARE_KNOWN_TYPE(13, char);
CAFFE_DECLARE_KNOWN_TYPE(14, std::unique_ptr<std::mutex>);
CAFFE_DECLARE_KNOWN_TYPE(15, std::unique_ptr<std::atomic<bool>>);
CAFFE_DECLARE_KNOWN_TYPE(16, std::vector<int32_t>);
CAFFE_DECLARE_KNOWN_TYPE(17, std::vector<int64_t>);
CAFFE_DECLARE_KNOWN_TYPE(18, std::vector<unsigned long>);
CAFFE_DECLARE_KNOWN_TYPE(19, bool*);
CAFFE_DECLARE_KNOWN_TYPE(20, char*);
CAFFE_DECLARE_KNOWN_TYPE(21, int*);
CAFFE_DECLARE_KNOWN_TYPE(9, Tensor)
CAFFE_DECLARE_KNOWN_TYPE(10, std::string)
CAFFE_DECLARE_KNOWN_TYPE(11, bool)
CAFFE_DECLARE_KNOWN_TYPE(12, uint16_t)
CAFFE_DECLARE_KNOWN_TYPE(13, char)
CAFFE_DECLARE_KNOWN_TYPE(14, std::unique_ptr<std::mutex>)
CAFFE_DECLARE_KNOWN_TYPE(15, std::unique_ptr<std::atomic<bool>>)
CAFFE_DECLARE_KNOWN_TYPE(16, std::vector<int32_t>)
CAFFE_DECLARE_KNOWN_TYPE(17, std::vector<int64_t>)
CAFFE_DECLARE_KNOWN_TYPE(18, std::vector<unsigned long>)
CAFFE_DECLARE_KNOWN_TYPE(19, bool*)
CAFFE_DECLARE_KNOWN_TYPE(20, char*)
CAFFE_DECLARE_KNOWN_TYPE(21, int*)

#ifdef CAFFE2_UNIQUE_LONG_TYPEMETA
CAFFE_DECLARE_KNOWN_TYPE(22, long);
CAFFE_DECLARE_KNOWN_TYPE(23, std::vector<long>);
CAFFE_DECLARE_KNOWN_TYPE(22, long)
CAFFE_DECLARE_KNOWN_TYPE(23, std::vector<long>)
#endif // CAFFE2_UNIQUE_LONG_TYPEMETA

CAFFE_DECLARE_KNOWN_TYPE(24, _CaffeHighestPreallocatedTypeId);
CAFFE_DECLARE_KNOWN_TYPE(24, _CaffeHighestPreallocatedTypeId)
} // namespace caffe2
3 changes: 2 additions & 1 deletion aten/src/ATen/function_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def TypedDict(name, attrs, total=True): # type: ignore

# add non-virtual declaration to Tensor.h
TENSOR_METHOD_DECLARATION = CodeTemplate("""\
${return_type} ${api_name}(${method_formals_with_defaults})${const_mark};
AT_API ${return_type} ${api_name}(${method_formals_with_defaults})${const_mark};
""")
# add non-virtual declaration to Tensor.cpp
TENSOR_METHOD_DEFINITION = CodeTemplate("""\
Expand Down Expand Up @@ -295,6 +295,7 @@ def __init__(self, reason):
CodeTemplate(
'check_generator<${Backend}Generator>(${arg_name}, &globalContext().defaultGenerator(backend()))'),
# This is a cast done via direct-construction
'IntListStride': CodeTemplate('at::IntList ${result_name} = get_intlist_stride_th(${arg_name});'),
'real': CodeTemplate('${arg_name}.to${ScalarName}()'),
'accreal': CodeTemplate('${arg_name}.to${AccScalarName}()'),
'TensorList': CodeTemplate(
Expand Down
Loading