docstr: Check 2 given index: one index should be source of the other
  Args:
      start_idx(int): start node chunk dim
      start_node(node): start node
      end_idx(int): end node chunk dim
      end_node(node): end node
  
  Returns:
      bool: True if check pass
docstr_tok: ["Check","2","given","index",":","one","index","should","be","source","of","the","other","Args",":","start_idx","(","int",")",":","start","node","chunk","dim","start_node","(","node",")",":","start","node","end_idx","(","int",")",":","end","node","chunk","dim","end_node","(","node",")",":","end","node","Returns",":","bool",":","True","if","check","pass"]
code: def check_index_source(
      self, start_dim, start_node, start_idx, end_dim, end_node
  ):
      """
      Check 2 given index: one index should be source of the other
      Args:
          start_idx(int): start node chunk dim
          start_node(node): start node
          end_idx(int): end node chunk dim
          end_node(node): end node
  
      Returns:
          bool: True if check pass
      """
      # we use start_node_idx instead of real chunk index
      start_node_idx = self.node_mgr.find_node_idx(start_node)
      end_node_trace = self.trace_indice._find_trace_from_node(end_node)
      end_node_trace_source = end_node_trace["source"][end_dim]
      sorted_source = sorted(
          end_node_trace_source.items(),
          key=lambda d: d[0],
          reverse=True,
      )
      for node_idx, node_dim in sorted_source:
          if node_idx == start_node_idx and start_dim in node_dim:
              return True
          # it means we meet a node outside the loop, and the node is not input node
          if node_idx < start_node_idx:
              return False
      return False
  
file_path: colossalai/colossalai/autochunk/trace_flow.py
imports: from typing import Dict, List, Tuple
  from torch.fx.node import Node
  from .trace_indice import TraceIndice
  from .utils import NodeMgr, find_chunk_all_input_nodes, find_chunk_compute_input_and_output_nodes, find_tensor_shape_node, flat_list, get_node_name, get_node_shape, is_non_compute_node
label_desc: Use image node_id 2 for calling the TraceFlow obj's underlying member method code with example usage: obj.check_index_source(start_dim, start_node, start_idx, end_dim, end_node) and returns: False, True, False