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

Per-channel zero points but per-tensor scales #929

Open
V0XNIHILI opened this issue Apr 8, 2024 · 6 comments
Open

Per-channel zero points but per-tensor scales #929

V0XNIHILI opened this issue Apr 8, 2024 · 6 comments

Comments

@V0XNIHILI
Copy link

How would I go about implementing the above feature in Brevitas? Where should I get started and is this even possible in the way Brevitas is currently set up?

@V0XNIHILI
Copy link
Author

@Giuseppe5 do you know more about this?

@Giuseppe5
Copy link
Collaborator

Yes, apologies for the late reply. Later tomorrow I will publish an example of how to achieve this, but in general it should be possible since zero point and scale have independent shapes that can be individually specified when instantiating a new quantizer.

@V0XNIHILI
Copy link
Author

@Giuseppe5 if you have the time, I would still really love to see how we can achieve this with Brevitas 😁

@Giuseppe5
Copy link
Collaborator

Apologies for the delay, but it is a bit more complicated than I originally thought.

It is still possible but it requires to play a bit more with dependency injection.
I'll try to look into it but not sure when at this point.
Apologies.

@V0XNIHILI
Copy link
Author

No problem! Do you have a reference for me on where to start from/where to look?

@Giuseppe5
Copy link
Collaborator

You need to create a quantizer where:

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

No branches or pull requests

2 participants