class_docstr: Reorder node list and indice trace list
class_docstr_tok: ["Reorder","node","list","and","indice","trace","list"]
code: def _get_reorder_map(self, chunk_info):
      reorder_map = {
          i: i for i in range(len(self.node_mgr.get_node_list()))
      }
  
      chunk_region_start = chunk_info["region"][0]
      chunk_region_end = chunk_info["region"][1]
      chunk_prepose_nodes = chunk_info["args"]["prepose_nodes"]
      chunk_prepose_nodes_idx = [
          self.node_mgr.find_node_idx(i) for i in chunk_prepose_nodes
      ]
      # put prepose nodes ahead
      for idx, n in enumerate(chunk_prepose_nodes):
          n_idx = chunk_prepose_nodes_idx[idx]
          reorder_map[n_idx] = chunk_region_start + idx
      # put other nodes after prepose nodes
      for n in self.node_mgr.get_node_slice_by_idx(
          chunk_region_start, chunk_region_end + 1
      ):
          if n in chunk_prepose_nodes:
              continue
          n_idx = self.node_mgr.find_node_idx(n)
          pos = sum([n_idx < i for i in chunk_prepose_nodes_idx])
          reorder_map[n_idx] = n_idx + pos
  
      return reorder_map
  
file_path: ColossalAI/colossalai/autochunk/reorder_graph.py
imports: from .trace_indice import TraceIndice
  from .utils import NodeMgr
label_desc: Use image node_id 2 for calling the ReorderGraph obj's underlying member method code with example usage: obj._get_reorder_map(chunk_info) and returns: reorder_map