code: def test_activation_checkpoint_annotation():
      module = MyModule()
  
      # test tracing with activation checkpoint
      tracer = ColoTracer(trace_act_ckpt=True)
      graph = tracer.trace(module)
      gm = GraphModule(module, graph)
  
      for node in gm.graph.nodes:
          if node.name in ["mlp_1_linear1", "mlp_1_linear2"]:
              assert node.meta.get("activation_checkpoint", -1) == 0
  
      for node in gm.graph.nodes:
          if node.name in ["mlp_2_linear1", "mlp_2_linear2"]:
              assert node.meta.get("activation_checkpoint", -1) == 1
  
      tracer = ColoTracer(trace_act_ckpt=False)
      graph = tracer.trace(module)
      gm = GraphModule(module, graph)
  
      for node in gm.graph.nodes:
          assert not hasattr(node, "activation_checkpoint")
  
file_path: ColossalAI/tests/test_fx/test_tracer/test_activation_checkpoint_annotation.py
imports: import torch
  from torch.fx import GraphModule
  from torch.utils.checkpoint import checkpoint
  from colossalai.fx import ColoTracer
  from colossalai.testing import clear_cache_before_run
label_desc: Use image node_id 1 for calling a global function with example usage: test_activation_checkpoint_annotation() without return types