-
Notifications
You must be signed in to change notification settings - Fork 631
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
[codegen] softmax nans #17670
Comments
@hanhanW identified |
@pashu123 please help the further triaging. We dumped the inputs and outputs and verified that there are NANs. |
On further debugging, the problem is with max calculation. Smaller repro:
https://gist.github.com/pashu123/83ca1f519aa39f1ce7a035122bbb7e54 (Compile and run commands are same as above) I have created a Python script to debug: https://gist.github.com/pashu123/898636a138e41e1db2443acd1248d6d4 The output of Python script:
It looks like iree's output gets stuck at -0.0. using https://mlir.llvm.org/docs/Dialects/ArithOps/#arithmaxnumf-arithmaxnumfop
Solves the problem. Meanwhile, I am reading the documentation. It's not clear to me why it happens 😆. Cherry-pick: https://github.com/pashu123/llvm-project/tree/fyi_soft (verified) |
Some related read: https://discourse.llvm.org/t/rfc-fix-floating-point-max-and-min-operations-in-mlir/72671 I recall the time that we split the |
The upstream change is landed to IREE: #18033 closing the issue. |
What happened?
compile command:
input npy
https://sharkblobs.blob.core.windows.net/dan/42_inputs.npy
output npy (for comparison)
https://sharkblobs.blob.core.windows.net/dan/42_out.npy
iree-run-module --module=42.vmfb --function=softmax --input=@42_inputs.npy --output=@42_out_repro.npy
The text was updated successfully, but these errors were encountered: