code: def dump_compiler_graph_state(
      gm, args, compiler_name, *, accuracy=None
  ):
      subdir = os.path.join(minifier_dir(), "checkpoints")
      if not os.path.exists(subdir):
          os.makedirs(subdir, exist_ok=True)
      file_name = os.path.join(subdir, f"{len(gm.graph.nodes)}.py")
      log.warning(
          "Writing checkpoint with %s nodes to %s",
          len(gm.graph.nodes),
          file_name,
      )
      with open(file_name, "w") as fd:
          save_graph_repro(
              fd,
              gm,
              args,
              compiler_name,
              save_dir=subdir,
              accuracy=accuracy,
          )
      curdir = os.getcwd()
      repro_path = os.path.join(curdir, "repro.py")
      try:
          shutil.copyfile(file_name, repro_path)
          log.warning(
              "Copying repro file for convenience to %s", repro_path
          )
          if use_buck:
              BuckTargetWriter(file_name).write()
      except OSError:
          log.warning("No write permissions for %s", repro_path)
          pass
  
imports: import argparse
  import copy
  import functools
  import io
  import logging
  import os
  import shutil
  import subprocess
  import sys
  import textwrap
  import uuid
  from importlib import import_module
  from tempfile import TemporaryFile
  from typing import Any, Callable, Dict, Union
  import torch
  import torch.fx
  import torch.nn
  from torch._dynamo.debug_utils import _cuda_system_info_comment, AccuracyError, backend_accuracy_fails, BuckTargetWriter, cast_to_fp64, extra_imports, generate_config_string, helper_for_dump_minify, InputReader, InputWriter, MAX_CONSTANT_NUMEL_INLINE, minifier_dir, NNModuleToString, NopInputReader, same_two_models
  from torch._dynamo.utils import clone_inputs, counters, same
  from torch.fx.experimental.proxy_tensor import make_fx
  from torch.fx.experimental.symbolic_shapes import fx_placeholder_targets, has_free_symbols
  from torch.hub import tqdm
  from ..None import config
label_desc: Use image node_id 4 for calling a global function with example usage: dump_compiler_graph_state(gm, args, compiler_name) without return types