code: def _create_default_config(
      zero_optimization: bool = True,
      zero_allow_untested_optimizer: bool = True,
      logging_batch_size_per_gpu: Union[str, int] = "auto",
      partition_activations: bool = False,
      cpu_checkpointing: bool = False,
      contiguous_memory_optimization: bool = False,
      synchronize_checkpoint_boundary: bool = False,
      offload_optimizer: bool = False,
      offload_parameters: bool = False,
      offload_params_device: str = "cpu",
      nvme_path: str = "/local_nvme",
      params_buffer_count: int = 5,
      params_buffer_size: int = 100_000_000,
      max_in_cpu: int = 1_000_000_000,
      offload_optimizer_device: str = "cpu",
      optimizer_buffer_count: int = 4,
      pin_memory: bool = False,
      block_size: int = 1048576,
      queue_depth: int = 8,
      single_submit: bool = False,
      overlap_events: bool = True,
      thread_count: int = 1,
      stage: int = 2,
      contiguous_gradients: bool = True,
      overlap_comm: bool = True,
      allgather_partitions: bool = True,
      reduce_scatter: bool = True,
      allgather_bucket_size: int = 200_000_000,
      reduce_bucket_size: int = 200_000_000,
      sub_group_size: int = 1_000_000_000_000,
  ) -> Dict:
      cfg = {
          "activation_checkpointing": {
              "partition_activations": partition_activations,
              "cpu_checkpointing": cpu_checkpointing,
              "contiguous_memory_optimization": contiguous_memory_optimization,
              "synchronize_checkpoint_boundary": synchronize_checkpoint_boundary,
          },
          "aio": {
              "block_size": block_size,
              "queue_depth": queue_depth,
              "single_submit": single_submit,
              "overlap_events": overlap_events,
              "thread_count": thread_count,
          },
      }
      zero_kwargs = {
          "stage": stage,
          "contiguous_gradients": contiguous_gradients,
          "overlap_comm": overlap_comm,
          "allgather_partitions": allgather_partitions,
          "reduce_scatter": reduce_scatter,
          "allgather_bucket_size": allgather_bucket_size,
          "reduce_bucket_size": reduce_bucket_size,
          "sub_group_size": sub_group_size,
      }
      if zero_optimization:
          zero_config = zero_kwargs
  
          if offload_optimizer:
              zero_config["offload_optimizer"] = {
                  "device": offload_optimizer_device,
                  "nvme_path": nvme_path,
                  "buffer_count": optimizer_buffer_count,
                  "pin_memory": pin_memory,
              }
          if offload_parameters:
              zero_config["offload_param"] = {
                  "device": offload_params_device,
                  "nvme_path": nvme_path,
                  "buffer_count": params_buffer_count,
                  "buffer_size": params_buffer_size,
                  "max_in_cpu": max_in_cpu,
                  "pin_memory": pin_memory,
              }
          cfg = {
              "zero_allow_untested_optimizer": zero_allow_untested_optimizer,
              "zero_optimization": zero_config,
              **cfg,
          }
      if logging_batch_size_per_gpu != "auto":
          cfg = {
              "train_micro_batch_size_per_gpu": logging_batch_size_per_gpu,
              **cfg,
          }
      return cfg
  
imports: import os
  from typing import Any, Dict, Optional, Union
  from enum import IntEnum
  import contextlib
  import random
  import numpy
  import inspect
  from fastNLP.envs.imports import _NEED_IMPORT_TORCH
  from fastNLP.envs.utils import get_global_seed
  from fastNLP.envs import get_global_rank, FASTNLP_BACKEND_LAUNCH, FASTNLP_GLOBAL_SEED
  from fastNLP.core.samplers import re_instantiate_sampler, ReproducibleBatchSampler, ReproducibleSampler
  from fastNLP.core.utils import auto_param_call, apply_to_collection
  from fastNLP.core.log import logger
label_desc: Use image node_id 7 for calling a global function with example usage: _create_default_config(zero_optimization, zero_allow_untested_optimizer, logging_batch_size_per_gpu, partition_activations, cpu_checkpointing, contiguous_memory_optimization, synchronize_checkpoint_boundary, offload_optimizer, offload_parameters, offload_params_device, nvme_path, params_buffer_count, params_buffer_size, max_in_cpu, offload_optimizer_device, optimizer_buffer_count, pin_memory, block_size, queue_depth, single_submit, overlap_events, thread_count, stage, contiguous_gradients, overlap_comm, allgather_partitions, reduce_scatter, allgather_bucket_size, reduce_bucket_size, sub_group_size) and returns: cfg