tinygrad: Segmentation Fault when running with HSA

Running the following with a fresh conda environment with python 3.11. CPU 3970X Threadripper. GPU 7900 XTX. Ubuntu 22.04.1 .

DEBUG=3 python3 -c "from tinygrad import Tensor;
N = 1024; a, b = Tensor.rand(N, N), Tensor.rand(N, N);
c = (a.reshape(N, 1, N) * b.T.reshape(1, N, N)).sum(axis=2);
print((c.numpy() - (a.numpy() @ b.numpy())).mean())"

Results in.

opening device METAL from pid:9140
opening device HSA from pid:9140
opening device NPY from pid:9140
scheduled 4 kernels
*** HSA   rand  seed 1713494129 size 1048576         dtype dtypes.float
*** HSA   rand  seed 1713494130 size 1048576         dtype dtypes.float
  0 ━┳ STORE MemBuffer(idx=0, dtype=dtypes.float, st=ShapeTracker(views=(View(shape=(1024, 1024, 1), strides=(1024, 1, 0), offset=0, mask=None, contiguous=True),)))
  1  ┗━┳ SUM ((2,), dtypes.float)
  2    ┗━┳ MUL 
  3      ┣━━ LOAD MemBuffer(idx=1, dtype=dtypes.float, st=ShapeTracker(views=(View(shape=(1024, 1024, 1024), strides=(1024, 0, 1), offset=0, mask=None, contiguous=False),)))
  4      ┗━━ LOAD MemBuffer(idx=2, dtype=dtypes.float, st=ShapeTracker(views=(View(shape=(1024, 1024, 1024), strides=(0, 1, 1024), offset=0, mask=None, contiguous=False),)))
Segmentation fault (core dumped)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18

Most upvoted comments

Using version 0.8.0 using pip, works.