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: dynamic convert onnx model to fp16 during start session #876

Merged
merged 14 commits into from
Dec 12, 2022

Conversation

OrangeSodahub
Copy link
Contributor

@OrangeSodahub OrangeSodahub commented Dec 8, 2022

Fix:

  • conversion of onnx to fp16 will cover the original model file

Changes:

  • move the converter from __init__() to start_session, using tmp_dir to do the conversion.
  • Add test for onnx zip+fp16.

@codecov
Copy link

codecov bot commented Dec 8, 2022

Codecov Report

Merging #876 (78fa087) into main (1fe3a5a) will decrease coverage by 11.37%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##             main     #876       +/-   ##
===========================================
- Coverage   83.12%   71.74%   -11.38%     
===========================================
  Files          22       22               
  Lines        1529     1529               
===========================================
- Hits         1271     1097      -174     
- Misses        258      432      +174     
Flag Coverage Δ
cas 71.74% <100.00%> (-11.38%) ⬇️

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

Impacted Files Coverage Δ
server/clip_server/executors/clip_onnx.py 87.91% <100.00%> (+1.09%) ⬆️
server/clip_server/model/clip_onnx.py 87.30% <100.00%> (+20.63%) ⬆️
server/clip_server/executors/clip_tensorrt.py 0.00% <0.00%> (-94.60%) ⬇️
server/clip_server/model/clip_trt.py 0.00% <0.00%> (-85.72%) ⬇️
server/clip_server/model/trt_utils.py 0.00% <0.00%> (-83.52%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

server/clip_server/model/clip_onnx.py Outdated Show resolved Hide resolved
server/clip_server/model/clip_onnx.py Outdated Show resolved Hide resolved
server/clip_server/model/clip_onnx.py Outdated Show resolved Hide resolved
server/clip_server/model/clip_onnx.py Outdated Show resolved Hide resolved
server/clip_server/model/clip_onnx.py Outdated Show resolved Hide resolved
server/clip_server/model/clip_onnx.py Outdated Show resolved Hide resolved
@OrangeSodahub OrangeSodahub marked this pull request as ready for review December 9, 2022 04:58
tests/conftest.py Outdated Show resolved Hide resolved
@github-actions github-actions bot added size/s and removed size/m labels Dec 9, 2022
@OrangeSodahub OrangeSodahub force-pushed the fix-onnx-fp16-converter branch from 8bbd4fa to 78fa087 Compare December 9, 2022 10:14
@OrangeSodahub OrangeSodahub requested a review from ZiniuYu December 9, 2022 10:45
@ZiniuYu ZiniuYu changed the title fix: onnx fp16 converter fix: dynamic convert onnx model to fp16 during start session Dec 12, 2022
Copy link
Member

@ZiniuYu ZiniuYu left a comment

Choose a reason for hiding this comment

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

LGTM

@ZiniuYu ZiniuYu merged commit 0b293ec into main Dec 12, 2022
@ZiniuYu ZiniuYu deleted the fix-onnx-fp16-converter branch December 12, 2022 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants