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

Identify the unique small number that will represent a NaN across data types #8945

Closed
Tracked by #8680
eyonland opened this issue May 29, 2024 · 2 comments
Closed
Tracked by #8680
Assignees

Comments

@eyonland
Copy link
Contributor

eyonland commented May 29, 2024

Status:
NaN's will be represented as follows:
bit31 bits[30:0]
sign 'b7FFF_FFFF

bit15 bits[14:0]
sign 'b7FFF

When an operation is executed that would normally produce NaNs, these will end up being the value. We are going to simply update the tests to reflect this expectation going forward.

@ttmtrajkovic and team will be documenting this and it will eventually get added to the public online documentation.

@ttmtrajkovic
Copy link
Contributor

NaN is represented as the following, which should be following ieee754 standard:

fp32:

bit31       bits[30:0]
sign        'b7FFF_FFFF

bf16:

bit15      bits[14:0]
sign        'b7FFF

FPU hardware will no recognize it as "special" and treat is as just regular input. SFPU hardware also doesn't do any special handling of this value, but seeing that as part of math will set a sticky bit in on of status registers.

Any special handling on NaN will have to be done by the op writers in sfpu kernels.

@ttmtrajkovic ttmtrajkovic assigned eyonland and unassigned rtawfik01 Jun 3, 2024
@eyonland
Copy link
Contributor Author

eyonland commented Jun 4, 2024

@umadevimcw, please see the comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants