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,\"typical_p\":0.9,\"seed\":1234,\"repetition_penalty\":1,\"watermark\":true}' benchmark \ --DatasetPath "/{数据集路径}/GSM8K/" \ --DatasetType "gsm8k" \ --ModelName llama2-7b \ --ModelPath "/{模型权重路径}/LLaMA3-8B/" \ --TestType engine \ --Tokenizer True \ --Concurrency 128 \ --MaxOutputLen 512 \ --DoSampling True \ --SamplingParams=$SMPL_PARAM
Engine文本推理模式输出结果如图1所示:
# Engine模式 文本推理 benchmark \ --DatasetPath "/{数据集路径}/CEval" \ --DatasetType "ceval" \ --ModelName "baichuan2_13b" \ --ModelPath "/{模型权重路径}/baichuan2-13b" \ --TestType engine \ --Concurrency 50 \ --MaxOutputLen 512 \ --Tokenizer True
样例如下所示:
benchmark \ --DatasetPath "/{数据集路径}/CEval" \ --DatasetType "ceval" \ --ModelName "baichuan2_13b" \ --ModelPath "/{模型权重路径}/baichuan2-13b" \ --TestType engine \ --Concurrency 1 \ --MaxOutputLen 20 \ --Tokenizer True \ --TestAccuracy True