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

Improve ncnn patch embed #592

Merged
merged 4 commits into from
Jun 15, 2022

Conversation

tpoisonooo
Copy link
Collaborator

@tpoisonooo tpoisonooo commented Jun 12, 2022

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily receiving feedbacks. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

  • improve patch embed, remove redundant onnx shape opr

Modification

  • rewrite patch embed

before:

  flowchart  TD;
      conv-->shape;
      shape-->slice;
      slice-->concat;
      concat-->reshape;
      conv-->reshape;
Loading

after:

  flowchart  TD;
      conv-->reshape;
Loading
  • if get_onnx2ncnn_path failed, give more tips

  • fix-typo

BC-breaking (Optional)

Does the modification introduce changes that break the backward-compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has a dependency on downstream projects of a newer version, this PR should be tested with all supported versions of downstream projects.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@grimoire
Copy link
Member

How to generate the graph in this PR? Looks cool.

@tpoisonooo
Copy link
Collaborator Author

How to generate the graph in this PR? Looks cool.

Just markdown.

“ ```mermaid

” flowchart TD;

“ conv-->reshape;

” ```

@codecov
Copy link

codecov bot commented Jun 14, 2022

Codecov Report

Merging #592 (de6a58f) into master (e84bc30) will decrease coverage by 0.04%.
The diff coverage is 30.76%.

@@            Coverage Diff             @@
##           master     #592      +/-   ##
==========================================
- Coverage   57.42%   57.38%   -0.05%     
==========================================
  Files         258      259       +1     
  Lines        8561     8574      +13     
  Branches     1279     1281       +2     
==========================================
+ Hits         4916     4920       +4     
- Misses       3292     3301       +9     
  Partials      353      353              
Flag Coverage Δ
unittests 57.38% <30.76%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmdeploy/utils/utils.py 52.94% <ø> (ø)
mmdeploy/mmcv/ops/transformer.py 25.00% <25.00%> (ø)
mmdeploy/mmcv/ops/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e84bc30...de6a58f. Read the comment docs.

@tpoisonooo tpoisonooo changed the title Improve ncnn patch embed WIP: Improve ncnn patch embed Jun 14, 2022
@tpoisonooo tpoisonooo changed the title WIP: Improve ncnn patch embed Improve ncnn patch embed Jun 14, 2022
@lvhan028 lvhan028 merged commit a228f95 into open-mmlab:master Jun 15, 2022
grimoire pushed a commit to grimoire/mmdeploy that referenced this pull request Jun 25, 2022
* improvement(PatchEmbed): use reshape instead of flatten

* improvement(init_plugins.py): get onnx2ncnn path

* fix(CI): build error

* fix(CI): revert get onnx2ncnn path
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