mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-08-18 21:58:28 +00:00
Compare commits
1
Commits
more_pcode
...
split_sub
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
061a17ee4d |
@@ -1925,7 +1925,6 @@ class TestSchedule(unittest.TestCase):
|
|||||||
run_schedule(check_schedule(loss, 4))
|
run_schedule(check_schedule(loss, 4))
|
||||||
np.testing.assert_allclose(loss.item(), 0.878309, atol=1e-5, rtol=1e-6)
|
np.testing.assert_allclose(loss.item(), 0.878309, atol=1e-5, rtol=1e-6)
|
||||||
|
|
||||||
@expect_rangeify_fails
|
|
||||||
def test_const_folding_alt(self):
|
def test_const_folding_alt(self):
|
||||||
t = Tensor.full((2,), 1.)
|
t = Tensor.full((2,), 1.)
|
||||||
lt = (t < 0.)
|
lt = (t < 0.)
|
||||||
|
|||||||
@@ -749,7 +749,9 @@ def get_rangeify_map(sink:UOp) -> dict[UOp, UOp]:
|
|||||||
tsink = graph_rewrite(tsink, pm_rangeify, ctx=(rangeify_ctx:=RangeifyContext()), bottom_up=True, name="rangeify")
|
tsink = graph_rewrite(tsink, pm_rangeify, ctx=(rangeify_ctx:=RangeifyContext()), bottom_up=True, name="rangeify")
|
||||||
# NOTE: sym (vs symbolic_simple) breaks things here because ranges with len 1 aren't handled right
|
# NOTE: sym (vs symbolic_simple) breaks things here because ranges with len 1 aren't handled right
|
||||||
tsink = graph_rewrite(tsink, symbolic_simple+pm_reduce_unparented, name="symbolic") # this supports const folding
|
tsink = graph_rewrite(tsink, symbolic_simple+pm_reduce_unparented, name="symbolic") # this supports const folding
|
||||||
tsink = graph_rewrite(tsink, pm_cleanups+pm_substitute_recurse, bottom_up=True, name="remove costly buffers")
|
tsink = graph_rewrite(tsink, pm_cleanups, bottom_up=True, name="remove costly buffers")
|
||||||
|
# TODO: can you substitute and remove costly buffers at the same time?
|
||||||
|
tsink = graph_rewrite(tsink, pm_substitute_recurse, bottom_up=True, name="run substitutes")
|
||||||
tsink = graph_rewrite(tsink, pm_limit_bufs, ctx=rangeify_ctx, name="limit buffers")
|
tsink = graph_rewrite(tsink, pm_limit_bufs, ctx=rangeify_ctx, name="limit buffers")
|
||||||
|
|
||||||
# rebuild the sink with all the BUFFERIZEs with tags, this is what's ending up in the tensor graph
|
# rebuild the sink with all the BUFFERIZEs with tags, this is what's ending up in the tensor graph
|
||||||
|
|||||||
Reference in New Issue
Block a user