code: def get_launcher(distributed=False):
      # 1. explicitly set --num_nodes=1 just in case these tests end up run on a multi-node setup
      # - it won't be able to handle that
      # 2. for now testing with just 2 gpus max (since some quality tests may give different
      # results with mode gpus because we use very little data)
      num_gpus = min(2, get_gpu_count()) if distributed else 1
      master_port = os.environ.get("DS_TEST_PORT", DEFAULT_MASTER_PORT)
      return f"deepspeed --num_nodes 1 --num_gpus {num_gpus} --master_port {master_port}".split()
  
file_path: transformers/tests/deepspeed/test_model_zoo.py
imports: import itertools
  import os
  import subprocess
  from os.path import dirname
  from parameterized import parameterized
  from tests.trainer.test_trainer import TrainerIntegrationCommon
  from transformers import is_torch_available
  from transformers.testing_utils import TestCasePlus, execute_subprocess_async, get_gpu_count, get_tests_dir, require_deepspeed, require_torch_gpu, slow
  from transformers.trainer_utils import set_seed
label_desc: Use image node_id 1 for calling a global function with example usage: get_launcher(distributed) and returns: str, num_gpus, str, master_port