Skip to content

Add a feature of UniformQDQ - support CV/NLP model's OPs, includingConv, DepthwiseConv2D, MatMul, etc. Additional op support be added upon request. #2155

Open
qgao007 wants to merge 30 commits intomasterfrom
qg/refactor
Open

Add a feature of UniformQDQ - support CV/NLP model's OPs, includingConv, DepthwiseConv2D, MatMul, etc. Additional op support be added upon request. #2155
qgao007 wants to merge 30 commits intomasterfrom
qg/refactor

Conversation

@qgao007
Copy link
Copy Markdown
Contributor

@qgao007 qgao007 commented Mar 27, 2025

Type of Change

A feature of UniformQDQ

Description

A feature of UniformQDQ

  • support CV/NLP model's OPs, includingConv, DepthwiseConv2D, MatMul, etc. Additional op support be added upon request.

Expected Behavior & Potential Risk

Generate a UniformQDQ int8 model. No foreseeable risk.

How has this PR been tested?

This PR is tested on selected models with representative ops from image-classfication, object detection, and nlp.

Dependency Change?

Need Tensorflow with qunit8-support.
https://github.com/intel-innersource/frameworks.ai.tensorflow.private-tensorflow/tree/mabuzain/add-quint8-support

zehao-intel and others added 25 commits March 20, 2024 10:59
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: zehao-intel <zehao.huang@intel.com>
Signed-off-by: Qun Gao <qun.gao@intel.com>
Signed-off-by: Qun Gao <qun.gao@intel.com>
Signed-off-by: Qun Gao <qun.gao@intel.com>
Signed-off-by: Qun Gao <qun.gao@intel.com>
Signed-off-by: Qun Gao <qun.gao@intel.com>
Signed-off-by: Qun Gao <qun.gao@intel.com>
Signed-off-by: Gao, Qun <qun.gao@intel.com>
@thuang6
Copy link
Copy Markdown
Contributor

thuang6 commented Mar 31, 2025

one general question, I saw the changes in both 2.x and 3.x folders, so this PR enables UniformQDQ supported in both 2.x and 3.x API?

@qgao007
Copy link
Copy Markdown
Contributor Author

qgao007 commented Apr 1, 2025

one general question, I saw the changes in both 2.x and 3.x folders, so this PR enables UniformQDQ supported in both 2.x and 3.x API?

Thanks @thuang6 for the question! We ran it in new pythonic 3.x API, assuming compatibility with 2.x. We will confirm this shortly with @nhatleSummer22

@qgao007
Copy link
Copy Markdown
Contributor Author

qgao007 commented Apr 1, 2025

loop in @ashahba and @mahmoud-abuzaina also.

@thuang6
Copy link
Copy Markdown
Contributor

thuang6 commented Apr 3, 2025

one general question, I saw the changes in both 2.x and 3.x folders, so this PR enables UniformQDQ supported in both 2.x and 3.x API?

Thanks @thuang6 for the question! We ran it in new pythonic 3.x API, assuming compatibility with 2.x. We will confirm this shortly with @nhatleSummer22

new feature is only expected to 3.x API.

Please note, 3.x has separated packaging for each framework, TF 3.x packing is listed below, which only contains common & tensorflow folder under neural_compressor. If the function relies on code in other 2.x folders, it does not work.

"neural_compressor_tf": {
"project_name": "neural_compressor_tf",
"include_packages": find_packages(
include=[
"neural_compressor.common",
"neural_compressor.common.",
"neural_compressor.tensorflow",
"neural_compressor.tensorflow.
",
],
),
"package_data": {"": ["*.yaml"]},
"install_requires": fetch_requirements("requirements_tf.txt"),
},

@mahmoud-abuzaina
Copy link
Copy Markdown

Supporting only 3.x API is fine, we don't really need to depend on 2.x API.

Comment thread neural_compressor/data/datasets/dataset.py Outdated
Comment thread neural_compressor/strategy/strategy.py Outdated
Comment thread neural_compressor/tensorflow/utils/utility.py Outdated
@sachinmuradi
Copy link
Copy Markdown

@lvliang-intel Could you help merge this PR in master ? Thanks

@thuang6
Copy link
Copy Markdown
Contributor

thuang6 commented Jan 28, 2026

2.x API including related source/example/doc/test folders will be removed in coming release, so for this PR, pls only keep code for 3.x API and make sure it does not rely on any code in 2.x folder.

@sachinmuradi
Copy link
Copy Markdown

@qgao007 Can you take a look ?

@chensuyue
Copy link
Copy Markdown
Contributor

@sachinmuradi @qgao007 Are you still working on this PR?

@chensuyue
Copy link
Copy Markdown
Contributor

chensuyue commented Mar 2, 2026

The 2x API related code has been removed on master branch. Please close this PR if it's not valid anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants