class_docstr: This class is for testing via an external script - can do multiple gpus
class_docstr_tok: ["This","class","is","for","testing","via","an","external","script","-","can","do","multiple","gpus"]
code: def test_zero_to_fp32(self, stage, task):
      # testing the ability to do a run followed by recovery of full fp32 weights
  
      cmd, output_dir = self.get_task_cmd(task, stage)
  
      # 1. generate the checkpoint
      cmd += "--save_steps 1".split()
      # keep for quick debug
      # print(" ".join([f"\nPYTHONPATH={self.src_dir_str}"] + cmd)); die
      execute_subprocess_async(cmd, env=self.get_env())
  
      # 2. test that the fp32 weights get reconsolidated
      chkpt_dir = f"{output_dir}/checkpoint-1"
      recovered_model_path = f"{chkpt_dir}/out.bin"
      cmd = f"{chkpt_dir}/zero_to_fp32.py {chkpt_dir} {recovered_model_path}"
      # keep for quick debug
      # print(" ".join([f"\nPYTHONPATH={self.src_dir_str}"] +cmd)); die
      subprocess.check_call(cmd, shell=True)
      assert os.path.exists(
          recovered_model_path
      ), f"{recovered_model_path} was not found"
  
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 2 for calling the TestDeepSpeedModelZoo obj's underlying member method code with example usage: obj.test_zero_to_fp32(stage, task) without return types