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

Test failure for TensorPrimitives MinNumber and MaxNumber on Arm64 #102156

Closed
tannergooding opened this issue May 13, 2024 · 2 comments · Fixed by #102162
Closed

Test failure for TensorPrimitives MinNumber and MaxNumber on Arm64 #102156

tannergooding opened this issue May 13, 2024 · 2 comments · Fixed by #102162
Assignees
Labels
area-System.Numerics.Tensors blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab

Comments

@tannergooding
Copy link
Member

tannergooding commented May 13, 2024

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=673236
Build error leg or test failing: System.Numerics.Tensors.Tests.SingleGenericTensorPrimitives.SpanSpanDestination_SpecialValues
Pull request: #102098

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "",
  "ErrorPattern": "Single (MaxNumber|MinNumber)\\(Single, Single\\).*\\[FAIL\\]",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=673236
Error message validated: [Single (MaxNumber|MinNumber)\(Single, Single\).*\[FAIL\]]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 5/13/2024 1:17:52 PM UTC

Report

Build Definition Test Pull Request
673236 dotnet/runtime System.Numerics.Tensors.Tests.SingleGenericTensorPrimitives.SpanSpanDestination_SpecialValues #102098
2449946 dotnet-runtime System.Numerics.Tensors.Tests.SingleGenericTensorPrimitives.SpanSpanDestination_SpecialValues

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
2 2 2
@tannergooding tannergooding added blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab labels May 13, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 13, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label May 13, 2024
@tannergooding tannergooding self-assigned this May 13, 2024
@tannergooding tannergooding added area-System.Numerics.Tensors and removed untriaged New issue has not been triaged by the area owner needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels May 13, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics-tensors
See info in area-owners.md if you want to be subscribed.

@tannergooding
Copy link
Member Author

This is failing for -sNaN as the Arm64 FMINNM and FMAXNM instructions behave as per the IEEE 754:2008 rules where the handling of min/max was first attempted to be normalized.

The IEEE 754:2008 rules are:

minNum(x, y) is the canonicalized number x if x < y, y if y < x, the canonicalized number if one
operand is a number and the other a quiet NaN. Otherwise it is either x or y, canonicalized (this
means results might differ among implementations). When either x or y is a signalingNaN, then the
result is according to 6.2.

Where 6.2 details:

Under default exception handling, any operation signaling an invalid operation exception and for which a
floating-point result is to be delivered shall deliver a quiet NaN.

However, this was further rectified in the IEEE 754:2019 standard to remove the remaining ambiguities that existed:

minimumNumber(x, y) is x if x < y, y if y < x, and the number if one operand is a number and the
other is a NaN. For this operation, −0 compares less than +0. If x = y and signs are the same it is
either x or y. If both operands are NaNs, a quiet NaN is returned, according to 6.2. If either
operand is a signaling NaN, an invalid operation exception is signaled, but unless both operands
are NaNs, the signaling NaN is otherwise ignored and not converted to a quiet NaN as stated in
6.2 for other operations.

Noting the important changes being that -0 < +0 and that sNaN is not converted to qNaN when only one of the inputs is NaN.

As such, the Arm64 handling needs to be adjusted to handle sNaN as per the IEEE 754 requirements. This isn't currently an issue for float.MinNumber because its not generating FMINNM, it's using the software fallback. It's likewise not showing up as an issue for various cases involving a constant because the GenTreeDblCon node type only stores a double and the upcast from float to double is enough to normalize the value in many cases.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Numerics.Tensors blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab
Projects
None yet
1 participant