File size: 1,373 Bytes
087df0e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright (c) 2023, NVIDIA Corporation & Affiliates. All rights reserved.
#
# This work is made available under the Nvidia Source Code License-NC.
# To view a copy of this license, visit
# https://github.com/NVlabs/prismer/blob/main/LICENSE

import os
import yaml
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('--main_ip', default='', type=str)
parser.add_argument('--rank', default=0, type=int)
parser.add_argument('--num_machines', default=4, type=int)
args = parser.parse_args()

config = {
    'command_file': 'null',
    'commands': 'null',
    'compute_environment': 'LOCAL_MACHINE',
    'deepspeed_config': {},
    'distributed_type': 'MULTI_GPU',
    'downcast_bf16': 'no',
    'dynamo_backend': 'NO',
    'fsdp_config': {},
    'gpu_ids': 'all',
    'machine_rank': args.rank,
    'main_process_ip': args.main_ip,
    'main_process_port': 8080,
    'main_training_function': 'main',
    'megatron_lm_config': {},
    'mixed_precision': 'fp16',
    'num_machines': args.num_machines,
    'num_processes': args.num_machines * 8,
    'rdzv_backend': 'static',
    'same_network': True,
    'tpu_name': 'null',
    'tpu_zone': 'null',
    'use_cpu': False,
}

os.makedirs('/root/.cache/huggingface/accelerate', exist_ok=True)

with open('/root/.cache/huggingface/accelerate/default_config.yaml', 'w') as file:
    yaml.dump(config, file)