Skip to content

test_analyzer_bert runs into assertion failure when ngraph is used #17147

@LeoZhao-Intel

Description

@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_bert --infer_model=./third_party/inference_demo/bert_emb128/model --infer_data=./third_party/inference_demo/bert_emb128/data.txt --gtest_filter=Analyzer_bert.profile --paddle_num_threads=1 --repeat=1 --batch_size=8 --use_ngraph --use_analysis=false

Describe your current behavior
program will get assertion failure as shown below

I0429 09:59:54.162081 36591 tester_helper.h:327] Thread 0, number of threads 1, run 1 times...
unknown file: Failure
C++ exception with description "While validating node 'Broadcast[Broadcast_1365](Max_1364: float{240}) -> (??)' of type 'Broadcast':
Assertion 'get_input_partial_shape(0).compatible(required_input_shape)' failed at /home/leozhao/Paddle/build/third_party/ngraph/src/extern_ngraph/src/ngraph/op/broadcast.cpp:62:
Broadcast argument shape, specified output shape, and axes are incompatible (argument shape: {240}, output shape: Shape{1, 12, 20, 20}, broadcast axes: AxisSet{1})." thrown in the test body.
[  FAILED  ] Analyzer_bert.compare (177 ms)
[----------] 1 test from Analyzer_bert (177 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (177 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] Analyzer_bert.compare

Code to reproduce the issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions