Skip to content

Enable model training and NNCF in mmdet#1355

Merged
goodsong81 merged 18 commits intoopen-edge-platform:feature/otx-new-mmcv/mmdetfrom
cih9088:feature/otx-new-mmcv/mmdet-nncf
Nov 21, 2022
Merged

Enable model training and NNCF in mmdet#1355
goodsong81 merged 18 commits intoopen-edge-platform:feature/otx-new-mmcv/mmdetfrom
cih9088:feature/otx-new-mmcv/mmdet-nncf

Conversation

@cih9088
Copy link
Copy Markdown
Contributor

@cih9088 cih9088 commented Nov 10, 2022

Previous PR: #1316

  • Most of the monkey patches are not to add functional features but just to block the trace of its methods/functions in NNCF.
  • Add trainable and NNCF optimisable YOLOX
  • Add trainable and NNCF optimisable SSD
  • Rearange nncf adapter
  • Add instance-segmentation test code
  • Add trainable and NNCF optimisable Mask R-CNN

@cih9088 cih9088 requested a review from a team as a code owner November 10, 2022 06:16
@github-actions github-actions bot added the ALGO Any changes in OTX Algo Tasks implementation label Nov 10, 2022
@cih9088 cih9088 requested a review from goodsong81 November 10, 2022 06:16
@cih9088
Copy link
Copy Markdown
Contributor Author

cih9088 commented Nov 10, 2022

#1316 (comment)

@cih9088
Copy link
Copy Markdown
Contributor Author

cih9088 commented Nov 10, 2022

Additional commits:

@goodsong81
Copy link
Copy Markdown

run ote-test

@goodsong81 goodsong81 merged commit 898f147 into open-edge-platform:feature/otx-new-mmcv/mmdet Nov 21, 2022
goodsong81 pushed a commit that referenced this pull request Nov 22, 2022
Enable model training and NNCF in mmdet (#1355)

* Enable detection training on latest mmcv/det
- ATSS / SSD / YOLOX
- NNCF support for ATSS

* fix: import errors

* feat: add monkey patch to mmdet modules
- most of patches would be just wrapping for not tracing in nncf context

* feat: add trainable yolox
- add trainable yolox
- recursively search dataset cfg for nested dataset classes

* fix: change device to cpu when nncf tracing

* feat: add trainable ssd

* refactor: rearange nncf adapter

* feat: add trainable mask rcnn models

* refactor: move out common utils

* fix: ssd head bug

* feat: add lr scheduler for accuracy aware runner

* refactor: nncf module and monkey patch

* fix: proper clustering anchors for ssd

* fix: unable to trace the first module in NNCFNetwork

* fix: bring back ssd head structure

* feat: add train_step method to NNCFNetwork

* fix: mismatches

* fix: update pipeline for wrapper

* fix: add missing file

* Fix merge error

Signed-off-by: Songki Choi <songki.choi@intel.com>
Co-authored-by: Inhyuk Cho <andy.inhyuk.jo@intel.com>
cih9088 added a commit to cih9088/training_extensions that referenced this pull request Jan 2, 2023
Enable model training and NNCF in mmdet (open-edge-platform#1355)

* Enable detection training on latest mmcv/det
- ATSS / SSD / YOLOX
- NNCF support for ATSS

* fix: import errors

* feat: add monkey patch to mmdet modules
- most of patches would be just wrapping for not tracing in nncf context

* feat: add trainable yolox
- add trainable yolox
- recursively search dataset cfg for nested dataset classes

* fix: change device to cpu when nncf tracing

* feat: add trainable ssd

* refactor: rearange nncf adapter

* feat: add trainable mask rcnn models

* refactor: move out common utils

* fix: ssd head bug

* feat: add lr scheduler for accuracy aware runner

* refactor: nncf module and monkey patch

* fix: proper clustering anchors for ssd

* fix: unable to trace the first module in NNCFNetwork

* fix: bring back ssd head structure

* feat: add train_step method to NNCFNetwork

* fix: mismatches

* fix: update pipeline for wrapper

* fix: add missing file

* Fix merge error

Signed-off-by: Songki Choi <songki.choi@intel.com>
Co-authored-by: Inhyuk Cho <andy.inhyuk.jo@intel.com>
cih9088 added a commit to cih9088/training_extensions that referenced this pull request Jan 5, 2023
Enable model training and NNCF in mmdet (open-edge-platform#1355)

* Enable detection training on latest mmcv/det
- ATSS / SSD / YOLOX
- NNCF support for ATSS

* fix: import errors

* feat: add monkey patch to mmdet modules
- most of patches would be just wrapping for not tracing in nncf context

* feat: add trainable yolox
- add trainable yolox
- recursively search dataset cfg for nested dataset classes

* fix: change device to cpu when nncf tracing

* feat: add trainable ssd

* refactor: rearange nncf adapter

* feat: add trainable mask rcnn models

* refactor: move out common utils

* fix: ssd head bug

* feat: add lr scheduler for accuracy aware runner

* refactor: nncf module and monkey patch

* fix: proper clustering anchors for ssd

* fix: unable to trace the first module in NNCFNetwork

* fix: bring back ssd head structure

* feat: add train_step method to NNCFNetwork

* fix: mismatches

* fix: update pipeline for wrapper

* fix: add missing file

* Fix merge error

Signed-off-by: Songki Choi <songki.choi@intel.com>
Co-authored-by: Inhyuk Cho <andy.inhyuk.jo@intel.com>
cih9088 added a commit to cih9088/training_extensions that referenced this pull request Jan 6, 2023
Enable model training and NNCF in mmdet (open-edge-platform#1355)

* Enable detection training on latest mmcv/det
- ATSS / SSD / YOLOX
- NNCF support for ATSS

* fix: import errors

* feat: add monkey patch to mmdet modules
- most of patches would be just wrapping for not tracing in nncf context

* feat: add trainable yolox
- add trainable yolox
- recursively search dataset cfg for nested dataset classes

* fix: change device to cpu when nncf tracing

* feat: add trainable ssd

* refactor: rearange nncf adapter

* feat: add trainable mask rcnn models

* refactor: move out common utils

* fix: ssd head bug

* feat: add lr scheduler for accuracy aware runner

* refactor: nncf module and monkey patch

* fix: proper clustering anchors for ssd

* fix: unable to trace the first module in NNCFNetwork

* fix: bring back ssd head structure

* feat: add train_step method to NNCFNetwork

* fix: mismatches

* fix: update pipeline for wrapper

* fix: add missing file

* Fix merge error

Signed-off-by: Songki Choi <songki.choi@intel.com>
Co-authored-by: Inhyuk Cho <andy.inhyuk.jo@intel.com>
cih9088 added a commit to cih9088/training_extensions that referenced this pull request Jan 6, 2023
Enable model training and NNCF in mmdet (open-edge-platform#1355)

* Enable detection training on latest mmcv/det
- ATSS / SSD / YOLOX
- NNCF support for ATSS

* fix: import errors

* feat: add monkey patch to mmdet modules
- most of patches would be just wrapping for not tracing in nncf context

* feat: add trainable yolox
- add trainable yolox
- recursively search dataset cfg for nested dataset classes

* fix: change device to cpu when nncf tracing

* feat: add trainable ssd

* refactor: rearange nncf adapter

* feat: add trainable mask rcnn models

* refactor: move out common utils

* fix: ssd head bug

* feat: add lr scheduler for accuracy aware runner

* refactor: nncf module and monkey patch

* fix: proper clustering anchors for ssd

* fix: unable to trace the first module in NNCFNetwork

* fix: bring back ssd head structure

* feat: add train_step method to NNCFNetwork

* fix: mismatches

* fix: update pipeline for wrapper

* fix: add missing file

* Fix merge error

Signed-off-by: Songki Choi <songki.choi@intel.com>
Co-authored-by: Inhyuk Cho <andy.inhyuk.jo@intel.com>
cih9088 added a commit to cih9088/training_extensions that referenced this pull request Jan 9, 2023
Enable model training and NNCF in mmdet (open-edge-platform#1355)

* Enable detection training on latest mmcv/det
- ATSS / SSD / YOLOX
- NNCF support for ATSS

* fix: import errors

* feat: add monkey patch to mmdet modules
- most of patches would be just wrapping for not tracing in nncf context

* feat: add trainable yolox
- add trainable yolox
- recursively search dataset cfg for nested dataset classes

* fix: change device to cpu when nncf tracing

* feat: add trainable ssd

* refactor: rearange nncf adapter

* feat: add trainable mask rcnn models

* refactor: move out common utils

* fix: ssd head bug

* feat: add lr scheduler for accuracy aware runner

* refactor: nncf module and monkey patch

* fix: proper clustering anchors for ssd

* fix: unable to trace the first module in NNCFNetwork

* fix: bring back ssd head structure

* feat: add train_step method to NNCFNetwork

* fix: mismatches

* fix: update pipeline for wrapper

* fix: add missing file

* Fix merge error

Signed-off-by: Songki Choi <songki.choi@intel.com>
Co-authored-by: Inhyuk Cho <andy.inhyuk.jo@intel.com>
goodsong81 pushed a commit that referenced this pull request Jan 16, 2023
* Update MPA submodule to origin/otx

* [OTX-MMCV] Public mmdetection (#1382)

Enable model training and NNCF in mmdet (#1355)

* Enable detection training on latest mmcv/det
- ATSS / SSD / YOLOX
- NNCF support for ATSS

* fix: import errors

* feat: add monkey patch to mmdet modules
- most of patches would be just wrapping for not tracing in nncf context

* feat: add trainable yolox
- add trainable yolox
- recursively search dataset cfg for nested dataset classes

* fix: change device to cpu when nncf tracing

* feat: add trainable ssd

* refactor: rearange nncf adapter

* feat: add trainable mask rcnn models

* refactor: move out common utils

* fix: ssd head bug

* feat: add lr scheduler for accuracy aware runner

* refactor: nncf module and monkey patch

* fix: proper clustering anchors for ssd

* fix: unable to trace the first module in NNCFNetwork

* fix: bring back ssd head structure

* feat: add train_step method to NNCFNetwork

* fix: mismatches

* fix: update pipeline for wrapper

* fix: add missing file

* Fix merge error

* Enable model training and NNCF in mmseg (#1400)

* refactor: remove redundant

* feat: enable mmseg training

* feat: add nncf related stuff

* fix: change lr config

* fix: align nncf target metric

* refactor: use mpa for training and inference

* test: enable tests

* fix: minor bug

* refactor: patcher

* fix: build consistent nncf graph

* fix: minor bug

* fix: remove unused backup

* fix: dealt with datacontainer

* [OTX-MMCLS] Enable NNCF (#1435)

* fix: use patcher

* feat: update mmcls version

* feat: enable NNCF for mmcls

* refactor: add build NNCF model functions

* fix: minor bug

* fix: typo

* fix: make sure importing nncf when enabled only

* fix: inherit from base super class of otx

* [OTX] Introduce mmdeploy to export cls/seg/det models (#1466)

* feat: export using mmdeploy

* fix: adapt mmdeploy exported model

* test: enable openvino export

* fix: patch depending on fn type

* feat: mmdeploy for classification model

* test: enable export and openvino performance test

* fix: change temporary requirements

* refactor: use builder

* fix: do not propagate logger

* fix: remove image channel format conversion

* fix: handle unlabeled data

* fix: run eval before optimizing nncf network

* feat: change confidence threshold after nncf optimization

* fix: remove redundant attribute

* fix: official released openvino version

* fix: remove redundants

* feat: public mm series libraries

* feat: otx refactoring and bug fix

* Revert "[OTX] Bugfix: multi GPU raise error when num_workers isn't set as 0. (#1475)"

This reverts commit c076902.

* feat: enable multi-nodes distributed training

* fix: redundant parts

* Revert "[OTX] Evaluate a model before training starts (#1472)"

This reverts commit f728295.

* feat: enable evaluation before and after training

* style: fix failed cases

* fix: disable sam optimizer for nncf task

* fix: add frezelayer hook for segmentation

* fix: deepcopy instead of shallowcopy

* fix: enable temporary disabled features

* fix: handle nncf state simply

* fix: remove submodule

* feat: proper test runner handler

* fix: add forcetrainmodehook

* fix: make sure model is evaluated before run

* fix: more merge conflicts

* fix: buffer line by line in userspace

* fix: patch torch, etc. only when nncf task is executed

* fix: restrict kornia version

* fix: restrict version

* fix: align data pipeline for supcon

* fix: unclutter things

* fix: ignore annoying leftover data.yaml

Co-authored-by: Songki Choi <songki.choi@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants