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

Question: Unsigned Quantization #876

Closed
mahdi259 opened this issue Feb 25, 2024 · 3 comments
Closed

Question: Unsigned Quantization #876

mahdi259 opened this issue Feb 25, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@mahdi259
Copy link

Hi
Is there any way to specify unsigned quantization in QuantIdentity or QuantLinear?
Thanks

@capnramses capnramses self-assigned this Feb 26, 2024
@capnramses
Copy link
Collaborator

capnramses commented Feb 26, 2024

Hi @mahdi259
I think for QuantIdentity the answer is just to use Uint8ActPerTensorFloat when initialising QuantIdentity with optional argument act_quant=Uint8ActPerTensorFloat instead of the default int8 - which you can see here

class QuantIdentity(QuantNLAL):

For weights in e.g. QuantLinear I think it would be less common to use unsigned integers, so I don't think there's a datatype available built-in, but you could experiment with that by extending the Int8 weight data type

class Int8WeightPerTensorFixedPoint(NarrowIntQuant,

I hope that helps!

@capnramses capnramses added the question Further information is requested label Feb 26, 2024
@mahdi259
Copy link
Author

mahdi259 commented Feb 27, 2024

Thanks @capnramses . That's it. One more question. I have read ULPPACK paper that performs inner product of unsigned numbers, i.e. unsigned inputs and weights. I agree that it's odd to have unsigned weights. Do you know how they use ULPPACK in networks like ResNet?
Thanks

@capnramses
Copy link
Collaborator

I haven't read that paper I'm sorry! I think that might be off topic for the repo, so I'm going to close this Issue.

@capnramses capnramses changed the title Unsigned Quantization Question: Unsigned Quantization Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants