Skip to content

Commit

Permalink
Added note to prefix documentation for corner cases where cunumeric r…
Browse files Browse the repository at this point in the history
…esults can diverge from numpy (nv-legate#528)

* Added note to prefix documentation for corner cases where cunumeric results can diverge from numpy. Also other minor fixes to prefix documentation.

* Minor changes to documentation phrasing.
  • Loading branch information
rkarim2 authored and jjwilke committed Sep 2, 2022
1 parent 74ff168 commit b38a1a4
Showing 1 changed file with 44 additions and 13 deletions.
57 changes: 44 additions & 13 deletions cunumeric/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -4654,13 +4654,13 @@ def cumprod(
Input array.
axis : int, optional
Axis along which the cumulative sum is computed. The default (None) is
to compute the cumsum over the flattened array.
Axis along which the cumulative product is computed. The default (None)
is to compute the cumprod over the flattened array.
dtype : dtype, optional
Type of the returned array and of the accumulator in which the elements
are summed. If dtype is not specified, it defaults to the dtype of a,
unless a has an integer dtype with a precision less than that of the
are multiplied. If dtype is not specified, it defaults to the dtype of
a, unless a has an integer dtype with a precision less than that of the
default platform integer. In that case, the default platform integer is
used.
out : ndarray, optional
Expand All @@ -4670,7 +4670,7 @@ def cumprod(
Returns
-------
cumprod_along_axis : ndarray.
cumprod : ndarray
A new array holding the result is returned unless out is specified, in
which case a reference to out is returned. The result has the same size
as a, and the same shape as a if axis is not None or a is a 1-d array.
Expand All @@ -4679,6 +4679,16 @@ def cumprod(
--------
numpy.cumprod
Notes
-----
CuNumeric's parallel implementation may yield different results from NumPy
with floating point and complex types. For example, when boundary values
such as inf occur they may not propagate as expected. Consider the float32
array ``[3e+37, 1, 100, 0.01]``. NumPy's cumprod will return a result of
``[3e+37, 3e+37, inf, inf]``. However, cuNumeric might internally partition
the array such that partition 0 has ``[3e+37, 1]`` and partition 1 has
``[100, 0.01]``, returning the result ``[3e+37, 3e+37, inf, 3e+37]``.
Availability
--------
Multiple GPUs, Multiple CPUs
Expand Down Expand Up @@ -4725,7 +4735,7 @@ def cumsum(
Returns
-------
cumsum_along_axis : ndarray.
cumsum : ndarray.
A new array holding the result is returned unless out is specified, in
which case a reference to out is returned. The result has the same size
as a, and the same shape as a if axis is not None or a is a 1-d array.
Expand All @@ -4734,6 +4744,13 @@ def cumsum(
--------
numpy.cumsum
Notes
-----
CuNumeric's parallel implementation may yield different results from NumPy
with floating point and complex types. For example, when boundary values
such as inf occur they may not propagate as expected. For more explanation
check cunumeric.cumprod.
Availability
--------
Multiple GPUs, Multiple CPUs
Expand Down Expand Up @@ -4763,13 +4780,13 @@ def nancumprod(
Input array.
axis : int, optional
Axis along which the cumulative sum is computed. The default (None) is
to compute the cumsum over the flattened array.
Axis along which the cumulative product is computed. The default (None)
is to compute the nancumprod over the flattened array.
dtype : dtype, optional
Type of the returned array and of the accumulator in which the elements
are summed. If dtype is not specified, it defaults to the dtype of a,
unless a has an integer dtype with a precision less than that of the
are multiplied. If dtype is not specified, it defaults to the dtype of
a, unless a has an integer dtype with a precision less than that of the
default platform integer. In that case, the default platform integer is
used.
out : ndarray, optional
Expand All @@ -4779,7 +4796,7 @@ def nancumprod(
Returns
-------
cumprod_along_axis : ndarray.
nancumprod : ndarray.
A new array holding the result is returned unless out is specified, in
which case a reference to out is returned. The result has the same size
as a, and the same shape as a if axis is not None or a is a 1-d array.
Expand All @@ -4788,6 +4805,13 @@ def nancumprod(
--------
numpy.nancumprod
Notes
-----
CuNumeric's parallel implementation may yield different results from NumPy
with floating point and complex types. For example, when boundary values
such as inf occur they may not propagate as expected. For more explanation
check cunumeric.cumprod.
Availability
--------
Multiple GPUs, Multiple CPUs
Expand Down Expand Up @@ -4818,7 +4842,7 @@ def nancumsum(
axis : int, optional
Axis along which the cumulative sum is computed. The default (None) is
to compute the cumsum over the flattened array.
to compute the nancumsum over the flattened array.
dtype : dtype, optional
Type of the returned array and of the accumulator in which the elements
Expand All @@ -4833,7 +4857,7 @@ def nancumsum(
Returns
-------
cumsum_along_axis : ndarray.
nancumsum : ndarray.
A new array holding the result is returned unless out is specified, in
which case a reference to out is returned. The result has the same size
as a, and the same shape as a if axis is not None or a is a 1-d array.
Expand All @@ -4842,6 +4866,13 @@ def nancumsum(
--------
numpy.nancumsum
Notes
-----
CuNumeric's parallel implementation may yield different results from NumPy
with floating point and complex types. For example, when boundary values
such as inf occur they may not propagate as expected. For more explanation
check cunumeric.cumprod.
Availability
--------
Multiple GPUs, Multiple CPUs
Expand Down

0 comments on commit b38a1a4

Please sign in to comment.