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_clm_from_config_zero3_fp16(self):
      # this test exercises AutoModel.from_config(config) - to ensure zero.Init is called
  
      data_dir = self.tests_dir / "fixtures"
      output_dir = self.get_auto_remove_tmp_dir()
      args = f"""
              --model_type gpt2
              --tokenizer_name {GPT2_TINY}
              --train_file {data_dir}/sample_text.txt
              --validation_file {data_dir}/sample_text.txt
              --output_dir {output_dir}
              --overwrite_output_dir
              --do_train
              --max_train_samples 4
              --per_device_train_batch_size 2
              --num_train_epochs 1
              --warmup_steps 8
              --block_size 8
              --fp16
              --report_to none
              """.split()
  
      ds_args = f"--deepspeed {self.test_file_dir_str}/ds_config_zero3.json".split()
      script = [
          f"{self.examples_dir_str}/pytorch/language-modeling/run_clm.py"
      ]
      launcher = get_launcher(distributed=True)
  
      cmd = launcher + script + args + ds_args
      # keep for quick debug
      # print(" ".join([f"\nPYTHONPATH={self.src_dir_str}"] +cmd)); die
      with CaptureStderr() as cs:
          execute_subprocess_async(cmd, env=self.get_env())
      self.assertIn("Detected DeepSpeed ZeRO-3", cs.err)
  
imports: import dataclasses
  import io
  import itertools
  import json
  import os
  import unittest
  from copy import deepcopy
  import datasets
  from parameterized import parameterized
  from tests.trainer.test_trainer import TrainerIntegrationCommon
  from transformers import AutoModel, TrainingArguments, is_torch_available, logging
  from transformers.deepspeed import HfDeepSpeedConfig, is_deepspeed_available, unset_hf_deepspeed_config
  from transformers.testing_utils import CaptureLogger, CaptureStd, CaptureStderr, LoggingLevel, TestCasePlus, execute_subprocess_async, get_gpu_count, mockenv_context, require_deepspeed, require_optuna, require_torch_gpu, require_torch_multi_gpu, slow
  from transformers.trainer_utils import get_last_checkpoint, set_seed
  from transformers.utils import WEIGHTS_NAME, is_torch_bf16_gpu_available
label_desc: Use image node_id 11 for calling the TestDeepSpeedWithLauncher obj's underlying member method code with example usage: obj.test_clm_from_config_zero3_fp16() without return types