heat icon indicating copy to clipboard operation
heat copied to clipboard

`matmul()` on small DNDarrays

Open mtar opened this issue 3 years ago • 3 comments

Description A clear and concise description of the bug and the associated functionality.

matmul on two small DNDarrays can lead too wrong results or errors.

To Reproduce Steps to reproduce the behavior:

  1. Which module/class/function is affected? matmul
  2. What are the circumstances under which the bug appears? operands have same split axis
  3. What is the exact error message / erroneous behavior? wrong result

Expected behavior A clear and concise description of what you expected to happen. correct result

Illustrative If applicable, add screenshots or minimal examples to help explain your problem.

Example on 3 processes:

>>> E = ht.array([[5.,-3,2],[-3,2,-1],[-3,2,-2]],dtype=ht.float64, split=0)
>>> I = ht.eye(3,dtype=ht.float64, split=0)
>>> E@I
DNDarray([[ 5.,  5.,  5.],
          [-3., -3., -3.],
          [-3., -3., -3.]], dtype=ht.float64, device=cpu:0, split=0)


>>> E = ht.array([[5.,-3,2],[-3,2,-1],[-3,2,-2]],dtype=ht.float64, split=1)
>>>I = ht.eye(3,dtype=ht.float64, split=1)
>>> E@I
DNDarray([[ 4.,  0.,  0.],
          [-2.,  0.,  0.],
          [-3.,  0.,  0.]], dtype=ht.float64, device=cpu:0, split=1)

Version Info Which version are you using? master 9db0a93

Additional comments Any other comments here. When both DNDarrays have different splits (0/1, 1/0) the correct result is returned.

mtar avatar Sep 23 '21 11:09 mtar