mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
@@ -2,7 +2,7 @@ import sys
|
||||
from collections import defaultdict, deque
|
||||
from dataclasses import dataclass
|
||||
from typing import Tuple, List, Dict, Optional, Set, DefaultDict
|
||||
from tinygrad.ops import LoadOps, ScheduleItem, BufferOps, LazyOp, ReduceOps, ConstBuffer, MemBuffer, UNSAFE_PAD_OPS, UnaryOps
|
||||
from tinygrad.ops import LoadOps, ScheduleItem, BufferOps, LazyOp, ReduceOps, ConstBuffer, MemBuffer, UNSAFE_PAD_OPS
|
||||
from tinygrad.features.graph import log_lazybuffer, realized_lazybuffer
|
||||
from tinygrad.helpers import GRAPH, DEBUG, GlobalCounters, prod, dedup, all_int, merge_dicts, getenv
|
||||
from tinygrad.shape.symbolic import Variable
|
||||
@@ -82,7 +82,6 @@ def _schedule_group(outs:Tuple[LazyBuffer, ...], realizes:Set[LazyBuffer], reduc
|
||||
if outs[0].op in {LoadOps.CUSTOM, LoadOps.COPY, LoadOps.EMPTY}:
|
||||
ast, inputs = [LazyOp(outs[0].op, (), outs[0].arg)], list(outs[0].srcs)
|
||||
else:
|
||||
if len(outs) > 1: outs = tuple(sorted(outs, key=lambda x: x.key))
|
||||
for i, out in enumerate(outs):
|
||||
output_st = ShapeTracker.from_shape(reduce_for_op[out].shape if out in reduce_for_op else out.shape)
|
||||
output_view = out.arg[0] if out.op is LoadOps.ASSIGN and out.arg else output_st
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from __future__ import annotations
|
||||
import math, hashlib, functools
|
||||
import math
|
||||
from typing import Union, Optional, Any, Tuple, List
|
||||
from tinygrad.dtype import dtypes, DType, ConstType, least_upper_dtype
|
||||
from tinygrad.helpers import prod, getenv, all_int, all_same
|
||||
@@ -52,10 +52,6 @@ class LazyBuffer:
|
||||
@property
|
||||
def base(self) -> LazyBuffer: return self._base if self._base is not None else self
|
||||
|
||||
@functools.cached_property
|
||||
def key(self) -> bytes: return hashlib.sha256(functools.reduce(lambda x,y: x+y, [s.base.key for s in self.srcs if s.base.realized is None],
|
||||
str((self.op, self.arg, self.device)).encode())).digest()
|
||||
|
||||
# same API as multi
|
||||
@property
|
||||
def lbs(self) -> List[LazyBuffer]: return [self]
|
||||
|
||||
Reference in New Issue
Block a user