bcast/allreduce refuse to process with rank-1 size-1 tensor with non one stride.
See original GitHub issueIn pytorch, torch.tensor([1.+2.j]).real.contiguous().stride()
returns (2,)
instead of (1,)
, but the data in memory is contiguous indeed because of its size is only one. while bcast/allreduce of mpi4py raise an error saying it is not contiguous because of stride mismatch.
also see: https://github.com/pytorch/pytorch/issues/82610, they say it is contiguous already so nothing more should be done.
Issue Analytics
- State:
- Created a year ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
RuntimeError: view size is not compatible with input tensor's ...
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(....
Read more >What does .contiguous() do in PyTorch? - Stack Overflow
There are a few operations on Tensors in PyTorch that do not change the contents of a tensor, but change the way the...
Read more >Introduction to Tensors | TensorFlow Core
First, create some basic tensors. Here is a "scalar" or "rank-0" tensor . A scalar contains a single value, and no "axes". #...
Read more >Eigen Tensors - Eigen-unsupported
A TensorMap is not resizable because it does not own the memory where its data are stored. Constructor TensorMap<Tensor<data_type, rank>>(data, size0, size1, .....
Read more >torch.Tensor.view — PyTorch 1.13 documentation
For a tensor to be viewed, the new view size must be compatible with its original size and stride, i.e., each new view...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed via 9ccf55fb0a0218d3fcc5eb7292ed14117d781852.
It seems the stride value of the same index should be ignored if
any of element in shape = 1
, not onlyproduct(shape) = 1