Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • Paddle
  • Issue
  • #17157

P
Paddle
  • 项目概览

PaddlePaddle / Paddle
大约 2 年 前同步成功

通知 2325
Star 20933
Fork 5424
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 1423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
Paddle
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 1,423
    • Issue 1,423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
    • 合并请求 543
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 4月 29, 2019 by saxon_zh@saxon_zhGuest

test_analyzer_transformer runs into assertion failure when ngraph is used

Created by: LeoZhao-Intel

System information -PaddlePaddle branch: develop

-CPU: Yes

-GPU: No

-OS Platform: Linux

-Cmake orders: cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_DSO=ON -DWITH_AMD_GPU=OFF -DWITH_DISTRIBUTE=ON -DWITH_MKL=ON -DWITH_NGRAPH=ON -DWITH_AVX=ON -DWITH_GOLANG=OFF -DWITH_PYTHON=ON -DWITH_TESTING=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DWITH_CONTRIB=ON -DWITH_INFERENCE_API_TEST=ON -DPY_VERSION=2.7 -DWITH_JEMALLOC=OFF -DWITH_GRPC=ON

To Reproduce run cmd below: ./paddle/fluid/inference/tests/api/test_analyzer_transformer --infer_model=./third_party/inference_demo/transformer/model --infer_data=third_party/inference_demo/transformer/data.txt --batch_size=8 --num_threads=1 --gtest_filter=Analyzer_Transformer.profile --repeat=1 --use_ngraph --use_analysis=false

Describe your current behavior Attention: This issue happens only after Issue #17147 (closed) gets fixed by PR #17148, otherwise you will meet Issue #17147 (closed) first

program will get assertion failure as shown below

C++ exception with description "While validating node 'Dot[Dot_23034](Reshape_23033: float{8,1024}, Parameter_23027: undefined{1024,1024}) -> (??)' of type 'Dot':
Assertion 'element::Type::merge(result_et, get_input_element_type(0), get_input_element_type(1))' failed at /home/leozhao/Paddle/build/third_party/ngraph/src/extern_ng
raph/src/ngraph/op/dot.cpp:53:
Arguments do not have the same element type (arg0 element type: element::Type{32, 1, 1, 0, "float"}, arg1 element type: element::Type{18446744073709551615, 0, 0, 0, "u
ndefined"})." thrown in the test body.

By my investigation, this issue is caused by block, some variables only defined in block(0), while in this path, original ops are in block(1), and ngraph can't find variables in block description. see below code

void NgraphEngine::GetNgInputShape() {
  for (auto& var_name : var_in_) {
    auto* var = scope_.FindVar(var_name);
    if (var && var->IsType<framework::LoDTensor>()) {
      auto* tensor_pd = GetLoDTensorOrSelectedRowsValueFromVar(*var);
      auto sp = Ddim2Shape(tensor_pd->dims());
      auto ng_type = var_type_map_[var_name];
      auto prm = std::make_shared<ngraph::op::Parameter>(ng_type, sp, true);
      (*var_node_map_)[var_name] = prm;
      (*var_in_node_map_)[var_name] = prm;
    }
  }
}

var_type_map_[var_name] returns "undefined" type. To solve this issue, I think there may have 2 potential options:

  1. depending on framework feature block(0/1) support in paddlepaddle, then add similar support in ngraph, it is also transformer common requirement to baidu folks for DO.
  2. add block(0) into ngraph bridge as well when ctx->block_id_ ==1 in paddle::operators::NgraphEngine::FuseNgraphOps(), but not sure if it can really works
指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/Paddle#17157
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7