mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
delete unused View lt support (2) (#8451)
* delete lt on view (2) * the scheduler uses symbolic_simple
This commit is contained in:
parent
803a47494e
commit
c7ec0ab674
2 changed files with 2 additions and 8 deletions
|
|
@ -13,7 +13,7 @@ from tinygrad.device import is_dtype_supported
|
|||
from tinygrad.dtype import DType, ImageDType
|
||||
from tinygrad.shape.shapetracker import ShapeTracker
|
||||
from tinygrad.shape.view import View
|
||||
from tinygrad.ops import PatternMatcher, UOp, Ops, UPat, graph_rewrite, track_rewrites, view_supported_devices, symbolic
|
||||
from tinygrad.ops import PatternMatcher, UOp, Ops, UPat, graph_rewrite, track_rewrites, view_supported_devices, symbolic_simple
|
||||
from tinygrad.helpers import CI, DEBUG, FUSE_ARANGE, GlobalCounters, getenv, SPLIT_REDUCEOP, unwrap, prod, Context
|
||||
from tinygrad.codegen.kernel import Kernel, verify_ast
|
||||
from tinygrad.engine.schedule import BUF_LIMIT, ScheduleItem, create_schedule_with_vars, view_right, view_left, remove_movement_ops
|
||||
|
|
@ -2015,7 +2015,7 @@ class TestView(unittest.TestCase):
|
|||
run_schedule(s)
|
||||
self.assertEqual(other_child.tolist(), [2, 3, 4])
|
||||
|
||||
def tensor_rewrite(t) -> UOp: return graph_rewrite(t.lazydata.base, remove_movement_ops+symbolic)
|
||||
def tensor_rewrite(t) -> UOp: return graph_rewrite(t.lazydata.base, remove_movement_ops+symbolic_simple)
|
||||
class TestBigGraph(unittest.TestCase):
|
||||
def test_sink_childless_const(self):
|
||||
x = Tensor(0)
|
||||
|
|
|
|||
|
|
@ -87,12 +87,6 @@ class View:
|
|||
mask:Optional[tuple[tuple[sint, sint], ...]]
|
||||
contiguous:bool
|
||||
|
||||
@functools.cached_property
|
||||
def t(self):
|
||||
return tuple(x.tuplize if isinstance(x, UOp) else (x,) \
|
||||
for x in self.shape+self.strides+(self.offset,)+(tuple(flatten(self.mask)) if self.mask is not None else tuple()))
|
||||
def __lt__(self, o:View): return self.t < o.t
|
||||
|
||||
def to_indexed_uops(self:View, idxs:Optional[Sequence[UOp]]=None, vexpr:UOp=UOp.const(dtypes.bool, True)) -> tuple[UOp, UOp]:
|
||||
"""(idx, valid)"""
|
||||
if idxs is None: idxs = [UOp.range(dtypes.int, 0, s, i) for i,s in enumerate(self.shape)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue