-
Notifications
You must be signed in to change notification settings - Fork 135
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
Add multi-threading option to ModelTransform and SAMBboxToInstanceMask #1145
Add multi-threading option to ModelTransform and SAMBboxToInstanceMask #1145
Conversation
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## releases/1.5.0 #1145 +/- ##
==================================================
+ Coverage 79.92% 79.99% +0.06%
==================================================
Files 265 266 +1
Lines 29895 29967 +72
Branches 5889 5901 +12
==================================================
+ Hits 23895 23971 +76
+ Misses 4641 4637 -4
Partials 1359 1359
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
- One of the tests added in #1145 is flaky: https://github.com/openvinotoolkit/datumaro/actions/runs/6156803415/job/16706221640 ```console =========================== short test summary info ============================ FAILED tests/unit/test_util.py::MultiProcUtilTest::test_raise_exception_in_main_thread = 1 failed, 1493 passed, 38 skipped, 2 xfailed, 48148 warnings in 407.34s (0:06:47) = tests-py38-darwin: exit 1 (462.14 seconds) /Users/runner/work/datumaro/datumaro> python -m pytest -v --csv=/Users/runner/work/datumaro/datumaro/.tox/results-tests-py38-darwin.csv tests/unit --cov --cov-report=xml pid=4536 .pkg: _exit> python /Users/runner/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pyproject_api/_backend.py True setuptools.build_meta tests-py38-darwin: FAIL code 1 (793.18=setup[331.04]+cmd[462.14] seconds) evaluation failed :( (803.78 seconds) ``` - This is because `join_timeout` is too short, so that the main thread tries to assert the error logs before they are created. - To fix it, set `join_timeout=None` to wait it infinitely until the producer thread terminates. Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
#1145) - Add multi-threading option (`num_workers > 0`) to `ModelTransform` and `SAMBboxToInstanceMask`. - It is required if the model launcher can take multiple requests at the same time and have high throughput. Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
- One of the tests added in #1145 is flaky: https://github.com/openvinotoolkit/datumaro/actions/runs/6156803415/job/16706221640 ```console =========================== short test summary info ============================ FAILED tests/unit/test_util.py::MultiProcUtilTest::test_raise_exception_in_main_thread = 1 failed, 1493 passed, 38 skipped, 2 xfailed, 48148 warnings in 407.34s (0:06:47) = tests-py38-darwin: exit 1 (462.14 seconds) /Users/runner/work/datumaro/datumaro> python -m pytest -v --csv=/Users/runner/work/datumaro/datumaro/.tox/results-tests-py38-darwin.csv tests/unit --cov --cov-report=xml pid=4536 .pkg: _exit> python /Users/runner/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pyproject_api/_backend.py True setuptools.build_meta tests-py38-darwin: FAIL code 1 (793.18=setup[331.04]+cmd[462.14] seconds) evaluation failed :( (803.78 seconds) ``` - This is because `join_timeout` is too short, so that the main thread tries to assert the error logs before they are created. - To fix it, set `join_timeout=None` to wait it infinitely until the producer thread terminates. Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Summary
num_workers > 0
) toModelTransform
andSAMBboxToInstanceMask
.How to test
Added some tests for this change.
Checklist
License
Feel free to contact the maintainers if that's a concern.