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

Optimize data preprocessing time and enhance overall performance in semantic segmentation #2020

Merged

Conversation

supersoob
Copy link
Contributor

@supersoob supersoob commented Apr 17, 2023

Summary

I implemented to optimize & enhance overall segmentation performance.

What is changed:

  • Remove MaskCompose pipeline (-> reduce data time)
  • Change a class incremental sampler to torch random sampler when no new class (-> make see all samples for sure)
  • Remove repeated ckpt loading when initializing training (-> refactor/remove useless overhead for ckpt loading)

Experimental results:
image
details are in onenote.

How to test

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have added e2e tests for validation.
  • I have added the description of my changes into CHANGELOG in my target branch (e.g., CHANGELOG in develop).​
  • I have updated the documentation in my target branch accordingly (e.g., documentation in develop).
  • I have linked related issues.

License

  • I submit my code changes under the same Apache License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below).
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

@supersoob supersoob added the ENHANCE Enhancement of existing features label Apr 17, 2023
@supersoob supersoob added this to the 1.2.0 milestone Apr 17, 2023
@github-actions github-actions bot added the ALGO Any changes in OTX Algo Tasks implementation label Apr 17, 2023
@supersoob supersoob changed the base branch from develop to releases/1.2.0 April 17, 2023 09:31
@supersoob supersoob changed the title Remove MaskCompose pipeline and change a sampler_flag in semantic segmentation Optimize data preprocessing time and enhance overall performance in semantic segmentation Apr 18, 2023
@github-actions github-actions bot added the DOC Improvements or additions to documentation label Apr 18, 2023
@supersoob supersoob marked this pull request as ready for review April 18, 2023 13:57
@supersoob supersoob requested a review from a team as a code owner April 18, 2023 13:57
@supersoob
Copy link
Contributor Author

Passed local e2e test ->
image

Copy link
Contributor

@sungmanc sungmanc left a comment

Choose a reason for hiding this comment

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

No relation with the implementation, however, you checked like below,
image

However, I couldn't find any tests.

Copy link
Contributor

@goodsong81 goodsong81 left a comment

Choose a reason for hiding this comment

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

Thank you for the small but great enhancement!

@supersoob
Copy link
Contributor Author

No relation with the implementation, however, you checked like below, image

However, I couldn't find any tests.

I checked wrong. But I will add unit tests in other PR. Thanks.

@supersoob supersoob merged commit d2acd51 into openvinotoolkit:releases/1.2.0 Apr 19, 2023
goodsong81 added a commit that referenced this pull request Apr 21, 2023
* HOT-FIX: Revert segmentation model's ignore mode in CLI (#2011)

Revert segmentation ignore=True

* Improve tiling preprocess (#2013)

* prevent timeout during init phase

* Fix reg tests (#2008)

* Edit regression tests

* Change the dataset root

* Miss typo

* Fix pre-commit

* Fix openvino import error due to Tiler init import (#2015)

Remove init import for Tiler to prevent OpenVINO import

* Bump up version to 1.2.0 (#2017)

* Set the python version to "3.10" for code-scan workflow

* Add missing __init__.py (#2019)

* Add missing __init__.py

* Change license

* Release 1.2.0rc1

* Fix issue that str2bool not being applied in certain cases (#2023)

* Add workaround solution

* Fix minor

* Remove str int

* Fix default dict (#2025)

fix: change default to configdict

Signed-off-by: Inhyuk Andy Cho <[email protected]>

* Convert dummy datasets to toy datasets (#1988)

* Update cls, det datsets

* Remove useless files

* Change action datasets

* Edit action dataset

* change dir

* Add xml files

* Remove useless

* Edite tets

* Fix tests

* Fix tests

* Remove ptc

* Remove

* Fix precommit

* Update dataset, fix cls bug

* Remove useless dataset

* Edit drop_last

* Fix missed part

* Change threshold values to unifying

* bugfix: squeezing to 1 dimenetion

* Change threshold for deployment

* Fix multi-gpu issue, e2e tests

* Decrease num_workers for tiling test and tiling processes

* Revert num_workers for tests

* Fix datsets

---------

Co-authored-by: eunwoosh <[email protected]>

* Fix E2E tests (#2032)

* Optimize data preprocessing time and enhance overall performance in semantic segmentation (#2020)

* HOTFIX: change doc version to 1.2.0

* Add storage cache in Apache Arrow format using Datumaro (#2009)

* feat: change label entity to dictionay

* feat: add datumaro arrow cache

* refacor: move to proper directory

* fix: align to the latest

* fix: align data to otx

* fix: align new version

* refactor: disable storage cache for action tasks

* test: fix

* fix: version back

* docs: add to changelog

* fix: keep __height, __width

* docs: add description

* test: revert tests

* fix: revert back to list

* style: ruff

* HOT-FIX: Revert segmentation model's ignore mode in CLI (Develop) (#2012)

Revert segmentation ignore=True

* fix: make force verbose

* test: add storage cache test

* feat: datumaro 1.2.0

* test: test path exists

* test: do deepcopy

* style: make black happy

---------

Signed-off-by: Inhyuk Andy Cho <[email protected]>
Co-authored-by: Harim Kang <[email protected]>

* Fix typo in prediction_to_annotation_converter.py (#2028)

* HOT-FIX: Revert segmentation model's ignore mode in CLI (Develop) (#2012)

Revert segmentation ignore=True

* Bump up version to 1.3.0rc0 (#2016)

* bug fix

* del

* revert

* revert changlog

---------

Co-authored-by: Harim Kang <[email protected]>
Co-authored-by: Songki Choi <[email protected]>

* Fix tiling config loading bug (#2030)

* fix tiling loading bug

* fix mypy

* Make multi gpu child processes done right after evaluation (#2033)

* Fixes in exportable code (#2031)

* Create Actions domain and task type despite flag

* Move import torch to the function

* Fix str in dump_features

* Move dump_frames to otx/api/utils

* Remove __pycache__ from dunped exportable code

* Add tests for demo --output option

* Update sha for exportable code requirements

* Add flag to task_type_to_label_domain

* Roll back tests creation to add it in separate PR

* Add FEATURE_FLAGS_OTX_ACTION_TASKS init in demo.py

* Remove extra comments

* Fix linter

* Add documentation for the noisy label detection feature (#2034)

* Add documentation for noisy label detection feature

Signed-off-by: Kim, Vinnam <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Kim, Vinnam <[email protected]>

* Add documentation

Signed-off-by: Kim, Vinnam <[email protected]>

* Fix typo

Signed-off-by: Kim, Vinnam <[email protected]>

* Fix small typo

---------

Signed-off-by: Kim, Vinnam <[email protected]>
Co-authored-by: Songki Choi <[email protected]>

* Remove skip tests, fix regression tests (#2036)

* Remove skip tests, fix regression tests

* Fix precommit

* Hide internal options from external GUI (#2037)

Signed-off-by: Songki Choi <[email protected]>

* Add unit test for classification task and configurer (#2035)

* Reduce the depth of aumix process (#2038)

Enable light augmix

* Change samples_per_gpu in _infer_model(Detection) (#2041)

Change samples_per_gpu in _infer_model

* Decrease batch size if CUDA OOM occurs (#2022)

* implement adpating bs

* refine impl

* implement adaptive bs also in cls, seg task

* refine adapt bs algo to consider gpu util

* refactor code

* write comment and docstring

* implement decreasig bs on action task

* update learning rate after decreasing batch size

* implement test code of mmcv automatic_bs file

* remove meta modification

* remove unused improt

* implement test code of torch automatic_bs file

* align with pre commit

* add line to tell not supporting anomaly

* update CHANGELOG

* update docs

* change argument help

* change file name

* apply pr comment

* add auto_decrease_bs in learning parameters

* align with pre commit

* fix typo

* add integration test

* bugfix

* update test code

* not execute algo in nncf

* suppor nncf

* apply comment

* align with pre commit

* change method to set value

* refine warning comment

* remove breakpoint

* make hpo not use auto decrease batch size

* refine warning & typo fix

* align with pre commit

* Update CHANGELOG.md

Co-authored-by: Sungman Cho <[email protected]>

* update unit test

* update integration test

* bufix

* Release 1.2.0rc2

Signed-off-by: Songki Choi <[email protected]>

* Update OTX commit hash for exportable code requiements

---------

Signed-off-by: Inhyuk Andy Cho <[email protected]>
Signed-off-by: Kim, Vinnam <[email protected]>
Signed-off-by: Songki Choi <[email protected]>
Co-authored-by: Harim Kang <[email protected]>
Co-authored-by: Eugene Liu <[email protected]>
Co-authored-by: Sungman Cho <[email protected]>
Co-authored-by: Yunchu Lee <[email protected]>
Co-authored-by: Jaeguk Hyun <[email protected]>
Co-authored-by: Inhyuk Cho <[email protected]>
Co-authored-by: eunwoosh <[email protected]>
Co-authored-by: Soobee Lee <[email protected]>
Co-authored-by: Galina Zalesskaya <[email protected]>
Co-authored-by: Vinnam Kim <[email protected]>
sungmanc added a commit that referenced this pull request Apr 25, 2023
* HOT-FIX: Revert segmentation model's ignore mode in CLI (#2011)

Revert segmentation ignore=True

* Improve tiling preprocess (#2013)

* prevent timeout during init phase

* Fix reg tests (#2008)

* Edit regression tests

* Change the dataset root

* Miss typo

* Fix pre-commit

* Fix openvino import error due to Tiler init import (#2015)

Remove init import for Tiler to prevent OpenVINO import

* Bump up version to 1.2.0 (#2017)

* Set the python version to "3.10" for code-scan workflow

* Add missing __init__.py (#2019)

* Add missing __init__.py

* Change license

* Release 1.2.0rc1

* Fix issue that str2bool not being applied in certain cases (#2023)

* Add workaround solution

* Fix minor

* Remove str int

* Fix default dict (#2025)

fix: change default to configdict

Signed-off-by: Inhyuk Andy Cho <[email protected]>

* Convert dummy datasets to toy datasets (#1988)

* Update cls, det datsets

* Remove useless files

* Change action datasets

* Edit action dataset

* change dir

* Add xml files

* Remove useless

* Edite tets

* Fix tests

* Fix tests

* Remove ptc

* Remove

* Fix precommit

* Update dataset, fix cls bug

* Remove useless dataset

* Edit drop_last

* Fix missed part

* Change threshold values to unifying

* bugfix: squeezing to 1 dimenetion

* Change threshold for deployment

* Fix multi-gpu issue, e2e tests

* Decrease num_workers for tiling test and tiling processes

* Revert num_workers for tests

* Fix datsets

---------

Co-authored-by: eunwoosh <[email protected]>

* Fix E2E tests (#2032)

* Optimize data preprocessing time and enhance overall performance in semantic segmentation (#2020)

* add unit test

* exp

* intg agg

* implement ignore label

* no update in model.py

* ignore in label

* only updated ignored loss

* final

* final

* exp

* refactor

* refactor ignore loss

* revert

* default mode is ignore false

* unit test revised

* model update

* revise detcon

* fix error in intg test

* test case revised

* make run in semisl

* add type hints

* update docs

* test case added

---------

Signed-off-by: Inhyuk Andy Cho <[email protected]>
Co-authored-by: Harim Kang <[email protected]>
Co-authored-by: Eugene Liu <[email protected]>
Co-authored-by: Sungman Cho <[email protected]>
Co-authored-by: Songki Choi <[email protected]>
Co-authored-by: Yunchu Lee <[email protected]>
Co-authored-by: Jaeguk Hyun <[email protected]>
Co-authored-by: Inhyuk Cho <[email protected]>
Co-authored-by: eunwoosh <[email protected]>
Co-authored-by: Lee, Soobee <[email protected]>
supersoob added a commit to supersoob/training_extensions that referenced this pull request Apr 25, 2023
…2055)

* HOT-FIX: Revert segmentation model's ignore mode in CLI (openvinotoolkit#2011)

Revert segmentation ignore=True

* Improve tiling preprocess (openvinotoolkit#2013)

* prevent timeout during init phase

* Fix reg tests (openvinotoolkit#2008)

* Edit regression tests

* Change the dataset root

* Miss typo

* Fix pre-commit

* Fix openvino import error due to Tiler init import (openvinotoolkit#2015)

Remove init import for Tiler to prevent OpenVINO import

* Bump up version to 1.2.0 (openvinotoolkit#2017)

* Set the python version to "3.10" for code-scan workflow

* Add missing __init__.py (openvinotoolkit#2019)

* Add missing __init__.py

* Change license

* Release 1.2.0rc1

* Fix issue that str2bool not being applied in certain cases (openvinotoolkit#2023)

* Add workaround solution

* Fix minor

* Remove str int

* Fix default dict (openvinotoolkit#2025)

fix: change default to configdict

Signed-off-by: Inhyuk Andy Cho <[email protected]>

* Convert dummy datasets to toy datasets (openvinotoolkit#1988)

* Update cls, det datsets

* Remove useless files

* Change action datasets

* Edit action dataset

* change dir

* Add xml files

* Remove useless

* Edite tets

* Fix tests

* Fix tests

* Remove ptc

* Remove

* Fix precommit

* Update dataset, fix cls bug

* Remove useless dataset

* Edit drop_last

* Fix missed part

* Change threshold values to unifying

* bugfix: squeezing to 1 dimenetion

* Change threshold for deployment

* Fix multi-gpu issue, e2e tests

* Decrease num_workers for tiling test and tiling processes

* Revert num_workers for tests

* Fix datsets

---------

Co-authored-by: eunwoosh <[email protected]>

* Fix E2E tests (openvinotoolkit#2032)

* Optimize data preprocessing time and enhance overall performance in semantic segmentation (openvinotoolkit#2020)

* add unit test

* exp

* intg agg

* implement ignore label

* no update in model.py

* ignore in label

* only updated ignored loss

* final

* final

* exp

* refactor

* refactor ignore loss

* revert

* default mode is ignore false

* unit test revised

* model update

* revise detcon

* fix error in intg test

* test case revised

* make run in semisl

* add type hints

* update docs

* test case added

---------

Signed-off-by: Inhyuk Andy Cho <[email protected]>
Co-authored-by: Harim Kang <[email protected]>
Co-authored-by: Eugene Liu <[email protected]>
Co-authored-by: Sungman Cho <[email protected]>
Co-authored-by: Songki Choi <[email protected]>
Co-authored-by: Yunchu Lee <[email protected]>
Co-authored-by: Jaeguk Hyun <[email protected]>
Co-authored-by: Inhyuk Cho <[email protected]>
Co-authored-by: eunwoosh <[email protected]>
Co-authored-by: Lee, Soobee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ALGO Any changes in OTX Algo Tasks implementation DOC Improvements or additions to documentation ENHANCE Enhancement of existing features REFACTOR RELEASE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants