8000 Merge branch 'master' into develop/opinfo/repeat-tile · pytorch/pytorch@f7171b7 · GitHub
[go: up one dir, main page]

Ski 8000 p to content

Commit f7171b7

Browse files
committed
Merge branch 'master' into develop/opinfo/repeat-tile
2 parents 1973767 + 3f052ba commit f7171b7

File tree

88 files changed

+1120
-413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1120
-413
lines changed

.circleci/scripts/binary_linux_test.sh

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,27 @@ fi
3939
# conda build scripts themselves. These should really be consolidated
4040
pkg="/final_pkgs/\$(ls /final_pkgs)"
4141
if [[ "$PACKAGE_TYPE" == conda ]]; then
42-
conda install \${EXTRA_CONDA_FLAGS} -y "\$pkg" --offline
43-
if [[ "$DESIRED_CUDA" == 'cpu' ]]; then
44-
retry conda install \${EXTRA_CONDA_FLAGS} -y cpuonly -c pytorch
45-
fi
46-
retry conda install \${EXTRA_CONDA_FLAGS} -yq future numpy protobuf six
47-
if [[ "$DESIRED_CUDA" != 'cpu' ]]; then
48-
# DESIRED_CUDA is in format cu90 or cu102
49-
if [[ "${#DESIRED_CUDA}" == 4 ]]; then
50-
cu_ver="${DESIRED_CUDA:2:1}.${DESIRED_CUDA:3}"
51-
else
52-
cu_ver="${DESIRED_CUDA:2:2}.${DESIRED_CUDA:4}"
42+
(
43+
# For some reason conda likes to re-activate the conda environment when attempting this install
44+
# which means that a deactivate is run and some variables might not exist when that happens,
45+
# namely CONDA_MKL_INTERFACE_LAYER_BACKUP from libblas so let's just ignore unbound variables when
46+
# it comes to the conda installation commands
47+
set +u
48+
conda install \${EXTRA_CONDA_FLAGS} -y "\$pkg" --offline
49+
if [[ "$DESIRED_CUDA" == 'cpu' ]]; then
50+
retry conda install \${EXTRA_CONDA_FLAGS} -y cpuonly -c pytorch
5351
fi
54-
(
55-
# For some reason conda likes to re-activate the conda environment when attempting this install
56-
# which means that a deactivate is run and some variables might not exist when that happens,
57-
# namely CONDA_MKL_INTERFACE_LAYER_BACKUP from libblas so let's just ignore unbound variables when
58-
# it comes to the conda installation commands
59-
set +u
52+
retry conda install \${EXTRA_CONDA_FLAGS} -yq future numpy protobuf six
53+
if [[ "$DESIRED_CUDA" != 'cpu' ]]; then
54+
# DESIRED_CUDA is in format cu90 or cu102
55+
if [[ "${#DESIRED_CUDA}" == 4 ]]; then
56+
cu_ver="${DESIRED_CUDA:2:1}.${DESIRED_CUDA:3}"
57+
else
58+
cu_ver="${DESIRED_CUDA:2:2}.${DESIRED_CUDA:4}"
59+
fi
6060
retry conda install \${EXTRA_CONDA_FLAGS} -yq -c nvidia -c pytorch "cudatoolkit=\${cu_ver}"
61-
)
62-
fi
61+
fi
62+
)
6363
elif [[ "$PACKAGE_TYPE" != libtorch ]]; then
6464
pip install "\$pkg"
6565
retry pip install -q future numpy protobuf six

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,16 @@ endif()
3030

3131
set(CMAKE_INSTALL_MESSAGE NEVER)
3232

33+
# check and set CMAKE_CXX_STANDARD
34+
string(FIND "${CMAKE_CXX_FLAGS}" "-std=c++" env_cxx_standard)
35+
if(env_cxx_standard GREATER -1)
36+
message(
37+
WARNING "C++ standard version definition detected in environment variable."
38+
"PyTorch requires -std=c++14. Please remove -std=c++ settings in your environment.")
39+
endif()
3340
set(CMAKE_CXX_STANDARD 14)
3441
set(CMAKE_C_STANDARD 11)
42+
3543
if(DEFINED GLIBCXX_USE_CXX11_ABI)
3644
if(${GLIBCXX_USE_CXX11_ABI} EQUAL 1)
3745
set(CXX_STANDARD_REQUIRED ON)

aten/src/ATen/LegacyTHFunctionsCUDA.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Tensor & _th_put_(Tensor & self, const Tensor & index, const Tensor & source, bo
2929
Tensor & _th_index_fill_(Tensor & self, int64_t dim, const Tensor & index, Scalar value);
3030
std::tuple<Tensor &,Tensor &> _th_mode_out(Tensor & values, Tensor & indices, const Tensor & self, int64_t dim, bool keepdim);
3131
std::tuple<Tensor,Tensor> _th_mode(const Tensor & self, int64_t dim, bool keepdim);
32-
std::tuple<Tensor &,Tensor &> _th_sort_out(Tensor & values, Tensor & indices, const Tensor & self, int64_t dim, bool descending);
33-
std::tuple<Tensor,Tensor> _th_sort(const Tensor & self, int64_t dim, bool descending);
32+
std::tuple<Tensor &,Tensor &> _th_sort_out(Tensor & values, Tensor & indices, const Tensor & self, int64_t dim, bool descending, bool stable);
33+
std::tuple<Tensor,Tensor> _th_sort(const Tensor & self, int64_t dim, bool descending, bool stable);
3434
std::tuple<Tensor &,Tensor &> _th_topk_out(Tensor & values, Tensor & indices, const Tensor & self, int64_t k, int64_t dim, bool largest, bool sorted);
3535
std::tuple<Tensor,Tensor> _th_topk(const Tensor & self, int64_t k, int64_t dim, bool largest, bool sorted);
3636
Tensor & _th_renorm_out(Tensor & result, const Tensor & self, Scalar p, int64_t dim, Scalar maxnorm);

aten/src/ATen/core/builtin_function.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#pragma once
22

3-
#include <ATen/core/dispatch/Dispatcher.h>
43
#include <ATen/core/function.h>
4+
#include <ATen/core/ivalue.h>
5+
#include <c10/util/Exception.h>
6+
#include <c10/util/intrusive_ptr.h>
7+
#include <functional>
8+
#include <utility>
59

610
namespace torch {
711
namespace jit {

aten/src/ATen/core/interned_strings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ namespace c10 {
103103
_(prim, Guard) \
104104
_(prim, BailOut) \
105105
_(prim, TypeCheck) \
106+
_(prim, RequiresGradCheck) \
106107
_(prim, FallbackGraph) \
107108
_(prim, FusedConcat) \
108109
_(prim, ConstantChunk) \

aten/src/ATen/core/op_registration/op_registration.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <c10/macros/Macros.h>
22

3+
#include <ATen/core/dispatch/Dispatcher.h>
34
#include <ATen/core/op_registration/op_registration.h>
45
#if !defined(CAFFE2_IS_XPLAT_BUILD)
56
#include <torch/csrc/jit/frontend/function_schema_parser.h>

aten/src/ATen/core/op_registration/op_registration.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
7< D40E code>7

88
#include <c10/core/DispatchKey.h>
99
#include <c10/core/CompileTimeFunctionPointer.h>
10-
#include <ATen/core/dispatch/Dispatcher.h>
10+
#include <ATen/core/boxing/KernelFunction.h>
11+
#include <ATen/core/dispatch/CppSignature.h>
12+
#include <ATen/core/dispatch/RegistrationHandleRAII.h>
1113
#include <ATen/core/op_registration/infer_schema.h>
1214
#if defined(EXPOSE_C2_OPS) || !defined(CAFFE2_IS_XPLAT_BUILD)
1315
#include <torch/csrc/jit/frontend/function_schema_parser.h>

aten/src/ATen/cuda/LegacyTHFunctionsCUDA.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,10 +698,12 @@ std::tuple<Tensor,Tensor> _th_mode(const Tensor & self, int64_t dim, bool keepdi
698698
}
699699
return std::tuple<Tensor, Tensor>(values, indices);
700700
}
701-
std::tuple<Tensor &,Tensor &> _th_sort_out(Tensor & values, Tensor & indices, const Tensor & self, int64_t dim, bool descending) {
701+
std::tuple<Tensor &,Tensor &> _th_sort_out(Tensor & values, Tensor & indices, const Tensor & self, int64_t dim, bool descending, bool stable) {
702702
// DeviceGuard omitted
703703
auto dispatch_scalar_type = infer_scalar_type(self);
704704

705+
TORCH_CHECK(!stable, "stable=True is not implemented on CUDA yet.");
706+
705707
switch (dispatch_scalar_type) {
706708
case ScalarType::Byte: {
707709
auto values_ = checked_dense_tensor_unwrap(values, "values", 0, "_th_sort_out", false, DeviceType::CUDA, dispatch_scalar_type);
@@ -764,8 +766,11 @@ std::tuple<Tensor &,Tensor &> _th_sort_out(Tensor & values, Tensor & indices, co
764766
}
765767
return std::tuple<Tensor &, Tensor &>(values, indices);
766768
}
767-
std::tuple<Tensor,Tensor> _th_sort(const Tensor & self, int64_t dim, bool descending) {
769+
std::tuple<Tensor,Tensor> _th_sort(const Tensor & self, int64_t dim, bool descending, bool stable) {
768770
// DeviceGuard omitted
771+
772+
TORCH_CHECK(!stable, "stable=True is not implemented on CUDA yet.");
773+
769774
auto dispatch_scalar_type = infer_scalar_type(self);
770775
auto values_ = c10::make_intrusive<TensorImpl, UndefinedTensorImpl>(c10::Storage(c10::Storage::use_byte_size_t(), 0, allocator(), true),DispatchKey::CUDA, scalarTypeToTypeMeta(dispatch_scalar_type)).release();
771776
auto values = Tensor(c10::intrusive_ptr<TensorImpl, UndefinedTensorImpl>::reclaim(values_));

aten/src/ATen/native/BinaryOps.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -826,16 +826,12 @@ Tensor logical_xor(const Tensor& self, Scalar other) { return comparison_op(self
826826
Tensor& logical_xor_(Tensor& self, Scalar other) { return comparison_op_(self, other, static_cast<OutFunc>(at::logical_xor_out)); }
827827

828828
Tensor& maximum_out(Tensor& result, const Tensor& self, const Tensor& other) {
829-
TORCH_CHECK(!self.is_complex() && !other.is_complex(), "maximum does not support complex inputs.");
830-
831829
auto iter = TensorIterator::binary_op(result, self, other);
832830
maximum_stub(iter.device_type(), iter);
833831
return result;
834832
}
835833

836834
Tensor maximum(const Tensor& self, const Tensor& other) {
837-
TORCH_CHECK(!self.is_complex() && !other.is_complex(), "maximum does not support complex inputs.");
838-
839835
Tensor result;
840836
auto iter = TensorIterator::binary_op(result, self, other);
841837
maximum_stub(iter.device_type(), iter);
@@ -852,16 +848,12 @@ Tensor max(const Tensor& self, const Tensor& other) {
852848
}
853849

854850
Tensor& minimum_out(Tensor& result, const Tensor& self, const Tensor& other) {
855-
TORCH_CHECK(!self.is_complex() && !other.is_complex(), "minimum does not support complex inputs.");
856-
857851
auto iter = TensorIterator::binary_op(result, self, other);
858852
minimum_stub(iter.device_type(), iter);
859853
return result;
860854
}
861855

862856
Tensor minimum(const Tensor& self, const Tensor& other) {
863-
TORCH_CHECK(!self.is_complex() && !other.is_complex(), "minimum does not support complex inputs.");
864-
865857
Tensor result;
866858
auto iter = TensorIterator::binary_op(result, self, other);
867859
minimum_stub(iter.device_type(), iter);

aten/src/ATen/native/CompositeRandomAccessorCommon.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ class CompositeRandomAccessor {
122122
using difference_type = typename std::iterator_traits<KeyAccessor>::difference_type;
123123
using iterator_category = std::random_access_iterator_tag;
124124

125+
C10_HOST_DEVICE
126+
CompositeRandomAccessor() = default;
127+
125128
C10_HOST_DEVICE
126129
CompositeRandomAccessor(KeyAccessor keys, ValueAccessor values)
127130
: keys(keys), values(values)

0 commit comments

Comments
 (0)
0