Skip to content

[PyTorch] Introduce packed SizesAndStrides abstraction #47507

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 14 commits into from

Conversation

swolchok
Copy link
Contributor

@swolchok swolchok commented Nov 6, 2020

Stack from ghstack:

This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: D24762557

NOTE FOR REVIEWERS: This PR has internal Facebook specific changes or comments, please review them on Phabricator!

This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
@dr-ci
Copy link

dr-ci bot commented Nov 6, 2020

💊 CI failures summary and remediations

As of commit e3b0199 (more details on the Dr. CI page):


  • 1/1 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_xla_linux_bionic_py3_6_clang9_build (1/1)

Step: "Build" (full log | diagnosis details | 🔁 rerun)

Jan 04 22:45:38 torch_xla/csrc/tensor_impl.cpp:143:16: error: no member named 'push_back' in 'c10::ArrayRef'
Jan 04 22:45:38       strides_.push_back(stride);
Jan 04 22:45:38       ^~~~~~~~
Jan 04 22:45:38       strides
Jan 04 22:45:38 /var/lib/jenkins/workspace/c10/core/TensorImpl.h:387:23: note: 'strides' declared here
Jan 04 22:45:38   virtual IntArrayRef strides() const;
Jan 04 22:45:38                       ^
Jan 04 22:45:38 torch_xla/csrc/tensor_impl.cpp:143:7: error: reference to non-static member function must be called; did you mean to call it with no arguments?
Jan 04 22:45:38       strides_.push_back(stride);
Jan 04 22:45:38       ^~~~~~~~
Jan 04 22:45:38               ()
Jan 04 22:45:38 torch_xla/csrc/tensor_impl.cpp:143:16: error: no member named 'push_back' in 'c10::ArrayRef<long>'
Jan 04 22:45:38       strides_.push_back(stride);
Jan 04 22:45:38       ~~~~~~~~ ^
Jan 04 22:45:40 12 errors generated.
Jan 04 22:45:40 clang-9 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/var/lib/jenkins/workspace/xla -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-bin -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/var/lib/jenkins/workspace -I/var/lib/jenkins/workspace/torch/csrc -I/var/lib/jenkins/workspace/torch/lib/tmp_install/include -I/opt/conda/lib/python3.6/site-packages/torch/include -I/opt/conda/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/lib/python3.6/site-packages/torch/include/TH -I/opt/conda/lib/python3.6/site-packages/torch/include/THC -I/opt/conda/include/python3.6m -c torch_xla/csrc/python_util.cpp -o build/temp.linux-x86_64-3.6/torch_xla/csrc/python_util.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_clang" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1002" -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=1
Jan 04 22:45:41 clang-9 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/var/lib/jenkins/workspace/xla -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-bin -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/var/lib/jenkins/workspace -I/var/lib/jenkins/workspace/torch/csrc -I/var/lib/jenkins/workspace/torch/lib/tmp_install/include -I/opt/conda/lib/python3.6/site-packages/torch/include -I/opt/conda/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/lib/python3.6/site-packages/torch/include/TH -I/opt/conda/lib/python3.6/site-packages/torch/include/THC -I/opt/conda/include/python3.6m -c torch_xla/csrc/device.cpp -o build/temp.linux-x86_64-3.6/torch_xla/csrc/device.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_clang" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1002" -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=1
Jan 04 22:45:44 clang-9 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/var/lib/jenkins/workspace/xla -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-bin -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/var/lib/jenkins/workspace -I/var/lib/jenkins/workspace/torch/csrc -I/var/lib/jenkins/workspace/torch/lib/tmp_install/include -I/opt/conda/lib/python3.6/site-packages/torch/include -I/opt/conda/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/lib/python3.6/site-packages/torch/include/TH -I/opt/conda/lib/python3.6/site-packages/torch/include/THC -I/opt/conda/include/python3.6m -c torch_xla/csrc/init_python_bindings.cpp -o build/temp.linux-x86_64-3.6/torch_xla/csrc/init_python_bindings.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_clang" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1002" -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=1
Jan 04 22:45:47 clang-9 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/var/lib/jenkins/workspace/xla -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-bin -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/var/lib/jenkins/workspace -I/var/lib/jenkins/workspace/torch/csrc -I/var/lib/jenkins/workspace/torch/lib/tmp_install/include -I/opt/conda/lib/python3.6/site-packages/torch/include -I/opt/conda/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/lib/python3.6/site-packages/torch/include/TH -I/opt/conda/lib/python3.6/site-packages/torch/include/THC -I/opt/conda/include/python3.6m -c torch_xla/csrc/debug_util.cpp -o build/temp.linux-x86_64-3.6/torch_xla/csrc/debug_util.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_clang" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1002" -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=1
Jan 04 22:45:48 clang-9 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/var/lib/jenkins/workspace/xla -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-bin -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/var/lib/jenkins/workspace -I/var/lib/jenkins/workspace/torch/csrc -I/var/lib/jenkins/workspace/torch/lib/tmp_install/include -I/opt/conda/lib/python3.6/site-packages/torch/include -I/opt/conda/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/lib/python3.6/site-packages/torch/include/TH -I/opt/conda/lib/python3.6/site-packages/torch/include/THC -I/opt/conda/include/python3.6m -c torch_xla/csrc/aten_xla_type_default.cpp -o build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_xla_type_default.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_clang" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1002" -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=1
Jan 04 22:46:01 clang-9 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/var/lib/jenkins/workspace/xla -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-bin -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/var/lib/jenkins/workspace -I/var/lib/jenkins/workspace/torch/csrc -I/var/lib/jenkins/workspace/torch/lib/tmp_install/include -I/opt/conda/lib/python3.6/site-packages/torch/include -I/opt/conda/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/lib/python3.6/site-packages/torch/include/TH -I/opt/conda/lib/python3.6/site-packages/torch/include/THC -I/opt/conda/include/python3.6m -c torch_xla/csrc/batch_norm.cpp -o build/temp.linux-x86_64-3.6/torch_xla/csrc/batch_norm.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_clang" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1002" -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=1
Jan 04 22:46:09 clang-9 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/var/lib/jenkins/workspace/xla -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-bin -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/var/lib/jenkins/workspace -I/var/lib/jenkins/workspace/torch/csrc -I/var/lib/jenkins/workspace/torch/lib/tmp_install/include -I/opt/conda/lib/python3.6/site-packages/torch/include -I/opt/conda/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/lib/python3.6/site-packages/torch/include/TH -I/opt/conda/lib/python3.6/site-packages/torch/include/THC -I/opt/conda/include/python3.6m -c torch_xla/csrc/layout_manager.cpp -o build/temp.linux-x86_64-3.6/torch_xla/csrc/layout_manager.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_clang" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1002" -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=1

XLA failure

Job pytorch_xla_linux_bionic_py3_6_clang9_build is failing. Please create an issue with title prefixed by [PT_BREAK] in pytorch/xla and link to to this PR. If you have questions, please reach out to @ailzhang / @dlibenzi / @JackCaoG.

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

This comment has been revised 117 times.

@ezyang ezyang self-requested a review November 6, 2020 22:16
…ked SizesAndStrides abstraction"

This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
for (int64_t dim = 0; dim < public_dims; dim++) {
auto actual_dim = actualDim(dim, /*wrap_dim=*/false);
sizes_.push_back(value_sizes.at(actual_dim));
sizes_and_strides_.size_at_unchecked(dim) = value_sizes.at(actual_dim);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zou3519 Previously, this code did not initialize strides at all. Is it the case that BatchedTensor doesn't have valid strides at all?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, BatchedTensor doesn't have valid strides until #47621 goes in.

}
refresh_numel();
}

int64_t BatchedTensorImpl::actualDim(int64_t dim, bool wrap_dim) const {
if (wrap_dim) {
const auto ndim = sizes_.size();
const auto ndim = sizes_and_strides_.size();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No action needed here: UGHH this should have been a call to dim() but that's virtual so it is a pessimization over this version reeeee

@@ -84,7 +85,7 @@ struct CAFFE2_API OpaqueTensorImpl : public TensorImpl {
const c10::VariableVersion& version_counter,
bool allow_tensor_metadata_change) const override {
auto impl = c10::make_intrusive<OpaqueTensorImpl<OpaqueHandle>>(
key_set(), dtype(), device(), opaque_handle_, sizes_);
key_set(), dtype(), device(), opaque_handle_, IntArrayRef{sizes_and_strides_.sizes_data(), sizes_and_strides_.size()});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably would be handy if there was a way to directly get at a sizes IntArrayRef, instead of having to construct it by hand here.

@@ -126,7 +127,8 @@ struct CAFFE2_API SparseTensorImpl : public TensorImpl {
"shrinking the size of dense dimensions (from ", dense_size_original, " to ", dense_size_new, ") on a non-empty sparse tensor is not supported.\n", alt_options_msg);
}

if ((!size.equals(sizes_)) || (sparse_dim != sparse_dim_) || (dense_dim != dense_dim_)) {
const bool size_equals_sizes = size.size() == sizes_and_strides_.size() && memcmp(size.data(), sizes_and_strides_.sizes_data(), sizes_and_strides_.size() * sizeof(*size.data())) == 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely there is some helper method we could add here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::equal? :)

@@ -56,7 +56,8 @@ struct CAFFE2_API SparseTensorImpl : public TensorImpl {
// respect to indices and values
void raw_resize_(int64_t sparse_dim, int64_t dense_dim, IntArrayRef size) {
TORCH_CHECK(allow_tensor_metadata_change(), "raw_resize_ ", err_msg_tensor_metadata_change_not_allowed);
sizes_ = size.vec();
sizes_and_strides_.resize(size.size());
std::copy(size.begin(), size.end(), sizes_and_strides_.sizes_begin());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably also vote for a helper method for abstracting over std::copy calls

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding set_sizes, but it feels a little dangerous to me to cover up a resize like that.

if (sizes_[d] != 1) {
if (strides_[d] == z) {
z *= sizes_[d];
const auto size_d = sizes_and_strides_.size_at_unchecked(d);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blegh, size(d) here should have been OK but it's also virtual sighhh

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I'd probably err on the side of more helper methods than less, and commented a few places.

@ezyang ezyang requested review from smessmer and bhosmer November 10, 2020 19:43
@ezyang
Copy link
Contributor

ezyang commented Nov 10, 2020

The open source ASAN failure looks pretty sus, and may be related to how we handle empty sizes/strides. Hopefully you can repro it in fbcode; the oss ASAN repro process is pretty involved (unfortunately...)

Nov 09 20:17:52   test_expand_scalar_to_dims_complex_cpu (__main__.TestAutogradDeviceTypeCPU) ... =================================================================
Nov 09 20:17:52 ==363==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x609002380c10 at pc 0x7fae8cd55640 bp 0x7ffc6187e390 sp 0x7ffc6187e388
Nov 09 20:17:52 READ of size 8 at 0x609002380c10 thread T0
Nov 09 20:17:53     #0 0x7fae8cd5563f in std::_Tuple_impl<0ul, double, double>::_Tuple_impl<double&, double&, void>(double&, double&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xbd3563f)
Nov 09 20:17:53     #1 0x7fae9654dc04 in void at::native::(anonymous namespace)::basic_loop<at::native::(anonymous namespace)::eq_kernel(at::TensorIterator&)::$_34::operator()() const::{lambda()#3}::operator()() const::{lambda(double, double)#1}>(char* restrict*, long const*, long, long, at::native::(anonymous namespace)::eq_kernel(at::TensorIterator&)::$_34::operator()() const::{lambda()#3}::operator()() const::{lambda(double, double)#1}&&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0x1552dc04)
Nov 09 20:17:53     #2 0x7fae8d75227e in void c10::function_ref<void (char**, long const*, long, long)>::callback_fn<at::TensorIterator::for_each(c10::function_ref<void (char**, long const*, long)>, long)::$_5>(long, char**, long const*, long, long) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xc73227e)
Nov 09 20:17:53     #3 0x7fae8d740bc0 in at::TensorIterator::serial_for_each(c10::function_ref<void (char**, long const*, long, long)>, at::Range) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xc720bc0)
Nov 09 20:17:53     #4 0x7fae8d73fd5a in at::TensorIterator::for_each(c10::function_ref<void (char**, long const*, long, long)>, long) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xc71fd5a)
Nov 09 20:17:53     #5 0x7fae8d73faf3 in at::TensorIterator::for_each(c10::function_ref<void (char**, long const*, long)>, long) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xc71faf3)
Nov 09 20:17:53     #6 0x7fae96540716 in at::native::(anonymous namespace)::eq_kernel(at::TensorIterator&)::$_34::operator()() const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0x15520716)
Nov 09 20:17:53     #7 0x7fae9653fb1c in at::native::(anonymous namespace)::eq_kernel(at::TensorIterator&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0x1551fb1c)
Nov 09 20:17:53     #8 0x7fae8d031b90 in void at::native::DispatchStub<void (*)(at::TensorIterator&), at::native::eq_stub>::operator()<at::TensorIterator&>(c10::DeviceType, at::TensorIterator&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xc011b90)
Nov 09 20:17:53     #9 0x7fae8d01b728 in at::Tensor& at::native::comparison_op_out<at::native::eq_stub>(at::Tensor&, at::Tensor const&, at::Tensor const&, at::native::eq_stub&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xbffb728)
Nov 09 20:17:53     #10 0x7fae8d00295f in at::native::eq_out(at::Tensor&, at::Tensor const&, at::Tensor const&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xbfe295f)
Nov 09 20:17:53     #11 0x7fae8dc2fda8 in at::CPUType::eq_out_Tensor_out(at::Tensor&, at::Tensor const&, at::Tensor const&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xcc0fda8)
Nov 09 20:17:53     #12 0x7fae8dce38c2 in c10::impl::detail::WrapFunctionIntoRuntimeFunctor_<at::Tensor& (*)(at::Tensor&, at::Tensor const&, at::Tensor const&), at::Tensor&, c10::guts::typelist::typelist<at::Tensor&, at::Tensor const&, at::Tensor const&> >::operator()(at::Tensor&, at::Tensor const&, at::Tensor const&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xccc38c2)
Nov 09 20:17:53     #13 0x7fae8dce370f in c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoRuntimeFunctor_<at::Tensor& (*)(at::Tensor&, at::Tensor const&, at::Tensor const&), at::Tensor&, c10::guts::typelist::typelist<at::Tensor&, at::Tensor const&, at::Tensor const&> >, at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&)>::call(c10::OperatorKernel*, at::Tensor&, at::Tensor const&, at::Tensor const&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xccc370f)
Nov 09 20:17:53     #14 0x7fae8e1485f6 in at::Tensor& c10::KernelFunction::call<at::Tensor&, at::Tensor&, at::Tensor const&, at::Tensor const&>(c10::OperatorHandle const&, at::Tensor&, at::Tensor const&, at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd1285f6)
Nov 09 20:17:53     #15 0x7fae8e14798f in at::Tensor& c10::Dispatcher::callWithDispatchKey<at::Tensor&, at::Tensor&, at::Tensor const&, at::Tensor const&>(c10::TypedOperatorHandle<at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&)> const&, c10::DispatchKey, at::Tensor&, at::Tensor const&, at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd12798f)
Nov 09 20:17:53     #16 0x7fae8e14758a in at::Tensor& c10::Dispatcher::call<at::Tensor&, at::Tensor&, at::Tensor const&, at::Tensor const&>(c10::TypedOperatorHandle<at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&)> const&, at::Tensor&, at::Tensor const&, at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd12758a)
Nov 09 20:17:53     #17 0x7fae8e06e473 in c10::TypedOperatorHandle<at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&)>::call(at::Tensor&, at::Tensor const&, at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd04e473)
Nov 09 20:17:53     #18 0x7fae8e007ce2 in at::eq_out(at::Tensor&, at::Tensor const&, at::Tensor const&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xcfe7ce2)
Nov 09 20:17:53     #19 0x7fae8d019c32 in at::Tensor at::native::comparison_op<at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&)>(at::Tensor const&, at::Tensor const&, at::Tensor& (&)(at::Tensor&, at::Tensor const&, at::Tensor const&)) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xbff9c32)
Nov 09 20:17:53     #20 0x7fae8d002a0a in at::native::eq(at::Tensor const&, at::Tensor const&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xbfe2a0a)
Nov 09 20:17:53     #21 0x7fae8dddf9a4 in c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, at::Tensor const&), &at::CPUType::eq_Tensor>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, at::Tensor const&> >::operator()(at::Tensor const&, at::Tensor const&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xcdbf9a4)
Nov 09 20:17:53     #22 0x7fae8dddf169 in c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, at::Tensor const&), &at::CPUType::eq_Tensor>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, at::Tensor const&> >, at::Tensor (at::Tensor const&, at::Tensor const&)>::call(c10::OperatorKernel*, at::Tensor const&, at::Tensor const&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xcdbf169)
Nov 09 20:17:53     #23 0x7fae8e0e697c in at::Tensor c10::KernelFunction::call<at::Tensor, at::Tensor const&, at::Tensor const&>(c10::OperatorHandle const&, at::Tensor const&, at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd0c697c)
Nov 09 20:17:53     #24 0x7fae8e0e6075 in at::Tensor c10::Dispatcher::callWithDispatchKey<at::Tensor, at::Tensor const&, at::Tensor const&>(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&)> const&, c10::DispatchKey, at::Tensor const&, at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd0c6075)
Nov 09 20:17:53     #25 0x7fae8e0e5ccd in at::Tensor c10::Dispatcher::call<at::Tensor, at::Tensor const&, at::Tensor const&>(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&)> const&, at::Tensor const&, at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd0c5ccd)
Nov 09 20:17:53     #26 0x7fae8e0685cd in c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&)>::call(at::Tensor const&, at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd0485cd)
Nov 09 20:17:53     #27 0x7fae8e007f3c in at::eq(at::Tensor const&, at::Tensor const&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xcfe7f3c)
Nov 09 20:17:53     #28 0x7fae92e90f5d in torch::autograd::VariableType::(anonymous namespace)::eq_Tensor(at::Tensor const&, at::Tensor const&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0x11e70f5d)
Nov 09 20:17:53     #29 0x7fae92e90db4 in c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, at::Tensor const&), &torch::autograd::VariableType::(anonymous namespace)::eq_Tensor>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, at::Tensor const&> >::operator()(at::Tensor const&, at::Tensor const&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0x11e70db4)
Nov 09 20:17:53     #30 0x7fae92e90ca9 in c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, at::Tensor const&), &torch::autograd::VariableType::(anonymous namespace)::eq_Tensor>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, at::Tensor const&> >, at::Tensor (at::Tensor const&, at::Tensor const&)>::call(c10::OperatorKernel*, at::Tensor const&, at::Tensor const&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0x11e70ca9)
Nov 09 20:17:53     #31 0x7fae8e0e697c in at::Tensor c10::KernelFunction::call<at::Tensor, at::Tensor const&, at::Tensor const&>(c10::OperatorHandle const&, at::Tensor const&, at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd0c697c)
Nov 09 20:17:53     #32 0x7fae8e0e6075 in at::Tensor c10::Dispatcher::callWithDispatchKey<at::Tensor, at::Tensor const&, at::Tensor const&>(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&)> const&, c10::DispatchKey, at::Tensor const&, at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd0c6075)
Nov 09 20:17:53     #33 0x7fae8e0e5ccd in at::Tensor c10::Dispatcher::call<at::Tensor, at::Tensor const&, at::Tensor const&>(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&)> const&, at::Tensor const&, at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd0c5ccd)
Nov 09 20:17:53     #34 0x7fae8e0685cd in c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&)>::call(at::Tensor const&, at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd0485cd)
Nov 09 20:17:53     #35 0x7fae8ebb31de in at::Tensor::eq(at::Tensor const&) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xdb931de)
Nov 09 20:17:53     #36 0x7fae8cf25e80 in at::native::isclose(at::Tensor const&, at::Tensor const&, double, double, bool) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xbf05e80)
Nov 09 20:17:53     #37 0x7fae8e6a4bc2 in at::TypeDefault::isclose(at::Tensor const&, at::Tensor const&, double, double, bool) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd684bc2)
Nov 09 20:17:53     #38 0x7fae8e899398 in c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, at::Tensor const&, double, double, bool), &at::TypeDefault::isclose>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, at::Tensor const&, double, double, bool> >::operator()(at::Tensor const&, at::Tensor const&, double, double, bool) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd879398)
Nov 09 20:17:53     #39 0x7fae8e8989f1 in c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, at::Tensor const&, double, double, bool), &at::TypeDefault::isclose>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, at::Tensor const&, double, double, bool> >, at::Tensor (at::Tensor const&, at::Tensor const&, double, double, bool)>::call(c10::OperatorKernel*, at::Tensor const&, at::Tensor const&, double, double, bool) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd8789f1)
Nov 09 20:17:53     #40 0x7fae8e241c05 in at::Tensor c10::callUnboxedKernelFunction<at::Tensor, at::Tensor const&, at::Tensor const&, double, double, bool>(void*, c10::OperatorKernel*, at::Tensor const&, at::Tensor const&, double&&, double&&, bool&&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd221c05)
Nov 09 20:17:53     #41 0x7fae8e241973 in at::Tensor c10::KernelFunction::call<at::Tensor, at::Tensor const&, at::Tensor const&, double, double, bool>(c10::OperatorHandle const&, at::Tensor const&, at::Tensor const&, double, double, bool) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd221973)
Nov 09 20:17:53     #42 0x7fae8e240ced in at::Tensor c10::Dispatcher::callWithDispatchKey<at::Tensor, at::Tensor const&, at::Tensor const&, double, double, bool>(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&, double, double, bool)> const&, c10::DispatchKey, at::Tensor const&, at::Tensor const&, double, double, bool) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd220ced)
Nov 09 20:17:53     #43 0x7fae8e24095d in at::Tensor c10::Dispatcher::call<at::Tensor, at::Tensor const&, at::Tensor const&, double, double, bool>(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&, double, double, bool)> const&, at::Tensor const&, at::Tensor const&, double, double, bool) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd22095d)
Nov 09 20:17:53     #44 0x7fae8e07ef08 in c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, at::Tensor const&, double, double, bool)>::call(at::Tensor const&, at::Tensor const&, double, double, bool) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd05ef08)
Nov 09 20:17:53     #45 0x7fae8dfa3b68 in at::isclose(at::Tensor const&, at::Tensor const&, double, double, bool) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xcf83b68)
Nov 09 20:17:53     #46 0x7fae8cf25a2c in at::native::allclose(at::Tensor const&, at::Tensor const&, double, double, bool) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xbf05a2c)
Nov 09 20:17:53     #47 0x7fae8e68e54d in at::TypeDefault::allclose(at::Tensor const&, at::Tensor const&, double, double, bool) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd66e54d)
Nov 09 20:17:53     #48 0x7fae8e111687 in bool c10::KernelFunction::call<bool, at::Tensor const&, at::Tensor const&, double, double, bool>(c10::OperatorHandle const&, at::Tensor const&, at::Tensor const&, double, double, bool) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd0f1687)
Nov 09 20:17:53     #49 0x7fae8e1105e8 in bool c10::Dispatcher::callWithDispatchKey<bool, at::Tensor const&, at::Tensor const&, double, double, bool>(c10::TypedOperatorHandle<bool (at::Tensor const&, at::Tensor const&, double, double, bool)> const&, c10::DispatchKey, at::Tensor const&, at::Tensor const&, double, double, bool) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd0f05e8)
Nov 09 20:17:53     #50 0x7fae8e1100f0 in bool c10::Dispatcher::call<bool, at::Tensor const&, at::Tensor const&, double, double, bool>(c10::TypedOperatorHandle<bool (at::Tensor const&, at::Tensor const&, double, double, bool)> const&, at::Tensor const&, at::Tensor const&, double, double, bool) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xd0f00f0)
Nov 09 20:17:53     #51 0x7fae8eb6a0de in at::Tensor::allclose(at::Tensor const&, double, double, bool) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xdb4a0de)
Nov 09 20:17:53     #52 0x7faeac4135dd in torch::autograd::THPVariable_allclose(_object*, _object*, _object*) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_python.so+0x20675dd)
Nov 09 20:17:53     #53 0x55af73aada13 in _PyCFunction_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Objects/methodobject.c:231
Nov 09 20:17:53     #54 0x55af73ada52f in _PyCFunction_FastCallKeywords /tmp/build/80754af9/python_1599604603603/work/Objects/methodobject.c:294
Nov 09 20:17:53     #55 0x55af73b35a5b in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4851
Nov 09 20:17:53     #56 0x55af73b59018 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3351
Nov 09 20:17:53     #57 0x55af73b2f2cd in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #58 0x55af73b2fe50 in fast_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4992
Nov 09 20:17:53     #59 0x55af73b35b34 in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4872
Nov 09 20:17:53     #60 0x55af73b59018 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3351
Nov 09 20:17:53     #61 0x55af73b2f2cd in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #62 0x55af73b2fe50 in fast_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4992
Nov 09 20:17:53     #63 0x55af73b35b34 in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4872
Nov 09 20:17:53     #64 0x55af73b59018 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3351
Nov 09 20:17:53     #65 0x55af73b2f4b0 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #66 0x55af73b2fe50 in fast_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4992
Nov 09 20:17:53     #67 0x55af73b35b34 in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4872
Nov 09 20:17:53     #68 0x55af73b59018 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3351
Nov 09 20:17:53     #69 0x55af73b2f165 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #70 0x55af73b2fe50 in fast_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4992
Nov 09 20:17:53     #71 0x55af73b35b34 in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4872
Nov 09 20:17:53     #72 0x55af73b58259 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3335
Nov 09 20:17:53     #73 0x55af73b2f2cd in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #74 0x55af73b2fe50 in fast_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4992
Nov 09 20:17:53     #75 0x55af73b35b34 in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4872
Nov 09 20:17:53     #76 0x55af73b58259 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3335
Nov 09 20:17:53     #77 0x55af73b30d07 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #78 0x55af73b30d07 in PyEval_EvalCodeEx /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4187
Nov 09 20:17:53     #79 0x55af73b31895 in function_call /tmp/build/80754af9/python_1599604603603/work/Objects/funcobject.c:604
Nov 09 20:17:53     #80 0x55af73aad81d in PyObject_Call /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2261
Nov 09 20:17:53     #81 0x55af73b598ba in do_call_core /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:5120
Nov 09 20:17:53     #82 0x55af73b598ba in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3404
Nov 09 20:17:53     #83 0x55af73b30fa5 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #84 0x55af73b30fa5 in PyEval_EvalCodeEx /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4187
Nov 09 20:17:53     #85 0x55af73b31783 in function_call /tmp/build/80754af9/python_1599604603603/work/Objects/funcobject.c:604
Nov 09 20:17:53     #86 0x55af73aad81d in PyObject_Call /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2261
Nov 09 20:17:53     #87 0x55af73b598ba in do_call_core /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:5120
Nov 09 20:17:53     #88 0x55af73b598ba in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3404
Nov 09 20:17:53     #89 0x55af73b2f2cd in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #90 0x55af73b2fe50 in fast_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4992
Nov 09 20:17:53     #91 0x55af73b35b34 in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4872
Nov 09 20:17:53     #92 0x55af73b58259 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3335
Nov 09 20:17:53     #93 0x55af73b2efd3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #94 0x55af73b30549 in _PyFunction_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:5084
Nov 09 20:17:53     #95 0x55af73aaddde in _PyObject_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2310
Nov 09 20:17:53     #96 0x55af73ab2872 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2373
Nov 09 20:17:53     #97 0x55af73aad81d in PyObject_Call /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2261
Nov 09 20:17:53     #98 0x55af73b598ba in do_call_core /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:5120
Nov 09 20:17:53     #99 0x55af73b598ba in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3404
Nov 09 20:17:53     #100 0x55af73b2efd3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #101 0x55af73b3032b in _PyFunction_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:5084
Nov 09 20:17:53     #102 0x55af73aaddde in _PyObject_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2310
Nov 09 20:17:53     #103 0x55af73ab2872 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2373
Nov 09 20:17:53     #104 0x55af73aad81d in PyObject_Call /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2261
Nov 09 20:17:53     #105 0x55af73b07210 in slot_tp_call /tmp/build/80754af9/python_1599604603603/work/Objects/typeobject.c:6207
Nov 09 20:17:53     #106 0x55af73aadbfa in _PyObject_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2331
Nov 09 20:17:53     #107 0x55af73b35bad in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4875
Nov 09 20:17:53     #108 0x55af73b58259 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3335
Nov 09 20:17:53     #109 0x55af73b2efd3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #110 0x55af73b30549 in _PyFunction_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:5084
Nov 09 20:17:53     #111 0x55af73aaddde in _PyObject_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2310
Nov 09 20:17:53     #112 0x55af73ab2872 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2373
Nov 09 20:17:53     #113 0x55af73aad81d in PyObject_Call /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2261
Nov 09 20:17:53     #114 0x55af73b598ba in do_call_core /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:5120
Nov 09 20:17:53     #115 0x55af73b598ba in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3404
Nov 09 20:17:53     #116 0x55af73b2efd3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #117 0x55af73b3032b in _PyFunction_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:5084
Nov 09 20:17:53     #118 0x55af73aaddde in _PyObject_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2310
Nov 09 20:17:53     #119 0x55af73ab2872 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2373
Nov 09 20:17:53     #120 0x55af73aad81d in PyObject_Call /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2261
Nov 09 20:17:53     #121 0x55af73b07210 in slot_tp_call /tmp/build/80754af9/python_1599604603603/work/Objects/typeobject.c:6207
Nov 09 20:17:53     #122 0x55af73aadbfa in _PyObject_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2331
Nov 09 20:17:53     #123 0x55af73b35bad in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4875
Nov 09 20:17:53     #124 0x55af73b58259 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3335
Nov 09 20:17:53     #125 0x55af73b2fc1a in _PyFunction_FastCall /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4933
Nov 09 20:17:53     #126 0x55af73b2fc1a in fast_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4968
Nov 09 20:17:53     #127 0x55af73b35b34 in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4872
Nov 09 20:17:53     #128 0x55af73b58259 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3335
Nov 09 20:17:53     #129 0x55af73b2fc1a in _PyFunction_FastCall /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4933
Nov 09 20:17:53     #130 0x55af73b2fc1a in fast_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4968
Nov 09 20:17:53     #131 0x55af73b35b34 in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4872
Nov 09 20:17:53     #132 0x55af73b58259 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3335
Nov 09 20:17:53     #133 0x55af73b2f4b0 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #134 0x55af73b30549 in _PyFunction_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:5084
Nov 09 20:17:53     #135 0x55af73aaddde in _PyObject_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2310
Nov 09 20:17:53     #136 0x55af73ab2872 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2373
Nov 09 20:17:53     #137 0x55af73aad81d in PyObject_Call /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2261
Nov 09 20:17:53     #138 0x55af73b0688a in slot_tp_init /tmp/build/80754af9/python_1599604603603/work/Objects/typeobject.c:6420
Nov 09 20:17:53     #139 0x55af73b35d96 in type_call /tmp/build/80754af9/python_1599604603603/work/Objects/typeobject.c:915
Nov 09 20:17:53     #140 0x55af73aadbfa in _PyObject_FastCallDict /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2331
Nov 09 20:17:53     #141 0x55af73b30139 in _PyObject_FastCallKeywords /tmp/build/80754af9/python_1599604603603/work/Objects/abstract.c:2496
Nov 09 20:17:53     #142 0x55af73b35bad in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4875
Nov 09 20:17:53     #143 0x55af73b59018 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3351
Nov 09 20:17:53     #144 0x55af73adbf7a in _PyFunction_FastCall /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4933
Nov 09 20:17:53     #145 0x55af73b35b34 in call_function /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4872
Nov 09 20:17:53     #146 0x55af73b58259 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:3335
Nov 09 20:17:53     #147 0x55af73b30968 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4166
Nov 09 20:17:53     #148 0x55af73b30968 in PyEval_EvalCodeEx /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:4187
Nov 09 20:17:53     #149 0x55af73b3170b in PyEval_EvalCode /tmp/build/80754af9/python_1599604603603/work/Python/ceval.c:731
Nov 09 20:17:53     #150 0x55af73bb1573 in run_mod /tmp/build/80754af9/python_1599604603603/work/Python/pythonrun.c:1025
Nov 09 20:17:53     #151 0x55af73bb1970 in PyRun_FileExFlags /tmp/build/80754af9/python_1599604603603/work/Python/pythonrun.c:978
Nov 09 20:17:53     #152 0x55af73bb1b72 in PyRun_SimpleFileExFlags /tmp/build/80754af9/python_1599604603603/work/Python/pythonrun.c:419
Nov 09 20:17:53     #153 0x55af73bb5662 in run_file /tmp/build/80754af9/python_1599604603603/work/Modules/main.c:340
Nov 09 20:17:53     #154 0x55af73bb5662 in Py_Main /tmp/build/80754af9/python_1599604603603/work/Modules/main.c:811
Nov 09 20:17:53     #155 0x55af73a7f43d in main /tmp/build/80754af9/python_1599604603603/work/Programs/python.c:69
Nov 09 20:17:54     #156 0x7faeb478883f in __libc_start_main /build/glibc-e6zv40/glibc-2.23/csu/../csu/libc-start.c:291
Nov 09 20:17:54     #157 0x55af73b5ed0a in _start /home/rdonnelly/mc/conda-bld/compilers_linux-64_1534865402226/work/.build/src/glibc-2.12.2/csu/../sysdeps/x86_64/elf/start.S:103
Nov 09 20:17:54 
Nov 09 20:17:54 0x609002380c10 is located 0 bytes to the right of 16-byte region [0x609002380c00,0x609002380c10)
Nov 09 20:17:54 allocated by thread T0 here:
Nov 09 20:17:54     #0 0x7faeb4e57ad0 in __interceptor_posix_memalign (/usr/lib/llvm-5.0/lib/clang/5.0.0/lib/linux/libclang_rt.asan-x86_64.so+0x108ad0)
Nov 09 20:17:54     #1 0x7fae80c9c8a7 in c10::alloc_cpu(unsigned long) (/opt/conda/lib/python3.6/site-packages/torch/lib/libc10.so+0x11c8a7)
Nov 09 20:17:54     #2 0x7fae80ca8ada in c10::DefaultCPUAllocator::allocate(unsigned long) const (/opt/conda/lib/python3.6/site-packages/torch/lib/libc10.so+0x128ada)
Nov 09 20:17:54     #3 0x7fae8c95c0f1 in c10::StorageImpl::StorageImpl(c10::StorageImpl::use_byte_size_t, unsigned long, c10::Allocator*, bool) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xb93c0f1)
Nov 09 20:17:54     #4 0x7fae8ec6016b in c10::intrusive_ptr<c10::StorageImpl, c10::detail::intrusive_target_default_null_type<c10::StorageImpl> > c10::intrusive_ptr<c10::StorageImpl, c10::detail::intrusive_target_default_null_type<c10::StorageImpl> >::make<c10::StorageImpl::use_byte_size_t, unsigned long, c10::Allocator*, bool>(c10::StorageImpl::use_byte_size_t&&, unsigned long&&, c10::Allocator*&&, bool&&) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xdc4016b)
Nov 09 20:17:54     #5 0x7faeacb92eb8 in THPComplexDoubleStorage_pynew(_typeobject*, _object*, _object*) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_python.so+0x27e6eb8)
Nov 09 20:17:54     #6 0x55af73b35d44 in type_call /tmp/build/80754af9/python_1599604603603/work/Objects/typeobject.c:895
Nov 09 20:17:54 
Nov 09 20:17:54 SUMMARY: AddressSanitizer: heap-buffer-overflow (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so+0xbd3563f) in std::_Tuple_impl<0ul, double, double>::_Tuple_impl<double&, double&, void>(double&, double&)
Nov 09 20:17:54 Shadow bytes around the buggy address:
Nov 09 20:17:54   0x0c1280468130: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Nov 09 20:17:54   0x0c1280468140: fa fa fa fa fa fa fa fa fd fd fa fa fa fa fa fa
Nov 09 20:17:54   0x0c1280468150: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Nov 09 20:17:54   0x0c1280468160: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Nov 09 20:17:54   0x0c1280468170: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Nov 09 20:17:54 =>0x0c1280468180: 00 00[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa
Nov 09 20:17:54   0x0c1280468190: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Nov 09 20:17:54   0x0c12804681a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Nov 09 20:17:54   0x0c12804681b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Nov 09 20:17:54   0x0c12804681c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Nov 09 20:17:54   0x0c12804681d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Nov 09 20:17:54 Shadow byte legend (one shadow byte represents 8 application bytes):
Nov 09 20:17:54   Addressable:           00
Nov 09 20:17:54   Partially addressable: 01 02 03 04 05 06 07 
Nov 09 20:17:54   Heap left redzone:       fa
Nov 09 20:17:54   Freed heap region:       fd
Nov 09 20:17:54   Stack left redzone:      f1
Nov 09 20:17:54   Stack mid redzone:       f2
Nov 09 20:17:54   Stack right redzone:     f3
Nov 09 20:17:54   Stack after return:      f5
Nov 09 20:17:54   Stack use after scope:   f8
Nov 09 20:17:54   Global redzone:          f9
Nov 09 20:17:54   Global init order:       f6
Nov 09 20:17:54   Poisoned by user:        f7
Nov 09 20:17:54   Container overflow:      fc
Nov 09 20:17:54   Array cookie:            ac
Nov 09 20:17:54   Intra object redzone:    bb
Nov 09 20:17:54   ASan internal:           fe
Nov 09 20:17:54   Left alloca redzone:     ca
Nov 09 20:17:54   Right alloca redzone:    cb
Nov 09 20:17:54 ==363==ABORTING

@robieta
Copy link

robieta commented Nov 10, 2020

I patched this stack onto #47428 and ran the following A/B comparison:

from torch.utils.benchmark import Timer

def main():
    setup = "torch::Tensor x = torch::ones({4, 5});"
    stmts = (
        "x.sizes()[0];",
        "x.stride(0);"
    )

    counts, times = [], []
    for stmt in ("x.sizes()[0];", "x.stride(0);"):
        timer = Timer(stmt, setup, language="C++")
        counts.append(timer.collect_callgrind(number=10_000))
        print(counts[-1], "\n")
        times.append(timer.blocked_autorange(min_run_time=60))
        print(times[-1], "\n")

    # In case you want to slice and dice.
    import pdb
    pdb.set_trace()


if __name__ == "__main__":
    main()
Baseline
<torch.utils.benchmark.utils.valgrind_wrapper.timer_interface.CallgrindStats object at 0x7ff1b76bbdd8>
x.sizes()[0];
setup: torch::Tensor x = torch::ones({4, 5});
                           All          Noisy symbols removed
    Instructions:       110014                     110014
    Baseline:                0                          0
10000 runs per measurement, 1 thread

<torch.utils.benchmark.utils.common.Measurement object at 0x7ff1b76bb0b8>
x.sizes()[0];
setup: torch::Tensor x = torch::ones({4, 5});
  Median: 1.84 ns
  IQR:    0.07 ns (1.80 to 1.87)
  326 measurements, 100000000 runs per measurement, 1 thread

<torch.utils.benchmark.utils.valgrind_wrapper.timer_interface.CallgrindStats object at 0x7ff1b76bb240>
x.stride(0);
setup: torch::Tensor x = torch::ones({4, 5});
                           All          Noisy symbols removed
    Instructions:      3740014                    3740014
    Baseline:                0                          0
10000 runs per measurement, 1 thread

<torch.utils.benchmark.utils.common.Measurement object at 0x7ff1b76bb400>
x.stride(0);
setup: torch::Tensor x = torch::ones({4, 5});
  Median: 77.66 ns
  IQR:    2.91 ns (76.13 to 79.04)
  772 measurements, 1000000 runs per measurement, 1 thread
#47507 & #47508
<torch.utils.benchmark.utils.valgrind_wrapper.timer_interface.CallgrindStats object at 0x7f5955554470>
x.sizes()[0];
setup: torch::Tensor x = torch::ones({4, 5});
                           All          Noisy symbols removed
    Instructions:       120014                     120014
    Baseline:                0                          0
10000 runs per measurement, 1 thread

<torch.utils.benchmark.utils.common.Measurement object at 0x7f59555544e0>
x.sizes()[0];
setup: torch::Tensor x = torch::ones({4, 5});
  Median: 2.19 ns
  IQR:    0.08 ns (2.15 to 2.23)
  275 measurements, 100000000 runs per measurement, 1 thread

<torch.utils.benchmark.utils.valgrind_wrapper.timer_interface.CallgrindStats object at 0x7f59555540b8>
x.stride(0);
setup: torch::Tensor x = torch::ones({4, 5});
                           All          Noisy symbols removed
    Instructions:      3760014                    3760014
    Baseline:                0                          0
10000 runs per measurement, 1 thread

<torch.utils.benchmark.utils.common.Measurement object at 0x7f59555543c8>
x.stride(0);
setup: torch::Tensor x = torch::ones({4, 5});
  Median: 77.77 ns
  IQR:    3.88 ns (75.39 to 79.27)
  770 measurements, 1000000 runs per measurement, 1 thread

I deliberately chose one with the "good" (fast) way to get metadata and one with the "bad" (slow) way. (As an aside, we should bridge that gap.) As you can see, this stack adds an instruction or two (presumably because we now have to unpack?) and 0.1-0.35 ns. Not the end of the world, but I'm not sure if it makes sense to take on the complexity if it won't help perf. Though of course this is a microbenchmark, and shrinking TensorImpl will have positives which are not captured here.

…ed SizesAndStrides abstraction"

This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Nov 10, 2020
Pull Request resolved: #47507

This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.
ghstack-source-id: 116352504

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!
This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Nov 17, 2020
Pull Request resolved: #47507

This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.
ghstack-source-id: 116928200

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!
This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
…ce packed SizesAndStrides abstraction"

This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
…ides abstraction"

This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
…] Introduce packed SizesAndStrides abstraction"

This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.

Differential Revision: [D24762557](https://our.internmc.facebook.com/intern/diff/D24762557/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D24762557/)!

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 882ddb2.

@facebook-github-bot facebook-github-bot deleted the gh/swolchok/9/head branch January 11, 2021 15:17
hwangdeyu pushed a commit to hwangdeyu/pytorch that referenced this pull request Jan 14, 2021
Summary:
Pull Request resolved: pytorch#47507

This introduces a new SizesAndStrides class as a helper for
TensorImpl, in preparation for changing its representation.
ghstack-source-id: 119313559

Test Plan:
Added new automated tests as well.

Run framework overhead benchmarks. Results seem to be neutral-ish.

Reviewed By: ezyang

Differential Revision: D24762557

fbshipit-source-id: 6cc0ede52d0a126549fb51eecef92af41c3e1a98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants