Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NNAdapter][Ascend] Support transformer model #8594

Merged
merged 5 commits into from
Mar 22, 2022

Conversation

shentanyue
Copy link
Collaborator

No description provided.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Mar 8, 2022

Thanks for your contribution!

lite/core/optimizer/mir/ssa_graph.h Outdated Show resolved Hide resolved
lite/core/optimizer/optimizer.cc Outdated Show resolved Hide resolved
lite/operators/elementwise_ops.cc Outdated Show resolved Hide resolved
lite/operators/range_op.cc Outdated Show resolved Hide resolved
@@ -35,7 +35,15 @@ bool ReshapeOp::InferShapeImpl() const {
if (shape_tensor_vct.size() > 0) {
final_shape.resize(shape_tensor_vct.size());
for (size_t i = 0; i < shape_tensor_vct.size(); i++) {
final_shape[i] = shape_tensor_vct[i]->data<int>()[0];
if (shape_tensor_vct[i]->dims().empty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个部分pengyang再看看

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是否有这种情况发生呢?理论上shape_tensor_vct中的tensor是不允许为空的,如果为空那么多半是模型的问题,尽量从模型上去解决比较好

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是transformer控制流模型出现的场景。确实会出现为空的情况。

lite/operators/write_back_op.cc Outdated Show resolved Hide resolved
@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Mar 17, 2022
@PaddlePaddle PaddlePaddle unlocked this conversation Mar 17, 2022
@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Mar 17, 2022
@PaddlePaddle PaddlePaddle unlocked this conversation Mar 17, 2022
Copy link
Collaborator

@hong19860320 hong19860320 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hong19860320 hong19860320 merged commit dbcee05 into PaddlePaddle:develop Mar 22, 2022
@shentanyue shentanyue deleted the add_transformer branch March 22, 2022 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants