code: def helper_test_speed(f1, *args):
      global save_ops, save_mem
      ets = []
      ret = None
      cache_defeat = np.zeros((2048, 2048))
      for i in range(CNT):
          del ret
  
          # operation cache defeats
          args = [
              (x + 1).realize()
              if isinstance(x, Tensor)
              else (None if x is None else (x + 1))
              for x in args
          ]
  
          # force syncing
          [
              x.numpy()
              if isinstance(x, Tensor) or str(torch_device) == "cpu"
              else x.cpu().numpy()
              for x in args
              if x is not None
          ]
  
          # clear 32MB global memory cache (CPU and global memory only)
          cache_defeat += 1
  
          # manual pre sync
          if isinstance(args[0], Tensor):
              Device[args[0].device].synchronize()
          else:
              sync()
  
          GlobalCounters.global_ops = 0
          GlobalCounters.global_mem = 0
          st = time.perf_counter()
          ret = f1(*args)
          if isinstance(ret, Tensor):
              Device[ret.device].synchronize()
          else:
              sync()
          et = (time.perf_counter() - st) * 1000
          if i >= 1:
              ets.append(et)
          if GlobalCounters.global_ops:
              save_ops, save_mem = (
                  GlobalCounters.global_ops,
                  GlobalCounters.global_mem,
              )
      return ret.numpy() if isinstance(
          ret, Tensor
      ) else ret.cpu().numpy(), np.min(ets)
  
imports: import os
  import unittest
  import torch
  import time
  import numpy
  from tinygrad import Device, GlobalCounters
  from tinygrad.tensor import Tensor
  from tinygrad.nn import Conv2d
  from tinygrad.helpers import colored, getenv, CI
  from tinygrad.jit import TinyJit
label_desc: Use image node_id 2 for calling a global function with example usage: helper_test_speed(f1) and returns: unknown,  np