Skip to content

Conversation

@yiliu30
Copy link
Contributor

@yiliu30 yiliu30 commented Nov 28, 2022

Type of Change

  • Feature
  • API changed or not: Add optimization_level to select the tuning strategy

Description

detail description
JIRA ticket: ILITV-2358

Expected Behavior & Potential Risk

  • Add conservative traverse logic
    - Start with fp32 model, convert op(s) into lower-precision(bf16/fp16/int8).
    - Convert ops into lower precision by op-type wise.
    - Convert op into lower precision one by one based on the result of the previous step.
  • Add optimization level
    - 0: using conservative strategy
    - 1: using basic strategy by default
  • UTs
  • Doc, will be submitted by another PR

How has this PR been tested?

Dependency Change?

None

@yiliu30 yiliu30 changed the title Ly/opt level add conservative tuning strategy Nov 28, 2022
@yiliu30 yiliu30 changed the title add conservative tuning strategy [Strategy] Add optimization level for tuning strategy Dec 1, 2022
@yiliu30 yiliu30 marked this pull request as ready for review December 5, 2022 03:30
@yiliu30 yiliu30 added this to the v2.0 milestone Dec 6, 2022
# self.best_tune_result = self.baseline
# Initialize the best qmodel as fp32 model
self.best_qmodel = self._fp32_model
# self.best_qmodel = self._fp32_model
Copy link
Contributor

Choose a reason for hiding this comment

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

why this line gets commented off?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will initialize the self.best_qmodel with the first tuning result whose accuracy meets the requirements. code
If we initialize the self.best_qmodel with the fp32 model, we may return the fp32 model as the tuning result which may confuse the user, right?

chensuyue and others added 23 commits December 7, 2022 09:25
Signed-off-by: chensuyue <[email protected]>
Co-authored-by: WenjiaoYue <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
* Fix Time_series_LSTM tuning issue

Signed-off-by: Lv, Liang1 <[email protected]>

* fix pylint issue

Signed-off-by: Lv, Liang1 <[email protected]>

Signed-off-by: Lv, Liang1 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: Lv, Liang1 <[email protected]>

Signed-off-by: Lv, Liang1 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: chensuyue <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: Wang, Chang1 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: Sun, Xuehao <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: Yue, Wenjiao <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
lvliang-intel and others added 18 commits December 7, 2022 09:30
Signed-off-by: Wang, Chang1 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: chensuyue <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: changwa1 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: Lv, Liang1 <[email protected]>

Signed-off-by: Lv, Liang1 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
* Fix centernet_hg104 tuning issue

Signed-off-by: sys-lpot-val <[email protected]>

* Fix TextRNN tuning issue

Signed-off-by: sys-lpot-val <[email protected]>

Signed-off-by: sys-lpot-val <[email protected]>
Signed-off-by: Lv, Liang1 <[email protected]>
Co-authored-by: sys-lpot-val <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
@yiliu30 yiliu30 changed the title [Strategy] Add optimization level for tuning strategy Add optimization level for tuning strategy Dec 7, 2022
@yiliu30 yiliu30 removed this from the v2.0 milestone Dec 7, 2022
@yiliu30
Copy link
Contributor Author

yiliu30 commented Dec 7, 2022

The branch was polluted, the feature will be added by PR 227, close it first.

@yiliu30 yiliu30 closed this Dec 7, 2022
@yiliu30 yiliu30 deleted the ly/opt_level branch December 13, 2022 10:10
yiliu30 pushed a commit that referenced this pull request Apr 5, 2025
* refine PatchVLLMKVCache

* move cache out of args

* revert option2

* add get_cache

* Revert "add get_cache"

This reverts commit a89d9d23810ce594743504fea4bc5cd49e8d4192.

* Revert "revert option2"

This reverts commit d2b124c1d30717baf482eb887ba5ab3cb09ac51d.

* add comments

* update comment

* Dummy commit for triggering CI

* Dummy commit for triggering CI
xin3he pushed a commit that referenced this pull request Apr 22, 2025
* refine PatchVLLMKVCache

* move cache out of args

* revert option2

* add get_cache

* Revert "add get_cache"

This reverts commit a89d9d23810ce594743504fea4bc5cd49e8d4192.

* Revert "revert option2"

This reverts commit d2b124c1d30717baf482eb887ba5ab3cb09ac51d.

* add comments

* update comment

* Dummy commit for triggering CI

* Dummy commit for triggering CI
XuehaoSun pushed a commit that referenced this pull request May 13, 2025
* refine PatchVLLMKVCache

* move cache out of args

* revert option2

* add get_cache

* Revert "add get_cache"

This reverts commit a89d9d23810ce594743504fea4bc5cd49e8d4192.

* Revert "revert option2"

This reverts commit d2b124c1d30717baf482eb887ba5ab3cb09ac51d.

* add comments

* update comment

* Dummy commit for triggering CI

* Dummy commit for triggering CI
This was referenced Dec 9, 2025
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.