Skip to content

[TFLite FE][TF FE] Mark dequantization before TSGeneral#36300

Open
mvafin wants to merge 1 commit into
openvinotoolkit:masterfrom
mvafin:mvafin/tfl/mark-dequantization-before-tsgeneral
Open

[TFLite FE][TF FE] Mark dequantization before TSGeneral#36300
mvafin wants to merge 1 commit into
openvinotoolkit:masterfrom
mvafin:mvafin/tfl/mark-dequantization-before-tsgeneral

Conversation

@mvafin

@mvafin mvafin commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Details:

  • Added MarkDequantization before transpose-sinking in TFLite FE and TF FE normalize pipelines.
  • Added short comments explaining ordering (TSGeneral runs internal ConstantFolding).
  • Added TFLite regression test tflite_qdq_convert_is_marked_disable_cf to check Convert nodes are marked with DisableConstantFolding.

Tickets:

  • ticket-id

AI Assistance:

  • AI assistance used: yes
  • AI helped with code changes and test addition; validation was done by reviewing changes and commit-hook run.

@mvafin mvafin requested a review from a team as a code owner June 8, 2026 10:19
@github-actions github-actions Bot added category: TF FE OpenVINO TensorFlow FrontEnd category: TFL FE OpenVINO TensorFlow Lite FrontEnd labels Jun 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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::MarkDequantization before TSGeneral in TF FE normalization.
  • Register ov::pass::MarkDequantization before transpose-sinking/TSGeneral in TFLite FE normalization.
  • Add a TFLite test that checks at least one Convert node has DisableConstantFolding.

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.

Comment thread src/frontends/tensorflow_lite/tests/quantization.cpp
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>
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});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please make sure you handle u2 weights here as well. Gemma4 models heavily use 2-bit quantization.

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});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ditto.

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

Labels

category: TF FE OpenVINO TensorFlow FrontEnd category: TFL FE OpenVINO TensorFlow Lite FrontEnd

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants