code: def _create_checkpoint_paths(
      base_folder, iteration, tp_degree, pp_degree
  ):
      path_list = []
      iter_folder = f"iter_{iteration:07d}"
      for i in range(0, tp_degree):
          path_list.append([])
          for j in range(0, pp_degree):
              rank_folder = (
                  f"mp_rank_{i:02d}"
                  if pp_degree == 1
                  else f"mp_rank_{i:02d}_{j:03d}"
              )
              ckpt_path = os.path.join(
                  rank_folder, "model_optim_rng.pt"
              )
              path_list[i].append(
                  os.path.join(base_folder, iter_folder, ckpt_path)
              )
  
      return path_list
  
imports: from functools import partial
  import argparse
  import glob
  import itertools
  import multiprocessing
  import os
  import re
  import shutil
  import torch
  import tqdm
  from deepspeed.checkpoint import DeepSpeedCheckpoint
  from deepspeed.checkpoint import OPTIMIZER_STATE_DICT, BASE_OPTIMIZER_STATE, SINGLE_PARTITION_OF_FP32_GROUPS, PARAM_SLICE_MAPPINGS, PARAM_SHAPES, PARAM, CAT_DIM, PARAM_N_SUB_PARAMS, VOCAB_TENSOR, UNIVERSAL_CHECKPOINT_INFO, VOCABULARY_PARAMETER_PATTERNS, PIPELINE_REPLICATED_PARAMETER_PATTERNS, TP_REPLICATED_PARAMETER_PATTERNS, PARAMETER_TO_AVERAGE_PATTERNS, PARAMETER_WITH_ROW_PARALLELISM_PATTERNS, PARAMETER_WITH_2_SUB_PARAMS_CAT_DIM_0
label_desc: Use image node_id 2 for calling a global function with example usage: _create_checkpoint_paths(base_folder, iteration, tp_degree, pp_degree) and returns: path_list