code: def global_load(
      self,
      i: int,
      idxs: Sequence[Node],
      acc=None,
      barrier: Optional[UOp] = None,
  ) -> List[UOp]:
      buf = self.bufs[i]
      localtype = self.get_base_dtype(
          buf.dtype
          if acc is None
          else get_lazyop_info(self.reduceop).dtype
      )
      const = buf.val if isinstance(buf, ConstBuffer) else acc
  
      def rename_var(v: Union[Variable, NumNode], expr: str):
          return (
              v
              if isinstance(v, NumNode)
              else Variable(expr, v.min, v.max)
          )
  
      expand_vars = tuple(
          [
              rename_var(expand_idx(idx), f"_uidx{j}")
              for j, idx in enumerate(idxs)
          ]
      )
      fake_idxs = [
          idx.substitute({eidx: ev})
          if isinstance(eidx := expand_idx(idx), Variable)
          else idx
          for idx, ev in zip(idxs, expand_vars)
      ]
  
      dim, amt = None, 1
      # float 4 grouping
      if len(upcast_dim := self.get_float4_upcast_dim(i)) == 1 and len(
          float4_expand := expand_node(idxs[upcast_dim[0]])
      ) in [4, 2]:
          dim, amt = upcast_dim[0], len(float4_expand)
          g_idx, g_valid = self.sts[i].expr_idxs(
              fake_idxs[:dim]
              + [float4_expand[0]]
              + fake_idxs[dim + 1 :]
          )
          # do not use float4 if idx is not aligned
          if g_idx != (g_idx // amt * amt):
              dim, amt = None, 1
      if dim is None:
          g_idx, g_valid = self.sts[i].expr_idxs(fake_idxs)
  
      if amt > 1:
          localtype = localtype.vec(amt)
      e_idxs, e_valids = expand_node(g_idx, expand_vars), expand_node(
          g_valid, expand_vars
      )
  
      ret = []
      invalid_value = 0 if dtypes.is_int(buf.dtype) else 0.0
      for idx, valid, rep_idx in zip(
          e_idxs, e_valids, iter_idxs(expand_vars)
      ):
          this_const, idx, valid = (
              (invalid_value, NumNode(0), NumNode(1))
              if valid.max == 0
              else (const, idx, valid)
          )
          key = f"{acc}{localtype}{this_const if this_const is not None and acc is None else (buf.idx if isinstance(buf, MemBuffer) else cast(LocalBuffer, buf).name)}{idx.render()}{valid.render()}"  # noqa: E501
          if key not in self.load_cache:
              if acc is not None:
                  self.load_cache[key] = self.uop(
                      UOps.DEFINE_ACC,
                      localtype,
                      (),
                      this_const,
                      cachable=False,
                  )
              elif this_const is not None:
                  self.load_cache[key] = self.const(
                      this_const, localtype
                  )
                  if valid.min == 0 and valid.max == 1:
                      valid_rendered = valid.render(
                          self.render_ops, self
                      )
                      self.load_cache[key] = self.uop(
                          UOps.ALU,
                          localtype,
                          (
                              valid_rendered,
                              self.load_cache[key],
                              self.const(invalid_value, localtype),
                          ),
                          TernaryOps.WHERE,
                      )  # noqa: E501
              elif isinstance(buf.dtype, ImageDType):
                  buf_uop = self.buf_uops[i]
                  assert buf_uop is not None, f"buffer {i} wasn't UOped"
                  image_idx, valid = to_image_idx(
                      buf.dtype.shape, idx, valid
                  )
                  rendered_idx = self.uop(
                      UOps.CAST,
                      dtypes.int.vec(2),
                      tuple(
                          x.render(self.render_ops, self)
                          for x in image_idx
                      ),
                  )
                  valid_tuple = (
                      (
                          valid.render(self.render_ops, self),
                          self.const(
                              invalid_value, buf.dtype.base.vec(4)
                          ),
                      )
                      if valid.min == 0
                      else tuple()
                  )
                  self.load_cache[key] = self.uop(
                      UOps.LOAD,
                      buf.dtype.base.vec(4),
                      (buf_uop, rendered_idx)
                      + valid_tuple
                      + ((barrier,) if barrier else ()),
                  )
                  if localtype == localtype.scalar():
                      idx_small = idx % 4
                      res = idx_small.render(self.render_ops, self)
                      out = self.uop(
                          UOps.GEP,
                          localtype,
                          (self.load_cache[key],),
                          idx_small.max,
                      )
                      for ix in range(idx_small.max, idx_small.min, -1):
                          rvv = self.uop(
                              UOps.GEP,
                              localtype,
                              (self.load_cache[key],),
                              ix - 1,
                          )
                          sel = self.uop(
                              UOps.ALU,
                              dtypes.bool,
                              (res, self.const(ix)),
                              BinaryOps.CMPLT,
                          )
                          out = self.uop(
                              UOps.ALU,
                              localtype,
                              (sel, rvv, out),
                              TernaryOps.WHERE,
                          )
                      self.load_cache[key] = out
              else:
                  buf_uop = self.buf_uops[i]
                  assert buf_uop is not None, f"buffer {i} wasn't UOped"
                  rendered_idx = idx.render(self.render_ops, self)
                  valid_tuple = (
                      (
                          valid.render(self.render_ops, self),
                          self.const(invalid_value, localtype),
                      )
                      if valid.min == 0
                      else tuple()
                  )
                  self.load_cache[key] = self.uop(
                      UOps.LOAD,
                      localtype,
                      (buf_uop, rendered_idx)
                      + valid_tuple
                      + ((barrier,) if barrier else ()),
                  )
          ret.append(
              self.uop(
                  UOps.GEP,
                  localtype.scalar(),
                  (self.load_cache[key],),
                  rep_idx[dim],
              )
              if dim is not None
              else self.load_cache[key]
          )
      return ret
  
imports: from __future__ import annotations
  from typing import List, Tuple, Any, Optional, cast, DefaultDict, Dict, Union, Sequence, Final, Set, Iterator
  import itertools, math, functools
  from collections import defaultdict
  from enum import Enum, auto
  from dataclasses import dataclass
  from tinygrad.dtype import ImageDType, dtypes, DType, PtrDType
  from tinygrad.helpers import colored, DEBUG, prod, getenv, all_same, to_function_name, flatten
  from tinygrad.ops import LazyOp, UnaryOps, BinaryOps, TernaryOps, ReduceOps, ConstBuffer, MemBuffer, BufferOps, get_lazyop_info
  from tinygrad.shape.shapetracker import ShapeTracker
  from tinygrad.shape.symbolic import Variable, NumNode, Node, SumNode, MulNode, DivNode, ModNode, LtNode, AndNode
  from tinygrad.codegen.kernel import LocalBuffer, Kernel
  from tinygrad.features.image import to_image_idx
label_desc: Use image node_id 6 for calling the Linearizer obj's underlying member method code with example usage: obj.global_load(i, idxs, acc, barrier) and returns: ret, unknown