code: def test_ddp_strategy_checkpoint_zero_redundancy_optimizer(
      tmpdir, strategy
  ):
      """Test to ensure that checkpoint is saved correctly when using zero redundancy optimizer."""
      model = BoringZeroRedundancyOptimizerModel()
      trainer = Trainer(
          accelerator="gpu", devices=2, strategy=strategy, max_steps=1
      )
  
      trainer.fit(model)
  
      checkpoint_path = os.path.join(tmpdir, "model.pt")
      # need to broadcast because tmpdir is different on each process
      checkpoint_path = trainer.strategy.broadcast(checkpoint_path)
      trainer.save_checkpoint(checkpoint_path)
      saved_model = BoringModel.load_from_checkpoint(checkpoint_path)
  
      # Assert model parameters are identical after loading
      for trained_param, loaded_param in zip(
          model.parameters(), saved_model.parameters()
      ):
          assert torch.equal(trained_param.to("cpu"), loaded_param)
  
imports: import os
  from unittest import mock
  from unittest.mock import Mock
  import lightning.pytorch
  import pytest
  import torch
  from lightning.fabric.plugins.environments import ClusterEnvironment, LightningEnvironment
  from lightning.fabric.utilities.distributed import _distributed_is_initialized
  from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_2_0
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import Callback, EarlyStopping
  from lightning.pytorch.demos.boring_classes import BoringDataModule, BoringModel
  from lightning.pytorch.strategies import DDPStrategy
  from lightning.pytorch.strategies.launchers import _SubprocessScriptLauncher
  from lightning.pytorch.strategies.launchers.multiprocessing import _MultiProcessingLauncher
  from lightning.pytorch.trainer import seed_everything
  from torch.distributed.optim import ZeroRedundancyOptimizer
  from torch.multiprocessing import ProcessRaisedException
  from torch.nn.parallel.distributed import DistributedDataParallel
  import tests_pytorch.helpers.pipelines
  from tests_pytorch.helpers.datamodules import ClassifDataModule
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.helpers.simple_models import ClassificationModel
label_desc: Use image node_id 13 for calling a global function with example usage: test_ddp_strategy_checkpoint_zero_redundancy_optimizer(tmpdir, strategy) without return types