Skip to content

Don't serialize DQ attrs#36875

Closed
tkrupa-intel wants to merge 2 commits into
openvinotoolkit:masterfrom
tkrupa-intel:dont_serialize_dq_attrs
Closed

Don't serialize DQ attrs#36875
tkrupa-intel wants to merge 2 commits into
openvinotoolkit:masterfrom
tkrupa-intel:dont_serialize_dq_attrs

Conversation

@tkrupa-intel

Copy link
Copy Markdown
Contributor

Followup to #35283 (comment).
The attrs visited in the function are not in the offical IR spec so they shouldn't be serialized. They need to be visited for the sake of comparison performed in SharedOpOptimization pass. This pass currently doesn't apply to DQ nodes, however it will in one of the changes intended to be introduced in the near future - that's why I decided to exclude serialization instead of removing the function altogether.

@tkrupa-intel tkrupa-intel requested a review from praasz July 14, 2026 11:40
@tkrupa-intel tkrupa-intel requested a review from a team as a code owner July 14, 2026 11:40
@github-actions github-actions Bot added the category: transformations OpenVINO Runtime library - Transformations label Jul 14, 2026
@CuriousPanCake

Copy link
Copy Markdown
Contributor

Does their presence break something? @praasz does supporting these attributes in the IR bring any value?

@p-durandin p-durandin added this to the 2026.4 milestone Jul 15, 2026
@praasz

praasz commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Does their presence break something? @praasz does supporting these attributes in the IR bring any value?

The attribute itself is not an issue but internal operator should not be serialized to IR.
Other Transformation operators have visit_attribute and it is fine but they don't have stream operators for serialization.
The main problem with this op is that it can be serialized the issue is this operator has operator<<

@tkrupa-intel tkrupa-intel changed the title [GPU] Don't serialize DQ attrs Don't serialize DQ attrs Jul 16, 2026
@praasz

praasz commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

After offline discussion this change is not required and current state is OK. PR can be closed

@praasz praasz self-assigned this Jul 16, 2026

@mitruska mitruska 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.

My suggestion is to close this PR and keep visit_attributes as is.
It doesn't prevent DynamicQuantize op serialization anyway, just serialization of the attributes.

Comment on lines +142 to +146
// This is used for comparison during SharedOpOpt pass.
// The attrs are not a part of the official IR format, so we need to skip them during serialization.
if (dynamic_cast<ov::util::XmlSerializer*>(&visitor)) {
return true;
}

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.

My suggestion is to drop this change and keep visit_attributes as is.
It doesn't prevent the op serialization anyway, just serialization of the attributes.
DynamicQuantize itself (not only the attrs) is an internal operation and is not part of the public IR unless explicitly introduced by MOC or frontend transformations. Even before the mentioned PR where visit_attributes was added, the op could still be serialized, just without its attributes.

@tkrupa-intel tkrupa-intel deleted the dont_serialize_dq_attrs branch July 16, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: transformations OpenVINO Runtime library - Transformations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants