code: def test_model_saves_on_multi_gpu(tmpdir):
      """Test that ONNX model saves on a distributed backend."""
      trainer_options = {
          "default_root_dir": tmpdir,
          "max_epochs": 1,
          "limit_train_batches": 10,
          "limit_val_batches": 10,
          "accelerator": "gpu",
          "devices": [0, 1],
          "strategy": "ddp_spawn",
          "enable_progress_bar": False,
      }
  
      model = BoringModel()
      model.example_input_array = torch.randn(5, 32)
  
      tpipes.run_model_test(trainer_options, model, min_acc=0.08)
  
      file_path = os.path.join(tmpdir, "model.onnx")
      model.to_onnx(file_path)
      assert os.path.exists(file_path) is True
  
file_path: pytorch-lightning/tests/tests_pytorch/models/test_onnx.py
imports: import operator
  import os
  from unittest.mock import patch
  import numpy
  import onnxruntime
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning_utilities import compare_version
  import tests_pytorch.helpers.pipelines
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.utilities.test_model_summary import UnorderedModel
label_desc: Use image node_id 4 for calling a global function with example usage: test_model_saves_on_multi_gpu(tmpdir) without return types