Fix exponential behavior in lazyops (#2890)

* add cache to ast_parse and lazyop builder

* add caches
This commit is contained in:
George Hotz
2023-12-20 22:06:50 -08:00
committed by GitHub
parent 8c4a0f8e15
commit 41b2a25be6
3 changed files with 16 additions and 9 deletions

View File

@@ -27,7 +27,7 @@ class TestFusionOp(unittest.TestCase):
def test_recursive_add(self):
st = time.perf_counter()
a = Tensor([1,2,3,4])
for _ in range(12): a = a + a
for _ in range(20): a = a + a
sched = create_schedule([a.lazydata], None)
ji = lower_schedule_item(sched[-1])
et = time.perf_counter()