-
Notifications
You must be signed in to change notification settings - Fork 266
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
bugfix: Ensure Loop Termination by Enforcing IEEE-754 Compliance in Sampling Kernels #774
Conversation
@yzh119 : Thanks a lot for the fix. Wouldn't it still be an issue with loop terminating for some other inputs esp since we have an exact floating-point comparison ( |
Our initial design uses
This would not happen if the |
@yzh119 it breaks the unit test |
I don't think using double it is a good idea. |
…nce in Sampling Kernels (flashinfer-ai#774)" This reverts commit a0443d5.
Which unittest you are talking about? |
Can you elaborate more? what's your proposal. |
Are you using the main line codebase? We have ci set up for the sampling: https://ci.tlcpack.ai/blue/organizations/jenkins/flashinfer-ci/detail/PR-977/1/pipeline/14 |
This PR addresses issue #769.
As discussed in this comment, the use of the approximate division instruction
div.approx.ftz.f32
can break the loop invariant, preventing the loop from terminating. To resolve this, this PR changes the data types oflow
,high
, andmid
todouble
, ensuring that the compiler maintains IEEE-754 compliance and preserves numerical stability.