Skip to content

Extensive fp cleanup, support Inf/NaN, addition of simple fp multiplier #152

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

Merged
merged 11 commits into from
Jan 15, 2025

Conversation

desmonddak
Copy link
Contributor

Description & Motivation

Addition of FloatingPointMultiplierSimple class.
Refactor floating point adders to use a base FloatingPointAdder class.

Exhaustive testing expanded to all possible inputs, validating the expected Infinite and NaN cases for FloatingPointAdderSimple,
FloatingPointAdderRound, and FloatingPointMultiplierSimple. Fixed FloatingPointValue to appropriately test Inf and NaN. Fixed the narrow-width FP special cases (e.g. FP8E4M3 does not support NaN).
Pipelined all three fp components.

Added a NativeAdder to use as a functor to use synthesized adders where convenient.
Added a SignedShifter component.

Modified PrefixTreePriorityEncoder to return the position 1 larger than the input width if no '1' exists in the input.
Optionally output a sentinal to indicate this as well. This is used in the fp adders.

Related Issue(s)

#133
#127 This is a proposed solution to use sentinals.

Testing

Exhaustive and random tests for all new components except the SignedShifter (used in fp multiplier).

Backwards-compatibility

Is this a breaking change that will not be backwards-compatible? If yes, how so?

Yes: PrefixTreePriorityEncoder used to return position 0 when input was all zeros. Now it returns input.width+1 and sets the sentinal.

Documentation

Does the change require any updates to documentation? If so, where? Are they included?

Yes. The NativeAdder is documented. The new FloatingPointMultiplierSimple needs documentation as well as a mention of pipelining in the FloatingPointAdderSimple. Need to check the PrefixTreePriorityFinder MD file for updates.

@desmonddak desmonddak requested a review from mkorbel1 January 8, 2025 03:32
Copy link
Contributor

@mkorbel1 mkorbel1 left a comment

Choose a reason for hiding this comment

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

more comments coming, first batch :)

Copy link
Contributor

@mkorbel1 mkorbel1 left a comment

Choose a reason for hiding this comment

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

This is awesome!

@desmonddak desmonddak requested a review from mkorbel1 January 10, 2025 08:34
Copy link
Contributor

@mkorbel1 mkorbel1 left a comment

Choose a reason for hiding this comment

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

Awesome!

@desmonddak desmonddak merged commit b44b85d into intel:main Jan 15, 2025
4 checks passed
@desmonddak desmonddak deleted the fpmult branch March 6, 2025 05:00
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

Successfully merging this pull request may close these issues.

3 participants