-
Notifications
You must be signed in to change notification settings - Fork 86
/
eval_humaneval_102B.sh
87 lines (78 loc) · 2.17 KB
/
eval_humaneval_102B.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
# Runs the "Yuan-102B" parameter model inference
GPUS_PER_NODE=8
MASTER_ADDR=localhost
MASTER_PORT=6042
NNODES=1
NODE_RANK=0
WORLD_SIZE=$(($GPUS_PER_NODE*$NNODES))
MAX_LENGTH=512
if [ "$TEMP" == "" ]; then
TEMP=1
fi
if [ "$TOP_P" == "" ]; then
TOP_P=0.0
fi
if [ "$TOP_K" == "" ]; then
TOP_K=1
fi
if [ "$CASE_NAME" == "" ]; then
CASE_NAME=test-102B
fi
TOKENIZER_MODEL_PATH=./tokenizer
CHECKPOINT_PATH=<Specify CHECKPOINT_PATH>
DATASET=HumanEval.jsonl.gz
PROMPT=HumanEval-textprompts.jsonl
LOG_PATH=./logs/${CASE_NAME}
OUTPUT_PATH=./output/${CASE_NAME}
mkdir -p $LOG_PATH
mkdir -p $OUTPUT_PATH
GPT_ARGS="
--micro-batch-size 1 \
--tensor-model-parallel-size 8 \
--pipeline-model-parallel-size 1 \
--num-layers 84 \
--hidden-size 8192 \
--use-lf-gate \
--lf-conv2d-group 1 \
--lf-conv2d-num-pad 0 \
--position-embedding-type rope \
--no-embedding-dropout \
--use-flash-attn \
--flash-attn-drop 0.0 \
--attention-dropout 0 \
--fim-rate 0.0 \
--hidden-dropout 0 \
--norm-dtype RMSNorm \
--disable-bias-linear \
--reset-position-ids \
--swiglu \
--num-attention-heads 64 \
--seq-length 4096 \
--max-position-embeddings 4096 \
--no-async-tensor-model-parallel-allreduce \
--bf16 \
--temp $TEMP \
--top_p $TOP_P \
--top_k $TOP_K \
--seed $RANDOM
"
DISTRIBUTED_ARGS="
--nproc_per_node $GPUS_PER_NODE \
--nnodes $NNODES \
--node_rank $NODE_RANK \
--master_addr $MASTER_ADDR \
--master_port $MASTER_PORT
"
torchrun $DISTRIBUTED_ARGS tasks/humaneval/eval_humaneval.py \
$GPT_ARGS \
--tokenizer-type "YuanTokenizer" \
--tokenizer-model-path $TOKENIZER_MODEL_PATH \
--human_eval_datapath ./datasets/HUMANEVAL/${DATASET} \
--textprompts_datapath ./datasets/HUMANEVAL/${PROMPT} \
--distributed-backend nccl \
--num_samples_per_task 1 \
--max_len $MAX_LENGTH \
--output_path $OUTPUT_PATH \
--load $CHECKPOINT_PATH 2>&1 | tee ${LOG_PATH}/eval_${NODE_RANK}_${CASE_NAME}.log
evaluate_functional_correctness -p datasets/HUMANEVAL/${DATASET} ${OUTPUT_PATH}/samples.jsonl 2>&1 | tee ${OUTPUT_PATH}/result.txt