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

Feature Request: 8 bit fixed point numbers #67

Open
jenkspt opened this issue May 7, 2023 · 2 comments
Open

Feature Request: 8 bit fixed point numbers #67

jenkspt opened this issue May 7, 2023 · 2 comments
Labels
contributions welcome We welcome community contributions for this issue! enhancement New feature or request

Comments

@jenkspt
Copy link

jenkspt commented May 7, 2023

I'm interested in using 8 bit fixed point numbers in jax and numpy in the range [0, 1], and [-1, 1]. I think with the current naming convention it would be something like float8_e0m8 and float8_e0m7.

@hawkinsp hawkinsp added enhancement New feature or request contributions welcome We welcome community contributions for this issue! labels Jun 6, 2023
@hawkinsp
Copy link
Collaborator

hawkinsp commented Jun 6, 2023

Well, I'm sure we'd accept a PR to add such a thing. Can you say more about the number format you want? Is there a paper or similar describing it?

In general we're adding types to this package only as we need them for some concrete purpose (e.g., there's a hardware vendor that offers them). What is the use case here?

@fayalalebrun
Copy link

@hawkinsp Fixed point formats should be usable with any hardware which supports integer arithmetic (source). Therefore the hardware support should already be there as far as I understand.

As for use case, integer arithmetic is far more efficient to implement in hardware as opposed to floating point . Therefore if researchers have such formats available to them, it could drive forward the development of more efficient neural processors. Moreover, something like this could be useful to FPGA engineers in the prototyping stage, where fixed point numbers are commonly used due to the aforementioned hardware efficiency concerns.

I could help with this, but would appreciate any pointers to the relevant numpy documentation. The types would just be wrappers over the regular integer types, with bit shifting applied accordingly. Though sin and square root might be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome We welcome community contributions for this issue! enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants