docstr: Extract btmp from a list of nodes
docstr_tok: ["Extract","btmp","from","a","list","of","nodes"]
code: def _extract_btmp(node: List[Node]) -> int:
      """Extract btmp from a list of nodes"""
  
      def _extract_deps_size():
          deps_size = 0
          for k, v in deps.items():
              k: Node
              if v > 0:
                  deps_size += k.meta["bwd_mem_out"]
              if v == float("-inf"):
                  deps_size -= calculate_fwd_tmp(k) + calculate_fwd_out(
                      k
                  )
  
          return deps_size
  
      btmp = 0
      deps = {}
      for n in reversed(node):
          deps[n] = len(n.all_input_nodes)
          btmp = max(btmp, _extract_deps_size() + n.meta["bwd_mem_tmp"])
          for child in n.users:
              if child in deps:
                  deps[child] -= 1
                  if deps[child] <= 0:
                      deps[child] = float("-inf")  # free
      return btmp
  
imports: from copy import deepcopy
  from typing import Any, List, Tuple
  from torch import Tensor
  from torch.fx import Graph, Node
  from colossalai.auto_parallel.passes.runtime_apply_pass import runtime_apply, runtime_comm_spec_apply
  from colossalai.fx.codegen.activation_checkpoint_codegen import _find_nested_ckpt_regions
  from colossalai.fx.profiler import activation_size, calculate_bwd_time, calculate_fwd_out, calculate_fwd_time, calculate_fwd_tmp
  from colossalai.logging import get_dist_logger
  from .ckpt_solver_base import CheckpointSolverBase
  from .operation import Backward, Chain, ForwardCheck, ForwardEnable, ForwardNograd, Loss, Sequence
label_desc: Use image node_id 9 for calling the CheckpointSolverRotor obj's underlying member method code with example usage: obj._extract_btmp(node) and returns: btmp, deps_size