210 Star 862 Fork 640

GVPMindSpore/mindscience

 / 详情

esm性能异常

REJECTED
Bug-Report
创建于  
2022-12-15 23:40
  1. 【Document Link】/【文档链接】
    https://gitee.com/lytgogogo/mindscience/blob/master/MindSPONGE/applications/research/esm/src/gvp_utils.py

  2. 【Issues Section】/【问题文档片段】
    该文件flatten_graph函数的tensor to numpy以及后续过程。
    问题文档片段

  3. 【Existing Issues】/【存在的问题】
    Esm模型训练过程较慢,花费时间过长。以下为原因分析以及性能异常报告。
    Esm模型每个step训练时间在GPU中和昇腾910中性能对比如下:
    GPU:
    GPU
    昇腾910:
    昇腾910

昇腾910profiling:计算时间较长的算子均转为了float16进行运算。CPU.NPU时间均正常。
CPU耗时:78.16ms
NPU算子总耗时:1747.94ms
运算结果

模型性能较差原因:
在gvp_utils中存在tensor to numpy的转换:
tensor to numpy

该过程只能转换为numpy进行。且存在动态shape问题:模型的edge_embedding过程需要调用flatten_graph函数。该函数以及该过程存在张量尺寸变化问题。
该问题导致模型无法转为静态图测试。

尝试解决方案:
尝试通过ops.nonzero()产生mask序号,并通过序号实现动态shape过程的平替。
尝试方案

该平替过程在gvp_utils的单个函数中可达到相同的效果,但在网络中由于nonzero会产生某一维度的shape为-1,该问题会导致网络后续无法继续计算,并导致大量报错。

ValueError: For 'Concat', element1 shape in input can not concat with element0. To perform concat in the axis 0 direction, except for the 0th axis, all other axes must have the same shape. But got element1_shape[0]: -1, element0_shape[0]: 16470.
报错原因

  1. 【Expected Result】【预期结果】
    昇腾910性能与GPU保持相当,并可以转换为静态图运算。

评论 (2)

lytgogogo 创建了Question
fangwenyi 任务状态TODO 修改为ACCEPTED
展开全部操作日志

你好,问题收到,我们已安排人员分析

fangwenyi 关联项目设置为MindSpore Issue Assistant
fangwenyi 任务类型Question 修改为Bug-Report
fangwenyi 添加了
 
mindspore-assistant
标签
fangwenyi 负责人设置为mamba_ni
fangwenyi 任务状态ACCEPTED 修改为REJECTED

登录 后才可以发表评论

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

搜索帮助

344bd9b3 5694891 D2dac590 5694891