source /usr/local/Ascend/ascend-toolkit/set_env.sh # CANN
source /usr/local/Ascend/nnal/atb/set_env.sh # ATB
source /usr/local/Ascend/llm_model/set_env.sh # ATB Models
source /usr/local/Ascend/mindie/set_env.sh # MindIE
# Engine模式 文本推理
SMPL_PARAM='{"temperature":0.5,"top_k":10,"top_p":0.9,"seed":1234,"repetition_penalty":1}'
benchmark \
--DatasetPath "/{数据集路径}/GSM8K/" \
--DatasetType gsm8k \
--ModelName LLaMA3-8B \
--ModelPath "/{模型权重路径}/LLaMA3-8B/" \
--TestType engine \
--Tokenizer True \
--MaxOutputLen 512 \
--DoSampling True \
--SamplingParams=$SMPL_PARAM
Engine文本推理模式输出结果如图1所示:
# Engine模式 文本推理
benchmark \
--DatasetPath "/{数据集路径}/GSM8K" \
--DatasetType gsm8k \
--ModelName baichuan2_13b \
--ModelPath "/{模型权重路径}/baichuan2-13b" \
--TestType engine \
--MaxOutputLen 512 \
--Tokenizer True
样例如下所示:
benchmark \
--DatasetPath "/{数据集路径}/GSM8K" \
--DatasetType gsm8k \
--ModelName baichuan2_13b \
--ModelPath "/{模型权重路径}/baichuan2-13b" \
--TestType engine \
--MaxOutputLen 20 \
--Tokenizer True \
--TestAccuracy True