Reductions tracking issue #61417
Labels
module: numpy
Related to numpy support, and also numpy compatibility of our operators
module: reductions
tracker
A tracking issue
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Uh oh!
There was an error while loading. Please reload this page.
This issue is for tracking and organizing tasks related to reduction operators. For 1.10 we are focusing on aligning API with the Python Array API Standard and test improvements.
Note that some of the tasks below need further discussion before we decide to commit to them.
API
Reduction operators should implement the Python Array API Standard which includes supporting all data types (unless noted in the documentation otherwise) and performing type promotion. They should be compatible with NumPy where possible (giving higher priority to the Python Array API Standard). Where applicable, they should support reducing over multiple dimensions.
Python Array API Standard
NumPy compatibility
Scalar and empty tensors
Variants
Type Promotion
Testing
Reduction operators have additional structure than other operators such as dim and keepdim parameters which can be exploited to automate testing of many features. To do so, we can create a ReductionInfo subclass of OpInfo and update
test_reductions.py
to follow the OpInfo pattern. Some example of tests that can be automated are ensuring reduction operators support reducing over multiple dimensions, reducing over nonzero dimensions of empty tensors, and even testing for correctness by providing a reference implementation such as a NumPy equivalent operator.TestReductionsCPU.test_nansum_out_dtype_cpu
is flaky, but its flakiness is currently hidden #59415test_reductions
ignoring some tests #53704Bugs
torch.sum(tensor, dim)
wheredim >= 64
#23159torch.median
on empty tensor causes segfault #61656Performance
x.sum(-1)
manually #57610min
/max
require a huge allocation on GPU #63869Feature Requests
Allow specifying a range for dimensions to reduce over
start_dim
andend_dim
functionality for common reduction operations. #54766Miscellaneous
cc @mruberry @rgommers @heitorschueroff @gchanan
The text was updated successfully, but these errors were encountered: