code: def get_nccl_options(pg_name, nccl_comm_cfgs):
      """Set the NCCL process group options.
  
      Arguments:
          pg_name (str): process group name
          nccl_comm_cfgs (dict): nccl communicator configurations
  
      When an option (e.g., max_ctas) is not found in the config, use the NCCL default setting.
      """
      if pg_name in nccl_comm_cfgs:
          nccl_options = torch.distributed.ProcessGroupNCCL.Options()
          nccl_options.config.cga_cluster_size = nccl_comm_cfgs[
              pg_name
          ].get("cga_cluster_size", 4)
          nccl_options.config.max_ctas = nccl_comm_cfgs[pg_name].get(
              "max_ctas", 32
          )
          nccl_options.config.min_ctas = nccl_comm_cfgs[pg_name].get(
              "min_ctas", 1
          )
          return nccl_options
      else:
          return None
  
imports: import os
  from typing import Optional
  import torch
  from .utils import GlobalMemoryBuffer
label_desc: Use image node_id 1 for calling a global function with example usage: get_nccl_options(pg_name, nccl_comm_cfgs) and returns: nccl_options, None