[TFLite FE][TF FE] Mark dequantization before TSGeneral#36300
Open
mvafin wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the TensorFlow and TensorFlow Lite frontend normalization pipelines to run ov::pass::MarkDequantization before TransposeSinkingGeneral (TSGeneral), because TSGeneral includes an internal ConstantFolding step. It also adds a TensorFlow Lite regression test intended to ensure Convert nodes are protected from constant folding.
Changes:
- Register
ov::pass::MarkDequantizationbefore TSGeneral in TF FE normalization. - Register
ov::pass::MarkDequantizationbefore transpose-sinking/TSGeneral in TFLite FE normalization. - Add a TFLite test that checks at least one
Convertnode hasDisableConstantFolding.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/frontends/tensorflow/src/frontend.cpp | Adds MarkDequantization before TransposeSinkingGeneral in TF normalization. |
| src/frontends/tensorflow_lite/src/frontend.cpp | Adds MarkDequantization before transpose-sinking/TSGeneral in TFLite normalization. |
| src/frontends/tensorflow_lite/tests/quantization.cpp | Adds a regression test checking Convert nodes are marked with DisableConstantFolding. |
Run MarkDequantization in TF Lite and TF frontend normalize pipelines before transpose sinking so TSGeneral's internal ConstantFolding does not fold dequantization subgraphs into FP constants. Add a TFLite regression test that checks Convert nodes in qdq_uint8 conversion are marked with DisableConstantFolding. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
taste1981
reviewed
Jun 8, 2026
| manager.register_pass<ov::pass::RemoveConcatZeroDimInput>(); | ||
| // TSGeneral runs ConstantFolding; mark dequantization before it. | ||
| manager.register_pass<ov::pass::MarkDequantization>( | ||
| ov::element::TypeVector{ov::element::i8, ov::element::u8, ov::element::i4, ov::element::u4}); |
There was a problem hiding this comment.
Please make sure you handle u2 weights here as well. Gemma4 models heavily use 2-bit quantization.
taste1981
reviewed
Jun 8, 2026
| manager.register_pass<ov::frontend::tensorflow_lite::pass::Rfft2dSimplifier>(); | ||
| // TSGeneral runs ConstantFolding; mark dequantization before it. | ||
| manager.register_pass<ov::pass::MarkDequantization>( | ||
| ov::element::TypeVector{ov::element::i8, ov::element::u8, ov::element::i4, ov::element::u4}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details:
Tickets:
AI Assistance: