code: def _run_ddp_save_load(fabric, tmp_path):
      fabric.seed_everything(0)
  
      tmp_path = fabric.broadcast(tmp_path)
  
      model = torch.nn.Linear(2, 2)
      params_before = deepcopy(list(model.parameters()))
  
      # Save
      fabric.save(
          tmp_path / "saved_before_setup.ckpt", {"model": model}
      )
      wrapped_model = fabric.setup(model)
      fabric.save(
          tmp_path / "saved_after_setup.ckpt", {"model": wrapped_model}
      )
  
      def assert_params_equal(params0, params1):
          assert all(
              torch.equal(p0, p1.to(p0.device))
              for p0, p1 in zip(params0, params1)
          )
  
      # Load
      model = torch.nn.Linear(2, 2)
      fabric.load(
          tmp_path / "saved_before_setup.ckpt", {"model": model}
      )
      assert_params_equal(params_before, model.parameters())
      fabric.load(tmp_path / "saved_after_setup.ckpt", {"model": model})
      assert_params_equal(params_before, model.parameters())
  
      wrapped_model = fabric.setup(model)
      fabric.load(
          tmp_path / "saved_before_setup.ckpt", {"model": wrapped_model}
      )
      assert_params_equal(params_before, wrapped_model.parameters())
      fabric.load(
          tmp_path / "saved_after_setup.ckpt", {"model": wrapped_model}
      )
      assert_params_equal(params_before, wrapped_model.parameters())
  
file_path: pytorch-lightning/tests/tests_fabric/strategies/test_ddp_integration.py
imports: from copy import deepcopy
  import pytest
  import torch
  from lightning.fabric import Fabric
  from tests_fabric.helpers.runif import RunIf
  from tests_fabric.strategies.test_single_device import _run_test_clip_gradients
label_desc: Use image node_id 2 for calling a global function with example usage: _run_ddp_save_load(fabric, tmp_path) without return types