class_docstr: Builder is the base class to build extensions for PyTorch.
  
  Args:
      name (str): the name of the kernel to be built
      prebuilt_import_path (str): the path where the extension is installed during pip install
docstr: load the kernel during runtime. If the kernel is not built during pip install, it will build the kernel.
  If the kernel is built during runtime, it will be stored in `~/.cache/colossalai/torch_extensions/`. If the
  kernel is built during pip install, it can be accessed through `colossalai._C`.
  
  Warning: do not load this kernel repeatedly during model execution as it could slow down the training process.
  
  Args:
      verbose (bool, optional): show detailed info. Defaults to True.
docstr_tok: ["load","the","kernel","during","runtime",".","If","the","kernel","is","not","built","during","pip","install",",","it","will","build","the","kernel",".","If","the","kernel","is","built","during","runtime",",","it","will","be","stored","in","`","~\/.cache\/colossalai\/torch_extensions\/","`",".","If","the","kernel","is","built","during","pip","install",",","it","can","be","accessed","through","`","colossalai._C","`",".","Warning",":","do","not","load","this","kernel","repeatedly","during","model","execution","as","it","could","slow","down","the","training","process",".","Args",":","verbose","(","bool",",","optional",")",":","show","detailed","info",".","Defaults","to","True","."]
code: def load(self, verbose: Optional[bool] = None):
      """
      load the kernel during runtime. If the kernel is not built during pip install, it will build the kernel.
      If the kernel is built during runtime, it will be stored in `~/.cache/colossalai/torch_extensions/`. If the
      kernel is built during pip install, it can be accessed through `colossalai._C`.
  
      Warning: do not load this kernel repeatedly during model execution as it could slow down the training process.
  
      Args:
          verbose (bool, optional): show detailed info. Defaults to True.
      """
      if verbose is None:
          verbose = os.environ.get("CAI_KERNEL_VERBOSE", "0") == "1"
      # if the kernel has be compiled and cached, we directly use it
      if self.cached_op_module is not None:
          return self.cached_op_module
  
      try:
          # if the kernel has been pre-built during installation
          # we just directly import it
          op_module = self.import_op()
          if verbose:
              print_rank_0(
                  f"[extension] OP {self.prebuilt_import_path} has been compiled ahead of time, skip building."
              )
      except ImportError:
          # check environment
          if self.ext_type == "cuda":
              self.check_runtime_build_environment()
  
          # time the kernel compilation
          start_build = time.time()
  
          # construct the build directory
          import torch
          from torch.utils.cpp_extension import load
  
          torch_version_major = torch.__version__.split(".")[0]
          torch_version_minor = torch.__version__.split(".")[1]
          torch_cuda_version = torch.version.cuda
          home_directory = os.path.expanduser("~")
          extension_directory = f".cache/colossalai/torch_extensions/torch{torch_version_major}.{torch_version_minor}_cu{torch_cuda_version}"
          build_directory = os.path.join(
              home_directory, extension_directory
          )
          Path(build_directory).mkdir(parents=True, exist_ok=True)
  
          if verbose:
              print_rank_0(
                  f"[extension] Compiling or loading the JIT-built {self.name} kernel during runtime now"
              )
  
          # load the kernel
          op_module = load(
              name=self.name,
              sources=self.strip_empty_entries(self.sources_files()),
              extra_include_paths=self.strip_empty_entries(
                  self.include_dirs()
              ),
              extra_cflags=self.cxx_flags(),
              extra_cuda_cflags=self.nvcc_flags(),
              extra_ldflags=[],
              build_directory=build_directory,
              verbose=verbose,
          )
  
          build_duration = time.time() - start_build
  
          # log jit compilation time
          if verbose:
              print_rank_0(
                  f"[extension] Time to compile or load {self.name} op: {build_duration} seconds"
              )
  
      # cache the built/loaded kernel
      self.cached_op_module = op_module
  
      return op_module
  
imports: import importlib
  import os
  import time
  from abc import ABC, abstractmethod
  from pathlib import Path
  from typing import List, Optional, Union
  from .utils import check_cuda_availability, check_system_pytorch_cuda_match, print_rank_0
label_desc: Use image node_id 12 for calling the Builder obj's underlying member method code with example usage: obj.load(verbose) and returns: op_module, self