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

Support custom operators cummax and cummin for onnxruntime #1010

Merged
merged 17 commits into from
May 10, 2021

Conversation

v-qjqs
Copy link
Contributor

@v-qjqs v-qjqs commented May 1, 2021

Hi, this PR tries to implement custom operator mmcv::cummax and mmcv::cummin, which supports to export torch.cummax and torch.cummin to onnx format, and run it with onnxruntime.
mmcv::cummax is a more general operation and an extension to previous mmcv::CornerPool, since the former supports arbitrary tensor shapes while the latter only supports for 4-D input tensor.
Based on the customized mmcv::cummax and mmcv::CornerPool operation, CornerNet in MMDet might be exportable to onnx for various pytorch version.

v-qjqs added 3 commits May 1, 2021 15:26

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov
@codecov
Copy link

codecov bot commented May 1, 2021

Codecov Report

Merging #1010 (eb03b51) into master (db6b054) will decrease coverage by 0.01%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1010      +/-   ##
==========================================
- Coverage   64.57%   64.56%   -0.02%     
==========================================
  Files         152      152              
  Lines        9792     9800       +8     
  Branches     1779     1780       +1     
==========================================
+ Hits         6323     6327       +4     
- Misses       3141     3144       +3     
- Partials      328      329       +1     
Flag Coverage Δ
unittests 64.56% <50.00%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
mmcv/ops/corner_pool.py 51.35% <0.00%> (-1.43%) ⬇️
mmcv/ops/nms.py 45.65% <ø> (ø)
mmcv/onnx/symbolic.py 41.37% <66.66%> (+0.77%) ⬆️

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 db6b054...eb03b51. Read the comment docs.

v-qjqs added 8 commits May 1, 2021 18:23

Verified

This commit was signed with the committer’s verified signature.
rsmontero Ruben S. Montero

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov
mmcv/ops/csrc/onnxruntime/cpu/reduce_ops.cpp Show resolved Hide resolved
mmcv/ops/nms.py Outdated Show resolved Hide resolved
tests/test_ops/test_onnx.py Outdated Show resolved Hide resolved
tests/test_ops/test_onnx.py Outdated Show resolved Hide resolved
v-qjqs added 2 commits May 6, 2021 21:54

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov
Copy link
Member

@grimoire grimoire left a comment

Choose a reason for hiding this comment

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

LGTM! @ZwwWayne

@RunningLeon RunningLeon requested a review from ZwwWayne May 10, 2021 03:32

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov
v-qjqs added 3 commits May 10, 2021 19:04

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov

Verified

This commit was signed with the committer’s verified signature.
atodorov-storpool Anton Todorov
@ZwwWayne ZwwWayne merged commit 934b549 into open-mmlab:master May 10, 2021
@ZwwWayne ZwwWayne mentioned this pull request May 10, 2021
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants