move optimize_local_size (#2221)

* move optimize_local_size

* interpret_ast
This commit is contained in:
George Hotz
2023-11-05 21:00:52 -08:00
committed by GitHub
parent c60c3b467a
commit 2f7aab3d13
16 changed files with 67 additions and 76 deletions

View File

@@ -2,8 +2,7 @@
import unittest
import numpy as np
from tinygrad.tensor import Tensor
from tinygrad.ops import GlobalCounters, Device
from tinygrad.graph import nm
from tinygrad.ops import Device
from tinygrad.helpers import dtypes
N = 200 # has to be bigger than the cache to fail
@@ -50,16 +49,6 @@ class TestAssign(unittest.TestCase):
ba2 = a.lazydata.realized
# NOTE: don't test that it's assigned
#assert ba1 == ba2 and ba1 != bb1
"""
if len(GlobalCounters.cache):
runner, args = GlobalCounters.cache[0]
b0, b1, b2 = args
print(nm(b0), id(b0.cl))
print(nm(b1), id(b1.cl))
print(nm(b2), id(b2.cl))
"""
np.testing.assert_allclose(a.numpy(), np.arange(N*N).reshape((N,N)) + np.arange(N*N).reshape((N,N)).transpose(1,0))
# TODO: is there a way to sneak in a permute such that it returns the wrong answer?