sunnypilot v2026.002.000
version: sunnypilot v2026.002.000 (staging) date: 2026-07-21T07:44:02 master commit: 2c334ede443d7391d27575af8c854a095ba702a8
This commit is contained in:
commit
de77c89cf6
3995 files changed
+1260688
No files matched your search
@@ -0,0 +1,17 @@
|
||||
from tinygrad import Tensor, TinyJit, Device
|
||||
import numpy as np
|
||||
|
||||
GPUS = 4
|
||||
N = 128
|
||||
ds = tuple([Device.canonicalize(f"{Device.DEFAULT}:{i}") for i in range(GPUS)])
|
||||
t = Tensor.rand(N, N, N).shard(ds, 0)
|
||||
n = t.numpy()
|
||||
|
||||
@TinyJit
|
||||
def allreduce(t:Tensor) -> Tensor:
|
||||
return t.sum(0) #.realize()
|
||||
|
||||
for i in range(10):
|
||||
print(i)
|
||||
tn = allreduce(t).numpy()
|
||||
np.testing.assert_allclose(tn, n.sum(0), atol=1e-4, rtol=1e-4)
|
||||
Reference in new issue
Block a user