Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
Signed-off-by: intellinjun <jun.lin@intel.com>
  • Loading branch information
intellinjun committed May 22, 2024
1 parent 647442e commit 719ce59
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
26 changes: 16 additions & 10 deletions tests/model-test/calculate_percentiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,26 @@ def parse_output_file(file_path):
return predictions

def parse_output_file_acc(file_path):
accuracy = []
accuracy=[0,0,0,0]
with open(file_path, 'r', encoding='UTF-8', errors='ignore') as file:
for line in file:
accuracy_match = re.search(r"\|\s+\|\s+\|none\s+\|\s+0\|acc\s+\|\d\.\d+\|\±\s+\|\d\.\d+\|", line)
if accuracy_match==None:
accuracy_match = re.search(r"\|\s+boolq+\|\s+2\|none\s+\|\s+0\|acc\s+\|\d\.\d+\|\±\s+\|\d\.\d+\|", line)
if accuracy_match==None:
accuracy_match = re.search(r"\|\s+piqa+\|\s+1\|none\s+\|\s+0\|acc\s+\|\d\.\d+\|\±\s+\|\d\.\d+\|", line)
if accuracy_match==None:
accuracy_match= re.search(r"\|\s+hellaswag+\|\s+1\|none\s+\|\s+0\|acc\s+\|\d\.\d+\|\±\s+\|\d\.\d+\|", line)
if accuracy_match:
accuracy.append(float(re.search(r"\d+\.\d+", accuracy_match.group()).group())*100)
if len(accuracy)==0:
accuracy=[0,0,0,0]
accuracy[0]=float(re.search(r"\d+\.\d+", accuracy_match.group()).group())*100
continue
accuracy_match = re.search(r"\|\s+boolq+\|\s+2\|none\s+\|\s+0\|acc\s+\|\d\.\d+\|\±\s+\|\d\.\d+\|", line)
if accuracy_match:
accuracy[1]=float(re.search(r"\d+\.\d+", accuracy_match.group()).group())*100
continue
accuracy_match = re.search(r"\|\s+piqa+\|\s+1\|none\s+\|\s+0\|acc\s+\|\d\.\d+\|\±\s+\|\d\.\d+\|", line)
if accuracy_match:
accuracy[2]=float(re.search(r"\d+\.\d+", accuracy_match.group()).group())*100
continue
accuracy_match= re.search(r"\|\s+hellaswag+\|\s+1\|none\s+\|\s+0\|acc\s+\|\d\.\d+\|\±\s+\|\d\.\d+\|", line)
if accuracy_match:
accuracy[3]=float(re.search(r"\d+\.\d+", accuracy_match.group()).group())*100
continue

return accuracy

def parse_memory_file(memory_file):
Expand Down
10 changes: 5 additions & 5 deletions tests/model-test/cpp_graph_inference.sh
Original file line number Diff line number Diff line change
Expand Up @@ -466,11 +466,11 @@ function main() {
monitor
if [[ ${input} == "1024" || ${cores_per_instance} == "32" ]]; then
echo "-------- Accuracy start--------"
if [[ "${model}" == "llama"* || "${model}" == "gptj-6b" ]]; then
python ./scripts/cal_acc.py --model_name ${model_path} --init_from_bin ${model}-${precision}.bin --batch_size 8 --tasks lambada_openai,boolq,piqa,hellaswag 2>&1 | tee -a ${WORKING_DIR}/${logs_file}
else
python ./scripts/cal_acc.py --model_name ${model_path} --init_from_bin ${model}-${precision}.bin --tasks lambada_openai,boolq,piqa,hellaswag --batch_size 1 2>&1 | tee -a ${WORKING_DIR}/${logs_file}
fi
# if [[ "${model}" == "llama"* || "${model}" == "gptj-6b" ]]; then
# python ./scripts/cal_acc.py --model_name ${model_path} --init_from_bin ${model}-${precision}.bin --batch_size 8 --tasks lambada_openai,boolq,piqa,hellaswag 2>&1 | tee -a ${WORKING_DIR}/${logs_file}
# else
# python ./scripts/cal_acc.py --model_name ${model_path} --init_from_bin ${model}-${precision}.bin --tasks lambada_openai,boolq,piqa,hellaswag --batch_size 1 2>&1 | tee -a ${WORKING_DIR}/${logs_file}
# fi
else
echo "-------- Accuracy End --------"
fi
Expand Down

0 comments on commit 719ce59

Please sign in to comment.