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

reductions: add note about FP associativity #16

Merged
merged 4 commits into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions content/shmem_reductions.tex
Copy link

Choose a reason for hiding this comment

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

In the API note, the proposal is going to be silent on statements like the following

  • that the result should be the same on all PEs
  • that the result should be the same if the operation is called multiple times on the same data during the same run
  • that the result should be the same from run to run
  • that the result may be different on different architectures, due to differing arithmetic
  • that the result on IEEE-754 compatible platforms should always be the same everywhere and everywhen
  • that we might consider new APIs or environment variables that enforce more consistent results

Copy link

Choose a reason for hiding this comment

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

This is a nice summary of the open issues. Can you capture it on the follow-up issue for OpenSHMEM 1.7 (and create said issue if we don't have one already)?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,18 @@ \subsubsubsection{PROD}
Zero on successful local completion. Nonzero otherwise.
}

\apinotes{
The binary operations performed by \openshmem reductions are intended to be
associative and commutative.
However, floating point arithmetic is not associative or commutative due to
the inherent inaccuracies of floating-point representations caused by
rounding errors and finite precision.
This can lead to variations in the result of \openshmem arithmetic
reduction operations on floating-point datatypes, including NaN values.
A future version of the \openshmem specification may clarify the behavior
of reductions on floating point datatypes.
}

\begin{apiexamples}

\apicexample
Expand Down