-
Notifications
You must be signed in to change notification settings - Fork 2
/
generate_text.sh
executable file
·49 lines (43 loc) · 1.1 KB
/
generate_text.sh
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
49
#!/bin/bash
export TORCH_CUDA_ARCH_LIST=8.6+PTX
CHECKPOINT_PATH=checkpoints/gpt2_345m
VOCAB_FILE=gpt2-vocab.json
MERGE_FILE=gpt2-merges.txt
b=8
mp=1
experts=1
nodes=1
gpus=1
use_tutel=""
#use_tutel="--use-tutel"
#ds_inference=""
ds_inference="--ds-inference"
launch_cmd="deepspeed --num_nodes $nodes --num_gpus $gpus"
L=24
H=1024
A=16
#experts1=${experts[$k]}
program_cmd="tools/generate_samples_gpt.py \
--tensor-model-parallel-size $mp \
--num-layers $L \
--hidden-size $H \
--num-attention-heads $A \
--max-position-embeddings 1024 \
--tokenizer-type GPT2BPETokenizer \
--fp16 \
--num-experts ${experts} \
--mlp-type standard \
--micro-batch-size $b \
--seq-length 1024 \
--out-seq-length 1024 \
--temperature 1.0 \
--vocab-file $VOCAB_FILE \
--merge-file $MERGE_FILE \
--genfile unconditional_samples.json \
--top_p 0.9 \
--log-interval 1 \
--num-samples 0 \
--load $CHECKPOINT_PATH \
$use_tutel $ds_inference"
echo $launch_cmd $program_cmd
$launch_cmd $program_cmd