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

Add support for extended exp operation as halide_extended_exp. #8206

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

zvookin
Copy link
Member

@zvookin zvookin commented Apr 24, 2024

Per discussion, add operator to implement efficient two pass softmax algorithm. This is a draft as it is hoped the numerics can be improved.

@zvookin zvookin requested a review from abadams April 24, 2024 06:57
* "The Two-Pass Softmax Algorithm" by Marat Dukhan and
* Artsiom Ablavatski [https://arxiv.org/abs/2001.04438].
*
* The first element of the returned Tuple is a psuedo-mantissa while
Copy link
Contributor

Choose a reason for hiding this comment

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

pseudo

* Artsiom Ablavatski [https://arxiv.org/abs/2001.04438].
*
* The first element of the returned Tuple is a psuedo-mantissa while
* the second is an exponent which is an integer. The product of the
Copy link
Contributor

Choose a reason for hiding this comment

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

So is the returned Tuple a pair of (float32, int32), or is it (float32, float32) where the second is always an integral value?

@steven-johnson
Copy link
Contributor

Per discussion, add operator to implement efficient two pass softmax algorithm. This is a draft as it is hoped the numerics can be improved.

Can you clarify a bit? It's not obvious to me what the deficiencies are (just curious)

Zalman Stern added 2 commits April 30, 2024 22:43
values for exponent part of extended exp.

Improve test by comparing to three pass algorithm.
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.

None yet

2 participants