Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decoupled PerChannel/PerTensor quantization #1025

Merged
merged 11 commits into from
Oct 8, 2024

Conversation

Giuseppe5
Copy link
Collaborator

@Giuseppe5 Giuseppe5 commented Sep 12, 2024

To have a decouple per channel pre-scale, and per tensor post scale:

class Int8WeightNormL2PerChannelPerTensorFixedPoint(Int8WeightNormL2PerChannelFixedPoint):
    scaling_per_output_type = ScalingPerOutputType.TENSOR

It currently works for all quantizers that inherit from WeightNormPerChannelFloatDecoupled

It can be extended to other decoupled quantization quantizers if needed

@Giuseppe5 Giuseppe5 marked this pull request as ready for review September 13, 2024 13:10
@Giuseppe5 Giuseppe5 requested a review from i-colbert September 13, 2024 13:10
@Giuseppe5 Giuseppe5 requested review from i-colbert and removed request for i-colbert September 13, 2024 16:27
@Giuseppe5 Giuseppe5 requested review from i-colbert and removed request for i-colbert October 1, 2024 09:35
@Giuseppe5 Giuseppe5 requested review from i-colbert and removed request for i-colbert October 1, 2024 10:23
@Giuseppe5 Giuseppe5 added the next release PRs which should be merged for the next release label Oct 2, 2024
Copy link
Collaborator

@nickfraser nickfraser left a comment

Choose a reason for hiding this comment

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

Single question about test organisation (specifically, fixtures), otherwise LGTM!

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a code style question, any reason why we don't use the standard pytest way of sharing fixtures across multiple files (i.e., conftest.py)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have a lot of duplication for various reasons and in general tests would need to be restructured a bit.
All this to say that I wouldn't be sure at his point of the cleanest way to do it myself, but if you have a suggestion, all ears.

@Giuseppe5 Giuseppe5 merged commit 9048ecb into Xilinx:dev Oct 8, 2024
23 checks passed
@Giuseppe5 Giuseppe5 deleted the a2q_per_tensor branch October 8, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next release PRs which should be merged for the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants