2.3K Star 8.1K Fork 4.3K

GVPMindSpore / mindspore

 / 详情

[ST][MF][llama2_7b][kbk]网络性能generate speed is 84.472达不到0.5的lite性能

DONE
Bug-Report
创建于  
2024-04-26 17:25
name about labels
Bug Report Use this template for reporting a bug kind/bug

Describe the current behavior / 问题描述 (Mandatory / 必填)

llama2_7b网络在910B环境走KBK流程,性能达不到0.5的lite性能
模型仓地址:https://gitee.com/mindspore/mindformers/blob/dev/docs/model_cards/llama2.md

Environment / 环境信息 (Mandatory / 必填)

  • Hardware Environment(Ascend/GPU/CPU) / 硬件环境:

Please delete the backend not involved / 请删除不涉及的后端:
/device ascend

  • Software Environment / 软件环境 (Mandatory / 必填):
    -- MindSpore version (e.g., 1.7.0.Bxxx) :
    -- Python version (e.g., Python 3.7.5) :
    -- OS platform and distribution (e.g., Linux Ubuntu 16.04):
    -- GCC/Compiler version (if compiled from source):

【CANN版本】:Milan_C17/20240414
【MindSpore版本】:master_B020
【MindFormers版本】:master_B020

  • Excute Mode / 执行模式 (Mandatory / 必填)(PyNative/Graph):

Please delete the mode not involved / 请删除不涉及的模式:
/mode pynative
/mode graph

Related testcase / 关联用例 (Mandatory / 必填)

用例仓地址:MindFormers_Test/cases/llama2/7b/infer/
用例:
test_mf_llama2_7b_kbk_infer_alpaca_batch_incremental_1p_0001

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

  1. get code from mindformers
  2. cd mindformers
  3. export GRAPH_OP_RUN=1;export MS_ENABLE_INTERNAL_KERNELS=on;export ASCEND_HOME_PATH=/usr/local/Ascend/latest
    python llama2_generate.py --model_type llama2_7b "
    " --yaml_file {1} "
    "--use_past True --device_id={2} --checkpoint_path
    {3}/llama2/eval/llama2_7b.ckpt "
    "--batch_size {4}
  4. 验证网络性能是否可以达到0.5的lite

Describe the expected behavior / 预期结果 (Mandatory / 必填)

网络性能可以达到0.5的lite

Related log / screenshot / 日志 / 截图 (Mandatory / 必填)

2024-04-26 01:29:13,241 - mindformers[mindformers/generation/text_generator.py:881] - INFO - total time: 59.58512878417969 s; generated tokens: 2010 tokens; generate speed: 33.73324923539765 tokens/s
2024-04-26 01:29:37,382 - mindformers[mindformers/generation/text_generator.py:881] - INFO - total time: 24.015976428985596 s; generated tokens: 2010 tokens; generate speed: 83.69428600762913 tokens/s
2024-04-26 01:30:01,670 - mindformers[mindformers/generation/text_generator.py:881] - INFO - total time: 24.162757873535156 s; generated tokens: 2010 tokens; generate speed: 83.18586853868618 tokens/s

Special notes for this issue/备注 (Optional / 选填)

走给谭纬城

评论 (8)

zhangjie18 创建了Bug-Report
zhangjie18 添加了
 
kind/bug
标签
zhangjie18 添加了
 
v2.3.0.rc2
标签
zhangjie18 添加了
 
attr/performance
标签
zhangjie18 添加了
 
stage/perf-tuning
标签
zhangjie18 添加了
 
sig/mslite
标签
zhangjie18 添加了
 
device/ascend
标签
zhangjie18 添加协作者xiangminshan
展开全部操作日志

Please assign maintainer to check this issue.
请为此issue分配处理人。
@zhangjie18

感谢您的提问,您可以评论//mindspore-assistant更快获取帮助:

  1. 如果您刚刚接触MindSpore,或许您可以在教程找到答案
  2. 如果您是资深Pytorch用户,您或许需要:
  1. 如果您遇到动态图问题,可以设置set_context(pynative_synchronize=True)查看报错栈协助定位
  2. 模型精度调优问题可参考官网调优指南
  3. 如果您反馈的是框架BUG,请确认您在ISSUE中提供了MindSpore版本、使用的后端类型(CPU、GPU、Ascend)、环境、训练的代码官方链接以及可以复现报错的代码的启动方式等必要的定位信息
  4. 如果您已经定位出问题根因,欢迎提交PR参与MindSpore开源社区,我们会尽快review
wangxingyan 添加协作者wangxingyan
wangxingyan 负责人wangxingyan 修改为tan-wei-cheng

包含这个PR:!68744:fix nan for kbk

预热之后:total time: 5.655386209487915 s; generated tokens: 1972 tokens; generate speed: 348.6941345741551 tokens/s

i-robot 添加了
 
gitee
标签

batch size: 8,请测试修复llama2_generate.py脚本

已经和测试对齐,脚本的batch size输入为4,需要改为8才符合情况

lama网络FO是冯浩,冯浩验证完llama系列没问题,就可以走单。

tan-wei-cheng 负责人tan-wei-cheng 修改为冯浩
i-robot 添加了
 
onebox
标签
冯浩 里程碑B-SIG-MSLite 修改为B-SolutionTest
冯浩 添加了
 
rca/codelogic
标签
冯浩 添加了
 
rct/newfeature
标签
冯浩 添加了
 
ctl/testcismoke
标签
冯浩 任务状态TODO 修改为VALIDATION
冯浩 添加协作者冯浩
冯浩 负责人冯浩 修改为zhangjie18

回归版本:
mindformers:dev_20240505 9:00代码
mindspore 2.3.0 master_20240505061518_ba6602334a0da86f5
run包:Milan_C17/20240414

回归步骤:参考issue复现步骤
基本功能:问题已解决
seq_length=512推理命令

export GRAPH_OP_RUN=1;export MS_ENABLE_INTERNAL_KERNELS=on;export ASCEND_HOME_PATH=/usr/local/Ascend/latest;export MS_ENABLE_LCCL=1;export MS_ENABLE_LCCL=1 && cd /home/jenkins0/zjc/MindFormers_Test/cases/llama2/7b/infer/test_mf_llama2_7b_kbk_infer_alpaca_incremental_1p_0001;python llama_generate.py --model_type llama2_7b   --yaml_file /home/jenkins0/zjc/MindFormers_Test/cases/llama2/7b/infer/test_mf_llama2_7b_kbk_infer_alpaca_incremental_1p_0001/configs/llama2/predict_llama2_7b.yaml  --use_past True   --checkpoint_path /home/workspace/large_model_ckpt//llama2/7b/llama2_7b.ckpt --batch_size 8

推理性能

2024-05-05 10:55:22,724 - mindformers[mindformers/generation/text_generator.py:886] - INFO - total time: 24.29969334602356 s; generated tokens: 4032 tokens; generate speed: 165.92801985543588 tokens/s

测试结论:回归通过
回归人员:zhongjicheng
回归时间: 2024-05-05

i-robot 添加了
 
llama2/7b
标签
zhongjicheng 任务状态VALIDATION 修改为DONE

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(7)
11016979 xiangmd 1654824581
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore

搜索帮助