code: def test_submodules_multi_gpu_ddp_spawn(tmpdir):
      model = TopModule()
      trainer = Trainer(
          default_root_dir=tmpdir,
          strategy="ddp_spawn",
          accelerator="gpu",
          devices=2,
          callbacks=[DeviceAssertCallback()],
          max_steps=1,
      )
      trainer.fit(model)
  
file_path: pytorch-lightning/tests/tests_pytorch/utilities/test_dtype_device_mixin.py
imports: import torch.nn
  from lightning.fabric.utilities.device_dtype_mixin import _DeviceDtypeModuleMixin
  from lightning.pytorch import Callback, Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 1 for calling a global function with example usage: test_submodules_multi_gpu_ddp_spawn(tmpdir) without return types