Files
tinygrad/extra/gemm/simple_matmul.py
George Hotz 90fff82c8a Rdna (#776)
* assembler maybe

* custom asm

* rdna3 on quiet

* trigger crashes

* fixed notes

* non-fatal rdna2 crash

* Crash4

* improve rdna sniffer

* comments

* improve sniffer

* asm

* 131 TFLOPS RDNA3

* opt simple matmul

* todos
2023-05-16 05:33:57 -07:00

6 lines
213 B
Python

from tinygrad.tensor import Tensor
N = 1024
a, b = Tensor.randn(N, N), Tensor.randn(N, N)
c = (a.reshape(N, 1, N) * b.permute(1,0).reshape(1, N, N)).sum(axis=2)
print((c.numpy() - (a.numpy() @ b.numpy())).mean())