Skip to content

Merge from upstream #149

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 107 commits into from
Aug 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
f9d1b00
Move THNN Reduction to ATen/core. (#10703)
gchanan Aug 21, 2018
30ad13f
Avoid shadowing i, j vars in GeneralProposals test (#10721)
Aug 21, 2018
b0b5139
Set the BUILD_ENVIRONMENT variable before installing sccache. (#10640)
Jorghi12 Aug 21, 2018
b23d59c
Make ONNX_ATEN_FALLBACK as internal default option
houseroad Aug 21, 2018
9c321a8
Add util function from core type to dtype (#10716)
Aug 21, 2018
8a1739b
Add arguments __repr__ in Distribution base class
nadavbh12 Aug 21, 2018
edb3443
More changes for hidden visibility (#10692)
orionr Aug 21, 2018
04b773a
Support Loading to GPU (#10710)
xush6528 Aug 21, 2018
e94ae99
Delete copy constructor/assignment of class Observable explicitly. (#…
tolia-msft Aug 21, 2018
71ddd83
Support custom ops in ScriptModule and tidy up test files (#10610)
goldsborough Aug 22, 2018
44f996f
Py3 fixes for layer_model_helper.py (#10525)
tomdz Aug 22, 2018
6325e5a
fix typo in error message (#9827)
ajaech Aug 22, 2018
ddf187c
Dont assume serialized integral types were widened to int32 in raw_da…
Aug 22, 2018
a2ca634
Add enforce back to converter.cc
bwasti Aug 22, 2018
1068ba6
Create at::linear (#10755)
goldsborough Aug 22, 2018
e5e2514
fix debug_info arg in createOperator and improve reroute_tensor (#10736)
harouwu Aug 22, 2018
abb209e
Fixes *fft docs (#10760)
ssnl Aug 22, 2018
19031c6
Use intrusive_ptr in Storage; replace unique_ptr<Storage> with Storag…
ezyang Aug 22, 2018
22446a3
Productionize CRF layer in PyText (#10362)
ahhegazy Aug 22, 2018
2fe5fa7
Use FinishDeviceComputation instead of adding events in Operator::Syn…
pritamdamania Aug 22, 2018
2276351
Delete THD master_worker (#10731)
ezyang Aug 22, 2018
fbd7189
add explicit flag to build static libtorch (#10754)
anderspapitto Aug 22, 2018
5fb9b31
Add matrix_rank (#10338)
vishwakftw Aug 22, 2018
b0ad810
Split storage from tensor (#10053)
jerryzh168 Aug 22, 2018
9767951
Remove regex matching from undefined_tensor_test, fixes #10013 (#10702)
jsrmath Aug 22, 2018
754ec9e
Reduce rocm link time with ThinLTO
bddppq Aug 22, 2018
0e30fa6
Faster random number generation in fused_rowwise_random_quantization_…
Aug 22, 2018
5ca2713
Fix performance of WeightedRandomSampler (#10636)
Chetter2 Aug 22, 2018
ce957ac
Merge remote-tracking branch 'upstream/master' into ifu
iotamudelta Aug 22, 2018
ee3e48d
Move Backend, Layout, ATenGeneral, Deprecated, Generator to ATen/core…
gchanan Aug 22, 2018
de11a5f
Resubmit #8322 with scipy version check
ssnl Aug 22, 2018
6fcac35
Erase ListConstruct nodes for ONNX export (#10713)
Aug 22, 2018
d40a598
Back out "[pytorch][PR] Create at::linear" (#10785)
Aug 22, 2018
6c84f7f
Relax RHS type assert for augassign (#10730)
zou3519 Aug 22, 2018
043a2e3
Removing setup_caffe2.py (#10734)
pjh5 Aug 22, 2018
f72e813
Allow tracing functions that take tuples of tensors as inputs (#10637)
apaszke Aug 22, 2018
011a1a2
Skip this test, fails on CI.
iotamudelta Aug 22, 2018
6c75fc0
Intergrating stochastic quantization to easgd to reduce communication…
Aug 23, 2018
44b47fd
Working pybind version of MPI process group and abort() pybind (#10606)
teng-li Aug 23, 2018
f0ec3bf
Changes for Python3 compatibility (#10524)
huitseeker Aug 23, 2018
4aa5075
update the constructor to accept the PredictorConfg only to set up th…
Aug 23, 2018
9a43fc5
move HeatmapMaxKeypointOp unittest to oss
wat3rBro Aug 23, 2018
5c0eece
Force types on values returned from if blocks to be equivalent (#10281)
Aug 23, 2018
b885dea
parallize the dense part in event models
xianjiec Aug 23, 2018
deda05e
Revert D9395814: move HeatmapMaxKeypointOp unittest to oss
ezyang Aug 23, 2018
78f0276
Merge branch 'master' into ifu
iotamudelta Aug 23, 2018
ac8c1eb
Merge remote-tracking branch 'upstream/master' into ifu
iotamudelta Aug 23, 2018
529fc68
Update docs with clean (#10819)
erikbrinkman Aug 23, 2018
fcfb1c1
Make more distributions jittable
fritzo Aug 23, 2018
0eb2c83
Fix link in THNN/README.md
narumiruna Aug 23, 2018
b14f2e8
Preserve sparse tensor shape and dim invariants, and add scalar tenso…
Aug 23, 2018
ab9e7ae
Add CUDA implementation of LARS --caffe2 (#10509)
lilinyy09 Aug 23, 2018
0f5c8ed
Removes unused THCState code paths (#9735)
mruberry Aug 23, 2018
23a366b
Use ATen native functions for THCTensor_cadd/cmul/cdiv/csub (#10707)
colesbury Aug 23, 2018
82ddeb7
Using shared implementation in Tensor (#10619)
ezyang Aug 23, 2018
432b3ad
Print blob sizes on fatal signal (#10766)
Aug 23, 2018
dec3ed7
Increase the limit for Proto size (#10745)
Aug 23, 2018
9dbcc9c
Move _raw_* intrusive pointer manipulations to raw_intrusive_ptr_targ…
ezyang Aug 23, 2018
3d43a82
Add support for vararg style functions. (#10250)
zdevito Aug 23, 2018
a4c59a9
MIOpen integration, more tests enabled, bug fixes (#10612)
iotamudelta Aug 23, 2018
053f055
Merge remote-tracking branch 'upstream/master' into ifu
iotamudelta Aug 23, 2018
9403e0c
Use ATen implementation of RNNs (#10761)
goldsborough Aug 23, 2018
ee022a4
Added this-consts to all methods on SymbolicVariable (#10805)
hakobyant Aug 23, 2018
61b34d4
nomnigraph - isSubgraphMatch returns the matched Subgraph & map from …
duc0 Aug 23, 2018
df2d48b
Added PrefixStore, pybind, test for group backward compatibility (#10…
teng-li Aug 24, 2018
2d40eab
Merge remote-tracking branch 'upstream/master' into ifu
iotamudelta Aug 24, 2018
e05e336
Merge remote-tracking branch 'rocm_upstream/master'
iotamudelta Aug 24, 2018
ac91777
Skip failing test.
iotamudelta Aug 24, 2018
8da4167
Fix performance regression (#10835)
Aug 24, 2018
a49d74a
Merge remote-tracking branch 'rocm_upstream/master' into ifu
iotamudelta Aug 24, 2018
d3fe294
Merge remote-tracking branch 'rocm_upstream/master'
iotamudelta Aug 24, 2018
974eb15
Merge branch 'master' into ifu
iotamudelta Aug 24, 2018
6993e4a
Caffe2 Functional enforcing inplace output (#10797)
xw285cornell Aug 24, 2018
ca56786
Support multidimensional indexing (#10787)
zou3519 Aug 24, 2018
e146518
Fix AT_CUDA_CHECK and AT_CUDNN_CHECK macros (#10834)
colesbury Aug 24, 2018
474bd60
Provide a tensor overload to mul_out_sparse_scalar. (#10828)
gchanan Aug 24, 2018
021f33b
Merge remote-tracking branch 'upstream/master' into ifu
iotamudelta Aug 24, 2018
8c13971
Remove protobuf require and use requirements.txt (#10771)
orionr Aug 24, 2018
3c9775f
Remove nanopb since we've switched to protobuf (#10772)
orionr Aug 24, 2018
e3d12d7
Automatic update of fbcode/onnx to 6146a85d371481222c10ede4430ad5476e…
houseroad Aug 24, 2018
313139d
Moving the operator argument to the front for kernelPointwiseApply. (…
Jorghi12 Aug 24, 2018
f1df85d
bug-fix in normal_( ) (#10846)
weiyangfb Aug 24, 2018
6e2f6dc
Move Allocator and Device to ATen/core
jerryzh168 Aug 24, 2018
8130b1a
Ignore stack frames coming from python3 object file (#10627)
apaszke Aug 24, 2018
8044dc4
Support new Reshape semantics (#10848)
Aug 24, 2018
104646e
Skip failing test.
iotamudelta Aug 24, 2018
5834fd9
Merge remote-tracking branch 'upstream/master' into ifu
iotamudelta Aug 24, 2018
474684c
Re-sync with internal repository (#10868)
yns88 Aug 24, 2018
f88ee77
Merge remote-tracking branch 'upstream/master' into ifu
iotamudelta Aug 24, 2018
74e6a66
If none of the schema match, add ImplicitTensorToNum conversions wher…
Aug 24, 2018
983e0f2
Remove Node::invalidateSchema (#10822)
apaszke Aug 24, 2018
0ef5cfd
fix ivalue printing for lists (#10777)
Aug 24, 2018
0d5584d
Revert D9492561: [pytorch][PR] Moving the operator argument to the fr…
ezyang Aug 24, 2018
87a7840
Remove Tensor constructor of Scalar. (#10852)
gchanan Aug 24, 2018
1fbabff
Refactor THCNumerics and add common math functions for at::Half (#10301)
syed-ahmed Aug 24, 2018
148ea2a
Create at::linear (#10799)
goldsborough Aug 24, 2018
c172ffb
Remove the nanopb submodule
orionr Aug 24, 2018
f2f6e6c
Add registry to pybind_state (#10759)
bwasti Aug 25, 2018
542aadd
Stop using symbolic override for tracing RNNs (#10638)
apaszke Aug 25, 2018
8253cfa
Conv BN fusion for 3D conv (#10239)
jspark1105 Aug 25, 2018
17dac3e
Create class constant for string literal 'blob_names'
Aug 25, 2018
d632ccd
Cache isContiguous and numel
cpuhrsch Aug 25, 2018
ddc37d7
Update mobile predictor caller's interface
Aug 25, 2018
9679fc5
Handling failing test on ROCm.
Jorghi12 Aug 26, 2018
c8b246a
Prevent JIT from overspecializing to every single size configuration …
apaszke Aug 26, 2018
5a43ef6
Merge remote-tracking branch 'upstream/master' into ifu
iotamudelta Aug 26, 2018
231f80a
Skip: new failure.
iotamudelta Aug 27, 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
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "third_party/catch"]
path = third_party/catch
url = https://github.com/catchorg/Catch2.git
[submodule "third_party/nanopb"]
path = third_party/nanopb
url = https://github.com/nanopb/nanopb.git
[submodule "third_party/pybind11"]
path = third_party/pybind11
url = https://github.com/pybind/pybind11.git
Expand Down
9 changes: 5 additions & 4 deletions .jenkins/caffe2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ elif [[ "${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


Expand Down Expand Up @@ -156,6 +152,11 @@ if [[ $BUILD_ENVIRONMENT == *rocm* ]]; then
export LC_ALL=C.UTF-8
export HCC_AMDGPU_TARGET=gfx900

# The link time of libcaffe2_hip.so takes 40 minutes, according to
# https://github.com/RadeonOpenCompute/hcc#thinlto-phase-1---implemented
# using using ThinLTO could significantly improve link-time performance.
export KMTHINLTO=1

########## HIPIFY Caffe2 operators
${PYTHON} "${ROOT_DIR}/tools/amd_build/build_pytorch_amd.py"
${PYTHON} "${ROOT_DIR}/tools/amd_build/build_caffe2_amd.py"
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ cmake_dependent_option(
USE_MKLML "Use MKLML interface in MKL BLAS" ON
"BUILD_CAFFE2" OFF)
option(USE_DISTRIBUTED "Use THD (distributed)" OFF)
option(USE_DISTRIBUTED_MW "Use THD (distributed) master worker" OFF)

# Used when building Caffe2 through setup.py
option(BUILDING_WITH_TORCH_LIBS "Tell cmake if Caffe2 is being built alongside torch libs" OFF)
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ information for the code in `torch/csrc`. More information at:
Python `setuptools` is pretty dumb, and always rebuilds every C file in a
project. If you install the ninja build system with `pip install ninja`,
then PyTorch will use it to track dependencies correctly.
If pytorch was already built, you will need to run `python setup.py clean` once
after installing ninja for builds to succeed.

#### Use CCache

Expand Down
4 changes: 4 additions & 0 deletions aten/doc/Functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ static inline Tensor & _standard_gamma_out(Tensor & output, const Tensor & self,
static inline Tensor _standard_gamma(const Tensor & self, Generator * generator=nullptr);
static inline Tensor & _dirichlet_grad_out(Tensor & output, const Tensor & x, const Tensor & alpha, const Tensor & total);
static inline Tensor _dirichlet_grad(const Tensor & x, const Tensor & alpha, const Tensor & total);
static inline Tensor sparse_coo_tensor(const Type& dtype, IntList size);
static inline Tensor sparse_coo_tensor(const Tensor & indices, const Tensor & values, IntList size);
static inline Tensor sparse_coo_tensor(const Tensor & indices, const Tensor & values);
static inline Tensor alias(const Tensor & self);
Expand Down Expand Up @@ -1764,6 +1765,9 @@ static inline Tensor & _dirichlet_grad_out(Tensor & output, const Tensor & x, co
static inline Tensor _dirichlet_grad(const Tensor & x, const Tensor & alpha, const Tensor & total) {
return infer_type(x)._dirichlet_grad(x, alpha, total);
}
static inline Tensor sparse_coo_tensor(const Type& dtype, IntList size) {
return dtype.sparse_coo_tensor(dtype, size);
}
static inline Tensor sparse_coo_tensor(const Tensor & indices, const Tensor & values, IntList size) {
return infer_type(values).sparse_coo_tensor(indices, values, size);
}
Expand Down
3 changes: 2 additions & 1 deletion aten/doc/Tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ struct Tensor : public detail::TensorBase {
Tensor & _copy_ignoring_overlaps_(const Tensor & src);
Tensor as_strided(IntList size, IntList stride, int64_t storage_offset=-1) const;
Tensor & as_strided_(IntList size, IntList stride, int64_t storage_offset=-1);
Tensor & sparse_raw_resize_(IntList size, int64_t nDimI, int64_t nDimV);
Tensor & sparse_resize_(IntList size, int64_t nDimI, int64_t nDimV);
Tensor & sparse_resize_and_clear_(IntList size, int64_t nDimI, int64_t nDimV);
Tensor & reshape_(IntList size, IntList stride);
Tensor _sparse_mask(SparseTensor mask) const;
Tensor to_dense() const;
Expand Down
4 changes: 3 additions & 1 deletion aten/doc/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,14 +656,16 @@ struct AT_API Type {
virtual Tensor tensor(IntList size) const;
virtual Tensor tensor(IntList size, IntList stride) const;
virtual Tensor tensor() const;
virtual Tensor sparse_coo_tensor(IntList size) const;
virtual Tensor sparse_coo_tensor(const Tensor & indices, const Tensor & values, IntList size) const;
virtual Tensor sparse_coo_tensor(const Tensor & indices, const Tensor & values) const;
virtual Tensor alias(const Tensor & self) const;
virtual Tensor & _copy_ignoring_overlaps_(Tensor & self, const Tensor & src) const;
virtual Tensor & as_strided_out(Tensor & result, const Tensor & self, IntList size, IntList stride, int64_t storage_offset=-1) const;
virtual Tensor as_strided(const Tensor & self, IntList size, IntList stride, int64_t storage_offset=-1) const;
virtual Tensor & as_strided_(Tensor & self, IntList size, IntList stride, int64_t storage_offset=-1) const;
virtual Tensor & sparse_raw_resize_(Tensor & self, IntList size, int64_t nDimI, int64_t nDimV) const;
virtual Tensor & sparse_resize_(Tensor & self, IntList size, int64_t nDimI, int64_t nDimV) const;
virtual Tensor & sparse_resize_and_clear_(Tensor & self, IntList size, int64_t nDimI, int64_t nDimV) const;
virtual Tensor & _cat_out(Tensor & self, TensorList tensors, int64_t dim=0) const;
virtual Tensor _cat(TensorList tensors, int64_t dim=0) const;
virtual Tensor & reshape_(Tensor & self, IntList size, IntList stride) const;
Expand Down
6 changes: 3 additions & 3 deletions aten/src/ATen/ATen.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "ATen/ATenGeneral.h"
#include "ATen/core/ATenGeneral.h"
#include "ATen/Allocator.h"
#include "ATen/CPUGeneral.h"
#include "ATen/CUDAGuard.h"
Expand All @@ -11,8 +11,8 @@
#include "ATen/Dispatch.h"
#include "ATen/Formatting.h"
#include "ATen/Functions.h"
#include "ATen/Generator.h"
#include "ATen/Layout.h"
#include "ATen/core/Generator.h"
#include "ATen/core/Layout.h"
#include "ATen/OptionsGuard.h"
#include "ATen/Scalar.h"
#include "ATen/Storage.h"
Expand Down
1 change: 0 additions & 1 deletion aten/src/ATen/ATenGeneral.cpp

This file was deleted.

14 changes: 0 additions & 14 deletions aten/src/ATen/Allocator.cpp

This file was deleted.

103 changes: 1 addition & 102 deletions aten/src/ATen/Allocator.h
Original file line number Diff line number Diff line change
@@ -1,103 +1,2 @@
#pragma once

#include <memory>
#include <stddef.h>

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

namespace at {

// A DataPtr is a unique pointer (with an attached deleter and some
// context for the deleter) to some memory, which also records what
// device is for its data.
//
// nullptr DataPtrs can still have a nontrivial device; this allows
// us to treat zero-size allocations uniformly with non-zero allocations.
//
class DataPtr {
private:
detail::UniqueVoidPtr ptr_;
Device device_;
public:
// Choice of CPU here is arbitrary; if there's an "undefined" device
// we could use that too
DataPtr() : ptr_(), device_(DeviceType::CPU) {}
DataPtr(void* data, Device device)
: ptr_(data), device_(device) {}
DataPtr(void* data, void* ctx, DeleterFnPtr ctx_deleter, Device device)
: ptr_(data, ctx, ctx_deleter), device_(device) {}
void* operator->() const { return ptr_.get(); }
void clear() {
ptr_.clear();
}
void* get() const { return ptr_.get(); }
void* get_context() const { return ptr_.get_context(); }
void* release_context() { return ptr_.release_context(); }
operator bool() const { return static_cast<bool>(ptr_); }
template <typename T>
T* cast_context(DeleterFnPtr expected_deleter) const {
return ptr_.cast_context<T>(expected_deleter);
}
Device device() const { return device_; }
};

// NB: Device is NOT tested for here; a CUDA nullptr is as much a nullptr as a
// CPU nullptr

inline bool operator==(const at::DataPtr& dp, std::nullptr_t) noexcept { return !dp; }
inline bool operator==(std::nullptr_t, const at::DataPtr& dp) noexcept { return !dp; }
inline bool operator!=(const at::DataPtr& dp, std::nullptr_t) noexcept { return dp; }
inline bool operator!=(std::nullptr_t, const at::DataPtr& dp) noexcept { return dp; }

// Note [raw_allocate/raw_deallocate and Thrust]
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Thrust's support for custom allocators requires us to write something
// like this:
//
// class ThrustAllocator {
// char* allocate(size_t);
// void deallocate(char*, size_t);
// };
//
// This is not good for our unique_ptr based allocator interface, as
// there is no way to get to the context when we free.
//
// However, in some cases the context is exactly the same as
// the data pointer. In this case, we can support the "raw"
// allocate and deallocate interface. This is what
// raw_deleter signifies. By default, it returns a nullptr, which means that
// the raw interface is not implemented. Be sure to implement it whenever
// possible, or the raw interface will incorrectly reported as unsupported,
// when it is actually possible.

struct Allocator {
virtual ~Allocator() {}
virtual at::DataPtr allocate(size_t n) const = 0;

// If this returns a non nullptr, it means that allocate()
// is guaranteed to return a unique_ptr with this deleter attached;
// it means the rawAllocate and rawDeallocate APIs are safe to use.
// This function MUST always return the same BoundDeleter.
virtual DeleterFnPtr raw_deleter() const { return nullptr; }
void* raw_allocate(size_t n) {
auto dptr = allocate(n);
AT_ASSERT(dptr.get() == dptr.get_context());
return dptr.release_context();
}
void raw_deallocate(void* ptr) {
auto d = raw_deleter();
AT_ASSERT(d);
d(ptr);
}
};

struct AT_API InefficientStdFunctionContext {
std::unique_ptr<void, std::function<void(void*)>> ptr_;
InefficientStdFunctionContext(std::unique_ptr<void, std::function<void(void*)>>&& ptr)
: ptr_(std::move(ptr)) {}
static at::DataPtr makeDataPtr(void* ptr, const std::function<void(void*)>& deleter, Device device);
};

} // namespace at
#include <ATen/core/Allocator.h>
Loading