mirror of
https://jihulab.com/mr-one/openpilot.git
synced 2026-10-27 21:13:42 +08:00
f8e13417f2
date: 2026-08-15T14:20:10 master commit: d48cfa730bf21593b684efeaf3fd8940695e1dea
16 lines
525 B
Python
16 lines
525 B
Python
from tinygrad import Tensor, Device, TinyJit, dtypes
|
|
|
|
GPUS = Device[Device.DEFAULT].count()
|
|
N = 6144
|
|
|
|
@TinyJit
|
|
def many_matmul(A, B):
|
|
out = A
|
|
for _ in range(8): out = out@B
|
|
return out
|
|
|
|
if __name__ == "__main__":
|
|
A = Tensor.ones(GPUS, N, N, dtype=dtypes.half).shard(devices=tuple([f"{Device.DEFAULT}:{i}" for i in range(GPUS)]), axis=0).contiguous()
|
|
B = Tensor.ones(GPUS, N, N, dtype=dtypes.half).shard(devices=tuple([f"{Device.DEFAULT}:{i}" for i in range(GPUS)]), axis=0).contiguous()
|
|
while 1: many_matmul(A, B)
|