code: def run(self, *args, grid, warmup, **kwargs):
      from ..compiler import (
          CompiledKernel,
          compile,
          ASTSource,
          make_backend,
      )
  
      # deprecated arguments
      assert (
          "device_type" not in kwargs
      ), "device_type option is deprecated; current target will be used"
      assert (
          "device" not in kwargs
      ), "device option is deprecated; current device will be used"
      assert (
          "stream" not in kwargs
      ), "stream option is deprecated; current stream will be used"
      # parse options
      device = driver.get_current_device()
      stream = driver.get_current_stream(device)
      target = driver.get_current_target()
      backend = make_backend(target)
      kwargs["debug"] = self.debug
      options = backend.parse_options(kwargs)
      # bind non-reserved keyword args and set defaults
      kwargs = {
          k: v for k, v in kwargs.items() if not k in options.__dict__
      }
      bound_args = self.signature.bind(*args, **kwargs)
      bound_args.apply_defaults()
      assert len(bound_args.arguments) == len(self.params)
      # canonicalize grid
      assert grid is not None
      if callable(grid):
          # Arguments are passed as a dict to `grid`, by contract.
          # TODO(jlebar): In the new launch API, pass the compiler flags as a
          # second parameter to `grid`.
          grid = grid(dict(bound_args.arguments))
      grid_size = len(grid)
      grid_0 = grid[0]
      grid_1 = grid[1] if grid_size > 1 else 1
      grid_2 = grid[2] if grid_size > 2 else 1
      # compute cache key
      args = [
          KernelArg(arg_value, param)
          for (_, arg_value), param in zip(
              bound_args.arguments.items(), self.params
          )
      ]
      sig_key = tuple(
          arg.signature_key()
          for arg in args
          if not arg.param.is_constexpr
      )
      spec_key = tuple(
          arg.specialization_key()
          for arg in args
          if not arg.param.do_not_specialize
      )
      constexpr_key = tuple(
          arg.value for arg in args if arg.param.is_constexpr
      )
      key = (sig_key, constexpr_key, spec_key, options)
      # Kernel is not cached; we have to compile.
      if key not in self.cache[device]:
          configs = (self._get_config(*[arg.value for arg in args]),)
          constants = {
              arg.param.num: arg.value
              for arg in args
              if arg.param.is_constexpr
              or arg.param.num in configs[0].equal_to_1
              or arg.value is None
          }
          for i, arg in constants.items():
              if callable(arg):
                  raise TypeError(
                      f"Callable constexpr at index {i} is not supported"
                  )
  
          # Build kernel signature -- doesn't include constexpr arguments.
          signature = {
              arg.param.num: self._type_of(self._key_of(arg.value))
              for arg in args
              if not arg.param.is_constexpr
          }
  
          if self._call_hook(
              key,
              signature,
              device,
              constants,
              options.num_warps,
              options.num_ctas,
              options.num_stages,
              options.enable_warp_specialization,
              options.enable_fp_fusion,
              options.extern_libs,
              configs,
          ):
              return None
          # compile the kernel
          src = ASTSource(self, signature, constants, configs[0])
          self.cache[device][key] = compile(
              src,
              target=target,
              options=options.__dict__,
          )
  
      kernel = self.cache[device][key]
      if not warmup:
          args = [
              arg.value for arg in args if not arg.param.is_constexpr
          ]
          metadata = kernel.metadata
          kernel.run(
              grid_0,
              grid_1,
              grid_2,
              metadata.num_warps,
              metadata.num_ctas,  # number of warps/ctas per instance
              metadata.cluster_dims[0],
              metadata.cluster_dims[1],
              metadata.cluster_dims[2],  # cluster
              metadata.shared,
              stream,
              kernel.function,
              CompiledKernel.launch_enter_hook,
              CompiledKernel.launch_exit_hook,
              metadata,
              *driver.assemble_tensormap_to_arg(
                  metadata.tensormaps_info, args
              ),
          )
      return kernel
  
imports: from __future__ import annotations, division
  import ast
  import hashlib
  import inspect
  import os
  import textwrap
  from collections import defaultdict, namedtuple
  from functools import cached_property
  from typing import Callable, Generic, Iterable, List, Optional, TypeVar, Union, cast, overload
  from ..runtime.driver import driver
label_desc: Use image node_id 7 for calling the JITFunction obj's underlying member method code with example usage: obj.run() and returns: kernel, None