code: def _expedite_comm_ops(
      gm: IterGraphModule, comm_blocks: List[CommBlock]
  ) -> None:
      node_indices = {node: i for i, node in enumerate(gm.graph.nodes)}
      for comm_block in comm_blocks:
          last_input = comm_block.comm_node
          last_input_idx = -1
          for input in comm_block.inputs:
              input_idx = node_indices[input]
              if input_idx > last_input_idx:
                  last_input = input
                  last_input_idx = input_idx
          gm.graph.node_append(last_input, comm_block.comm_node)
  
imports: import collections
  import itertools
  import logging
  import operator
  import tempfile
  import time
  from dataclasses import dataclass, field
  from functools import wraps
  from typing import Any, Callable, cast, DefaultDict, Dict, Iterable, List, Optional, Set, Tuple, Union
  import torch
  import torch.fx
  from torch._subclasses.fake_tensor import FakeTensor, FakeTensorMode
  from torch.distributed._spmd.graph_utils import CommType, dump_graphs_to_files, find_node, get_output, OP
  from torch.distributed._spmd.iter_graph_module import IterGraphModule
  from torch.fx.passes.shape_prop import TensorMetadata
  from torch.utils import _pytree
  from torch.utils._pytree import tree_flatten, tree_unflatten
label_desc: Use image node_id 10 for calling a global function with example usage: _expedite_comm_ops(gm, comm_blocks) without return types