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

Add storage cache in Apache Arrow format using Datumaro #2009

Merged
merged 25 commits into from
Apr 19, 2023

Conversation

cih9088
Copy link
Contributor

@cih9088 cih9088 commented Apr 14, 2023

Summary

Add storage cache feature for cls, det, seg tasks

  • Added storage cache using Datumaro.
  • Make Image class a bit friendly to arrow format.
  • Changed label_entities to dictionary type with integer key.

The unit tests would be added soon.

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

@cih9088 cih9088 added the FEATURE New feature & functionality label Apr 14, 2023
@cih9088 cih9088 added this to the 1.2.0 milestone Apr 14, 2023
@cih9088 cih9088 requested a review from a team as a code owner April 14, 2023 05:03
@github-actions github-actions bot added ALGO Any changes in OTX Algo Tasks implementation API Any changes in OTX API CLI Any changes in OTE CLI TEST Any changes in tests DOC Improvements or additions to documentation labels Apr 14, 2023
otx/api/entities/image.py Outdated Show resolved Hide resolved
Copy link
Contributor

@wonjuleee wonjuleee left a comment

Choose a reason for hiding this comment

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

I am not sure the storage caching is probably done in Apache Arrow itself rather than OTX framework. If so, do we need to provide the configurations for storage caching in OTX?

@github-actions github-actions bot removed the TEST Any changes in tests label Apr 14, 2023
@cih9088 cih9088 changed the base branch from develop to releases/1.2.0 April 14, 2023 09:09
wonjuleee
wonjuleee previously approved these changes Apr 14, 2023
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.

@cih9088 Could you change the Datumaro version to enable the arrow format? and add unit-tests for this feature?

Signed-off-by: Inhyuk Andy Cho <andy.inhyuk.jo@intel.com>
Signed-off-by: Inhyuk Andy Cho <andy.inhyuk.jo@intel.com>
Signed-off-by: Inhyuk Andy Cho <andy.inhyuk.jo@intel.com>
Signed-off-by: Inhyuk Andy Cho <andy.inhyuk.jo@intel.com>
@github-actions github-actions bot added DEPENDENCY Any changes in any dependencies (new dep or its version) should be produced via Change Request on PM TEST Any changes in tests labels Apr 19, 2023
@cih9088 cih9088 requested a review from sungmanc April 19, 2023 00:55
Signed-off-by: Inhyuk Andy Cho <andy.inhyuk.jo@intel.com>
wonjuleee
wonjuleee previously approved these changes Apr 19, 2023
Signed-off-by: Inhyuk Andy Cho <andy.inhyuk.jo@intel.com>
@sungmanc
Copy link
Contributor

@wonjuleee, @cih9088 Since all tests are passed, we're going to merge this PR after preparing the validation report (it will be merged by the end of today).

I asked Inhyuk to check w/ Geti since this PR includes small changes to ImageEntity.
We could easily assume there will be no problem, however, sometimes Geti occurs an error even though there are only small changes.

Thanks for the hard work

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.

Generally looks OK to me. I have a few questions including the one below.
Did you check the Geti pre-commit / unit / component test? If not, you can create a dummy PR for Geti to run the continuous-integration/jenkins/pr-head. (It's different from Geti E2E test build).
Please understand that it's due to the change in base entity which might affect Geti.

@@ -74,7 +75,13 @@ def test_get_image_path(self, task, subset):
random_data = DatasetManager.get_image_path(
generate_datumaro_dataset_item(item_id="0", subset=subset, task=task)
)
assert random_data is not None
assert random_data is None
Copy link
Contributor

Choose a reason for hiding this comment

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

Meaning that this function should return None if not given the temp_dir?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

datumaro.Image was refactored to have a separate class implementation depending on sources (file path, numpy, raw binary) in Datumaro v1.2.0. If temp_dir is not given, (data source is not a file), path attribute does not exist in datumaro.Image.

This change makes sure that if path attribute is not found, return None.

@cih9088
Copy link
Contributor Author

cih9088 commented Apr 19, 2023

I asked Inhyuk to check w/ Geti since this PR includes small changes to ImageEntity. We could easily assume there will be no problem, however, sometimes Geti occurs an error even though there are only small changes.

Did you check the Geti pre-commit / unit / component test?

I'm waiting for write permission to the repo.

@goodsong81
Copy link
Contributor

goodsong81 commented Apr 19, 2023

I asked Inhyuk to check w/ Geti since this PR includes small changes to ImageEntity. We could easily assume there will be no problem, however, sometimes Geti occurs an error even though there are only small changes.

Did you check the Geti pre-commit / unit / component test?

I'm waiting for write permission to the re

I asked Inhyuk to check w/ Geti since this PR includes small changes to ImageEntity. We could easily assume there will be no problem, however, sometimes Geti occurs an error even though there are only small changes.

Did you check the Geti pre-commit / unit / component test?

I'm waiting for write permission to the repo.

It's for you :)
https://github.com/intel-innersource/frameworks.ai.interactive-ai-workflow.sonoma-creek/pull/7442

-> Passed.
image
https://ci.iotg.sclab.intel.com/job/IMPT/job/utils-common/job/sc-github-check/job/PR-7442/1/

@cih9088
Copy link
Contributor Author

cih9088 commented Apr 19, 2023

-> Passed. image ci.iotg.sclab.intel.com/job/IMPT/job/utils-common/job/sc-github-check/job/PR-7442/1

Thanks a lot for your goodwill. 🥇

@goodsong81 goodsong81 merged commit 47d09e2 into openvinotoolkit:releases/1.2.0 Apr 19, 2023
12 checks passed
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 <andy.inhyuk.jo@intel.com>

* 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 <eunwoo.shin@intel.com>

* 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 <andy.inhyuk.jo@intel.com>
Co-authored-by: Harim Kang <harim.kang@intel.com>

* 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 <harim.kang@intel.com>
Co-authored-by: Songki Choi <songki.choi@intel.com>

* 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 <vinnam.kim@intel.com>

* Update CHANGELOG.md

Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>

* Add documentation

Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>

* Fix typo

Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>

* Fix small typo

---------

Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Co-authored-by: Songki Choi <songki.choi@intel.com>

* 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 <songki.choi@intel.com>

* 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 <sungman.cho@intel.com>

* update unit test

* update integration test

* bufix

* Release 1.2.0rc2

Signed-off-by: Songki Choi <songki.choi@intel.com>

* Update OTX commit hash for exportable code requiements

---------

Signed-off-by: Inhyuk Andy Cho <andy.inhyuk.jo@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Songki Choi <songki.choi@intel.com>
Co-authored-by: Harim Kang <harim.kang@intel.com>
Co-authored-by: Eugene Liu <eugene.liu@intel.com>
Co-authored-by: Sungman Cho <sungman.cho@intel.com>
Co-authored-by: Yunchu Lee <yunchu.lee@intel.com>
Co-authored-by: Jaeguk Hyun <jaeguk.hyun@intel.com>
Co-authored-by: Inhyuk Cho <andy.inhyuk.jo@intel.com>
Co-authored-by: eunwoosh <eunwoo.shin@intel.com>
Co-authored-by: Soobee Lee <soobee.lee@intel.com>
Co-authored-by: Galina Zalesskaya <galina.zalesskaya@intel.com>
Co-authored-by: Vinnam Kim <vinnam.kim@intel.com>
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 API Any changes in OTX API CLI Any changes in OTE CLI DEPENDENCY Any changes in any dependencies (new dep or its version) should be produced via Change Request on PM DOC Improvements or additions to documentation FEATURE New feature & functionality RELEASE TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants