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

[FEA] add argminmax function #691

Closed
tylera-nvidia opened this issue Aug 5, 2024 · 0 comments · Fixed by #778
Closed

[FEA] add argminmax function #691

tylera-nvidia opened this issue Aug 5, 2024 · 0 comments · Fixed by #778
Assignees
Labels
enhancement New feature or request

Comments

@tylera-nvidia
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
MatX currently only has a argmin and argmax function, requiring separate kernel launches for each. If a user needs both the min and max, we should be able to submit a single kernel to calculate both (really all 4 outputs).

Describe the solution you'd like

A single call returns minValue, minIdx, maxValue, and maxIdx, such as the call below:

(matx::mtie(minVal, minIdx, maxVal, maxIdx) = matx::argminmax(inFlattened)).run();

This should work for batched reductions as well( outputs are all some higher dimension tensor, matching the sizes of inFlattened).

Describe alternatives you've considered
We can currently compute these results with separate calls, but this is less performant.

@tylera-nvidia tylera-nvidia self-assigned this Aug 5, 2024
@tylera-nvidia tylera-nvidia added the enhancement New feature or request label Aug 5, 2024
@tylera-nvidia tylera-nvidia linked a pull request Aug 6, 2024 that will close this issue
tmartin-gh added a commit to tmartin-gh/MatX that referenced this issue Oct 22, 2024
tmartin-gh added a commit to tmartin-gh/MatX that referenced this issue Oct 22, 2024
@tmartin-gh tmartin-gh linked a pull request Oct 22, 2024 that will close this issue
tmartin-gh added a commit that referenced this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant