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

[Fix] Optimize preprocess & fix pontential use-after-free #229

Merged
merged 12 commits into from
Mar 28, 2022

Conversation

lzhangzz
Copy link
Collaborator

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.

Modification

  • keep a copy of intermediate Tensor/Mat if possible.
  • otherwise insert a sync operation to avoid use-after-free
  • replace per-transformation sync with a final sync in Compose

BC-breaking (Optional)

None (hopefully)

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.

@lzhangzz lzhangzz requested review from lvhan028 and irexyc March 10, 2022 12:39
@lzhangzz lzhangzz changed the title [Fix] Optimize preprocess & fix pontential use-after-free bugs [Fix] Optimize preprocess & fix pontential use-after-free Mar 10, 2022
@lzhangzz lzhangzz changed the base branch from master to dev-v0.4.0 March 10, 2022 12:56
@codecov
Copy link

codecov bot commented Mar 10, 2022

Codecov Report

Merging #229 (6c356c0) into master (6948e3d) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

❗ Current head 6c356c0 differs from pull request most recent head 2c64e51. Consider uploading reports for the commit 2c64e51 to get more accurate results

@@            Coverage Diff             @@
##           master     #229      +/-   ##
==========================================
- Coverage   66.83%   66.82%   -0.02%     
==========================================
  Files         190      190              
  Lines        6292     6293       +1     
  Branches      981      981              
==========================================
  Hits         4205     4205              
- Misses       1778     1779       +1     
  Partials      309      309              
Flag Coverage Δ
unittests 66.82% <0.00%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
mmdeploy/backend/sdk/wrapper.py 0.00% <0.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 6948e3d...2c64e51. Read the comment docs.

Copy link
Collaborator

@irexyc irexyc left a comment

Choose a reason for hiding this comment

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

LGTM

@lvhan028
Copy link
Collaborator

Please merge to master branch, and add SyncOnScopeExit for DefaultFormatBundle

@lvhan028 lvhan028 changed the base branch from dev-v0.4.0 to master March 25, 2022 15:59
@lzhangzz lzhangzz requested a review from irexyc March 25, 2022 17:19
Copy link
Collaborator

@lvhan028 lvhan028 left a comment

Choose a reason for hiding this comment

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

LGTM

@lvhan028 lvhan028 merged commit 73cf3b5 into open-mmlab:master Mar 28, 2022
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