code: def test_amp_gpus(tmpdir, precision, devices):
      """Make sure combinations of AMP and strategies work if supported."""
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_epochs=1,
          accelerator="gpu",
          devices=devices,
          strategy=("ddp_spawn" if devices > 1 else "auto"),
          precision=precision,
      )
  
      model = AMPTestModel()
      trainer.fit(model)
      trainer.test(model)
      trainer.predict(model, DataLoader(RandomDataset(32, 64)))
  
file_path: pytorch-lightning/tests/tests_pytorch/models/test_amp.py
imports: import os
  from unittest import mock
  import pytest
  import torch
  from lightning.fabric.plugins.environments import SLURMEnvironment
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel, RandomDataset
  from torch.utils.data import DataLoader
  import tests_pytorch.helpers.utils
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 2 for calling a global function with example usage: test_amp_gpus(tmpdir, precision, devices) without return types