From 18ab41886ff4c0a3fe9fa19fb5b20d2577ac5cc6 Mon Sep 17 00:00:00 2001 From: David Ozog Date: Wed, 9 Oct 2024 08:41:38 -0400 Subject: [PATCH 1/4] reductions: add note about FP associativity --- content/programming_model_overview.tex | 2 +- content/shmem_reductions.tex | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/content/programming_model_overview.tex b/content/programming_model_overview.tex index 6d53ece1..8305607b 100644 --- a/content/programming_model_overview.tex +++ b/content/programming_model_overview.tex @@ -157,7 +157,7 @@ of concatenated symmetric objects contributed by each of the \acp{PE} in another symmetric data object. \item \OPR{Reduction}: All \acp{PE} participating in the routine get the result - of an associative binary routine over elements of the specified symmetric + of a binary operation over elements of the specified symmetric data object on another symmetric data object. \item \OPR{All-to-All}: All \acp{PE} participating in the routine exchange a fixed amount of contiguous or strided data with all other participating diff --git a/content/shmem_reductions.tex b/content/shmem_reductions.tex index e99a12f6..917e18f3 100644 --- a/content/shmem_reductions.tex +++ b/content/shmem_reductions.tex @@ -373,7 +373,20 @@ \subsubsubsection{PROD} } \apireturnvalues{ - Zero on successful local completion. Nonzero otherwise. + 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, finite precision, and the order of the applied binary + operations. + 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} From c299db116a82e64d503ea7f5fe96646686beb93d Mon Sep 17 00:00:00 2001 From: David Ozog Date: Wed, 9 Oct 2024 09:20:13 -0400 Subject: [PATCH 2/4] reductions: revert small whitespace change --- content/shmem_reductions.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_reductions.tex b/content/shmem_reductions.tex index 917e18f3..3a8af194 100644 --- a/content/shmem_reductions.tex +++ b/content/shmem_reductions.tex @@ -373,7 +373,7 @@ \subsubsubsection{PROD} } \apireturnvalues{ - Zero on successful local completion. Nonzero otherwise. + Zero on successful local completion. Nonzero otherwise. } \apinotes{ From 11c76e0812ee26e20f07c66d6437e36a615c4294 Mon Sep 17 00:00:00 2001 From: David Ozog Date: Wed, 9 Oct 2024 10:52:01 -0400 Subject: [PATCH 3/4] Update content/shmem_reductions.tex Co-authored-by: James Dinan --- content/shmem_reductions.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/shmem_reductions.tex b/content/shmem_reductions.tex index 3a8af194..a4f15e29 100644 --- a/content/shmem_reductions.tex +++ b/content/shmem_reductions.tex @@ -381,8 +381,7 @@ \subsubsubsection{PROD} 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, finite precision, and the order of the applied binary - operations. + 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 From d7a4aa58556b8b91ed62034f14b87d447364b07e Mon Sep 17 00:00:00 2001 From: David Ozog Date: Wed, 9 Oct 2024 10:59:00 -0400 Subject: [PATCH 4/4] reductions: revert back to associative binary ops --- content/programming_model_overview.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/programming_model_overview.tex b/content/programming_model_overview.tex index 8305607b..6d53ece1 100644 --- a/content/programming_model_overview.tex +++ b/content/programming_model_overview.tex @@ -157,7 +157,7 @@ of concatenated symmetric objects contributed by each of the \acp{PE} in another symmetric data object. \item \OPR{Reduction}: All \acp{PE} participating in the routine get the result - of a binary operation over elements of the specified symmetric + of an associative binary routine over elements of the specified symmetric data object on another symmetric data object. \item \OPR{All-to-All}: All \acp{PE} participating in the routine exchange a fixed amount of contiguous or strided data with all other participating