code: def check_backward_consistency(
      m: torch.nn.Module,
      gm: GraphModule,
      solver: Callable[[GraphModule], GraphModule],
      model_cls: Callable[[], torch.nn.Module],
  ):
      criterion = torch.nn.MSELoss()
      m.cuda()
      data = torch.rand(2, 3, 32, 32).cuda()
      label = torch.rand(2, 5).cuda()
      loss = criterion(m(data), label)
      loss.backward()
      loss = criterion(gm(data), label)
      loss.backward()
      assert _is_all_gradient_close(
          m, gm
      ), f"Solver {solver} did not work correctly in backward pass on {model_cls}"
  
imports: import copy
  import re
  from typing import Callable
  import pytest
  import torch
  import torchvision.models
  from torch.fx import GraphModule
  import colossalai
  from colossalai.fx import ColoTracer
  from colossalai.fx._compatibility import is_compatible_with_meta
  from colossalai.fx.graph_module import ColoGraphModule
  from colossalai.fx.passes.meta_info_prop import MetaInfoProp
  from colossalai.legacy.core import global_context
  from colossalai.testing import rerun_if_address_is_in_use, spawn
label_desc: Use image node_id 4 for calling a global function with example usage: check_backward_consistency(m, gm, solver, model_cls) without return types