code: def set_cuda_arch_list(cuda_dir):
      """
      This function sets the PyTorch TORCH_CUDA_ARCH_LIST variable for ahead-of-time extension compilation.
      Ahead-of-time compilation occurs when CUDA_EXT=1 is set when running 'pip install'.
      """
      cuda_available = check_cuda_availability()
  
      # we only need to set this when CUDA is not available for cross-compilation
      if not cuda_available:
          warnings.warn(
              "\n[extension]  PyTorch did not find available GPUs on this system.\n"
              "If your intention is to cross-compile, this is not an error.\n"
              "By default, Colossal-AI will cross-compile for \n"
              "1. Pascal (compute capabilities 6.0, 6.1, 6.2),\n"
              "2. Volta (compute capability 7.0)\n"
              "3. Turing (compute capability 7.5),\n"
              "4. Ampere (compute capability 8.0, 8.6)if the CUDA version is >= 11.0\n"
              "\nIf you wish to cross-compile for a single specific architecture,\n"
              'export TORCH_CUDA_ARCH_LIST="compute capability" before running setup.py.\n'
          )
  
          if os.environ.get("TORCH_CUDA_ARCH_LIST", None) is None:
              (
                  bare_metal_major,
                  bare_metal_minor,
              ) = get_cuda_bare_metal_version(cuda_dir)
  
              arch_list = ["6.0", "6.1", "6.2", "7.0", "7.5"]
  
              if int(bare_metal_major) == 11:
                  if int(bare_metal_minor) == 0:
                      arch_list.append("8.0")
                  else:
                      arch_list.append("8.0")
                      arch_list.append("8.6")
  
              arch_list_str = ";".join(arch_list)
              os.environ["TORCH_CUDA_ARCH_LIST"] = arch_list_str
          return False
      return True
  
file_path: ColossalAI/colossalai/kernel/op_builder/utils.py
imports: import os
  import re
  import subprocess
  import warnings
  from typing import List
label_desc: Use image node_id 8 for calling a global function with example usage: set_cuda_arch_list(cuda_dir) and returns: True, False