mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
create_schedule([x.lazydata]) -> x.schedule() in tests (#8449)
This commit is contained in:
3
test/external/external_test_hcq.py
vendored
3
test/external/external_test_hcq.py
vendored
@@ -2,7 +2,6 @@ import unittest, ctypes, struct, time, array
|
||||
from tinygrad import Device, Tensor, dtypes
|
||||
from tinygrad.helpers import to_mv, CI
|
||||
from tinygrad.device import Buffer, BufferSpec
|
||||
from tinygrad.engine.schedule import create_schedule
|
||||
from tinygrad.engine.realize import get_runner
|
||||
|
||||
def _time_queue(q, d):
|
||||
@@ -21,7 +20,7 @@ class TestHCQ(unittest.TestCase):
|
||||
#TestHCQ.d1: AMDDevice = Device["AMD:1"]
|
||||
TestHCQ.a = Tensor([0.,1.], device=Device.DEFAULT).realize()
|
||||
TestHCQ.b = self.a + 1
|
||||
si = create_schedule([self.b.lazydata])[-1]
|
||||
si = self.b.schedule()[-1]
|
||||
TestHCQ.runner = get_runner(TestHCQ.d0.device, si.ast)
|
||||
TestHCQ.b.lazydata.buffer.allocate()
|
||||
# wow that's a lot of abstraction layers
|
||||
|
||||
4
test/external/external_test_nv.py
vendored
4
test/external/external_test_nv.py
vendored
@@ -1,7 +1,6 @@
|
||||
import unittest, struct, array, ctypes
|
||||
from tinygrad import Device, dtypes, Tensor
|
||||
from tinygrad.helpers import to_mv
|
||||
from tinygrad.engine.schedule import create_schedule
|
||||
from tinygrad.runtime.ops_nv import NVDevice, HWQueue
|
||||
from tinygrad.engine.search import Opt, OptOps
|
||||
from test.test_linearizer_failures import helper_test_lin
|
||||
@@ -20,7 +19,7 @@ class TestNV(unittest.TestCase):
|
||||
TestNV.d0: NVDevice = Device["NV"]
|
||||
TestNV.a = Tensor([0.,1.], device="NV").realize()
|
||||
TestNV.b = self.a + 1
|
||||
si = create_schedule([self.b.lazydata])[-1]
|
||||
si = self.b.schedule()[-1]
|
||||
TestNV.d0_runner = get_runner(TestNV.d0.device, si.ast)
|
||||
TestNV.b.lazydata.buffer.allocate()
|
||||
TestNV.addr = struct.pack("QQ", TestNV.b.lazydata.buffer._buf.va_addr, TestNV.a.lazydata.buffer._buf.va_addr)
|
||||
@@ -65,4 +64,3 @@ class TestNV(unittest.TestCase):
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
|
||||
3
test/external/fuzz_graph.py
vendored
3
test/external/fuzz_graph.py
vendored
@@ -4,7 +4,6 @@ from tinygrad.device import Buffer, Device
|
||||
from tinygrad.helpers import Context, getenv, from_mv
|
||||
from tinygrad.dtype import dtypes
|
||||
from tinygrad.tensor import Tensor, _to_np_dtype
|
||||
from tinygrad.engine.schedule import create_schedule
|
||||
from tinygrad.engine.realize import ExecItem, BufferXfer, get_runner
|
||||
from tinygrad.engine.jit import apply_graph_to_jit
|
||||
|
||||
@@ -19,7 +18,7 @@ def gen_prg(device, inputs_cnt):
|
||||
s = fst[0]
|
||||
for i in range(1, inputs_cnt): s = s.xor(fst[i])
|
||||
|
||||
si = create_schedule([s.lazydata])[-1]
|
||||
si = s.schedule()[-1]
|
||||
prg = get_runner(device, si.ast)
|
||||
cached_prgs[(device, inputs_cnt)] = prg
|
||||
return prg
|
||||
|
||||
Reference in New Issue
Block a user