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

[Feature] add onnx simplify #751

Merged
merged 11 commits into from
Dec 31, 2020
Merged

Conversation

RunningLeon
Copy link
Collaborator

This PR adds mmcv.onnx.simplify module, which is based on onnx-simplifier, an useful tool to simplify and optimize ONNX models.
Because we want to simplify models with MMCV's custom ops, which should be registered before simplifying. Thus, we have to modify source codes from onnx-simplifier, and include them in mmcv repository.
This PR includes:

  1. mmcv.onnx.simplify module;
  2. Simple unit test;
  3. Simple doc;

After this PR merged, pytorch2onnx.py in many projects such as mmdetection could be updated.

@codecov
Copy link

codecov bot commented Dec 23, 2020

Codecov Report

Merging #751 (5b1aca8) into master (741e52d) will decrease coverage by 2.09%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #751      +/-   ##
==========================================
- Coverage   64.77%   62.67%   -2.10%     
==========================================
  Files         136      139       +3     
  Lines        7999     8266     +267     
  Branches     1412     1484      +72     
==========================================
  Hits         5181     5181              
- Misses       2549     2816     +267     
  Partials      269      269              
Flag Coverage Δ
unittests 62.67% <0.00%> (-2.10%) ⬇️

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

Impacted Files Coverage Δ
mmcv/onnx/__init__.py 0.00% <0.00%> (ø)
mmcv/onnx/simplify/__init__.py 0.00% <0.00%> (ø)
mmcv/onnx/simplify/common.py 0.00% <0.00%> (ø)
mmcv/onnx/simplify/core.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 741e52d...5b1aca8. Read the comment docs.

mmcv/onnx/simplify/core.py Outdated Show resolved Hide resolved
docs/onnx.md Outdated Show resolved Hide resolved
@hellock hellock merged commit 83732ec into open-mmlab:master Dec 31, 2020
@RunningLeon RunningLeon deleted the onnx_simplify branch December 31, 2020 11:39
@daquexian
Copy link

Hi @RunningLeon , thanks for your excellent work! I'm the maintainer of onnx-simplifier (and onnx optimizer). Will it help if I support custom op registration in onnx-simplifier? mmcv will benefit from the future update of onnx-simplifier if it directly uses onnx-simplifier package.

@RunningLeon
Copy link
Collaborator Author

Hi, @daquexian,
Very glad to hear from you. Totally agree with you! It would definitely benefit a lot if onnx-simplifier supports customer ops registration in the future.
Thanks.

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.

3 participants