code: def multi_gpu_launcher(commands):
      """
      Launch commands on the local machine, using all GPUs in parallel.
      """
      print("WARNING: using experimental multi_gpu_launcher.")
      gpu_count = torch.cuda.device_count()
      # gpu_count = 5
      n_gpus = os.getenv("CUDA_VISIBLE_DEVICES").split(",")
      # n_gpus = ['3', '4', '5', '6', '7']
      print("*" * 80)
      print(n_gpus)
      print("*" * 80)
      procs_by_gpu = [None] * gpu_count
  
      while len(commands) > 0:
          for idx in range(gpu_count):
              cur_gpu = n_gpus[idx]
              proc = procs_by_gpu[idx]
              if (proc is None) or (proc.poll() is not None):
                  # Nothing is running on this GPU; launch a command.
                  cmd = commands.pop(0)
                  print(f"CUDA_VISIBLE_DEVICES={cur_gpu} {cmd}")
                  new_proc = subprocess.Popen(
                      f"CUDA_VISIBLE_DEVICES={cur_gpu} {cmd}",
                      shell=True,
                  )
                  procs_by_gpu[idx] = new_proc
                  break
          time.sleep(1)
  
      # Wait for the last few tasks to finish before returning
      for p in procs_by_gpu:
          if p is not None:
              p.wait()
  
imports: import os
  import subprocess
  import time
  import torch.cuda
label_desc: Use image node_id 3 for calling a global function with example usage: multi_gpu_launcher(commands) without return types