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] vit fuse pass (5d->4d) #9583

Merged
merged 3 commits into from
Oct 24, 2022

Conversation

zhupengyang
Copy link
Collaborator

@zhupengyang zhupengyang commented Oct 21, 2022

  • 部分硬件算子对 5 维支持不全面,导致 vit 模型里面部分结构会挂。增加 pass 转换维等价的 4 维运算
***************************************************
A repeating structure in "vit" model
1. Origin subgraph:
                reshape (3D->5D)
                        |
                transpose (5D->5D)
                        |
    |-------------------|-------------------|
slice(5D->5D)      slice(5D->5D)      slice(5D->5D)
    |                   |                   |
squeeze(5D->4D)    squeeze(5D->4D)    squeeze(5D->4D)
***************************************************
2. Optimized subgraph:
                reshape (3D->4D)
                        |
                transpose (4D->4D)
                        |
    |-------------------|-------------------|
slice(4D->4D)      slice(4D->4D)      slice(4D->4D)
***************************************************
  • 增加 subgraph 对 lod 的支持(仅支持固定的 shape)
  • 修复文档错误

@paddle-bot
Copy link

paddle-bot bot commented Oct 21, 2022

Thanks for your contribution!

@zhupengyang zhupengyang changed the title vit fuse pass (5d->4d) [NNAdapter] vit fuse pass (5d->4d) Oct 21, 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

@zhupengyang zhupengyang merged commit c54bccb into PaddlePaddle:develop Oct 24, 2022
@zhupengyang zhupengyang deleted the idg_ocr branch October 24, 2022 12:32
zhupengyang added a commit to zhupengyang/Paddle-Lite that referenced this pull request Oct 27, 2022
* [NNAdapter] set output lod according to input lod

* [NNAdapter] slice support EndsTensorList

 * [NNAdapter] fuse pass (5d->4d)
zhupengyang added a commit that referenced this pull request Oct 31, 2022
* windows ci fix (#9559)

* [NNAdapter] support device data (#9493)

* [QualcommQnn] support exp, log, reduce_mean, reduce_max, reduce_sum, floor (#9505)

* [QualcommQnn] add ops (#9538)

support fusion_elementwise_mul_activation, fusion_elementwise_sub_activation, fusion_elementwise_div_activation, fusion_elementwise_min_activation, fusion_elementwise_max_activation, fusion_elementwise_pow_activation, instance_norm, prelu, arg_max, arg_min, flatten, flatten2, norm

* [NNAdapter] support vit model (#9583)

* [NNAdapter] set output lod according to input lod

* [NNAdapter] slice support EndsTensorList

 * [NNAdapter] fuse pass (5d->4d)

* fix cmake cxx flags (#9467)
QShiX pushed a commit to QShiX/Paddle-Lite that referenced this pull request Nov 18, 2022
* [NNAdapter] set output lod according to input lod

* [NNAdapter] slice support EndsTensorList

 * [NNAdapter] fuse pass (5d->4d)
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.

2 participants