code: def unused_param(rank, checkpoint):
      # get the model, wrap with DDP and fwd, bwd.
      class M(nn.Module):
          def __init__(self):
              super(M, self).__init__()
              # The size 2000 is important. Without bigger size, it doesn't trigger the RuntimeError!
              self.l1 = Linear(2000, 2000)
              self.l2 = Linear(2000, 2000)
  
          def forward(self, inp):
              x = self.l1(inp)
              x = checkpoint(self.l2, x)
              return x
  
      model = M()
      model.to("cuda")
      model = DDP(model, device_ids=[rank], find_unused_parameters=True)
      input_tensor = torch.rand((64, 2000)).cuda()
      output_tensor = model(input_tensor)
      try:
          output_tensor.sum().backward()
      except RuntimeError:
          return
      assert 0
  
imports: import os
  import random
  import tempfile
  import numpy
  import pytest
  import torch
  import torch.distributed
  import torch.multiprocessing
  import torch.nn
  from torch.nn import Linear, Sequential
  from torch.nn.parallel import DistributedDataParallel
  from torch.utils.checkpoint import checkpoint
  from fairscale.fair_dev.testing.testing import skip_if_no_cuda, skip_if_single_gpu
  from fairscale.nn.pipe.checkpoint import Checkpointing, Function, TensorOrTensors
  from fairscale.nn.pipe.microbatch import Batch
label_desc: Use image node_id 6 for calling a global function with example usage: unused_param(rank, checkpoint) and returns: x