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

Lower cummax #8230

Open
miladm opened this issue Oct 7, 2024 · 2 comments · May be fixed by #8491
Open

Lower cummax #8230

miladm opened this issue Oct 7, 2024 · 2 comments · May be fixed by #8491

Comments

@miladm
Copy link
Collaborator

miladm commented Oct 7, 2024

🚀 Feature

Lower cummax https://github.com/pytorch/pytorch/blob/main/aten/src/ATen/native/native_functions.yaml#L1918-L1922

@zyy-martin zyy-martin linked a pull request Dec 13, 2024 that will close this issue
@zyy-martin
Copy link

Adding some findings so far:

  1. the difference between cummax/cummin and cumprod/cumsum is that the pytorch API also returns a tensor representing the indices of the max values in the tensor: https://pytorch.org/docs/stable/generated/torch.cummax.html.
  2. The current implementation of cumsum uses the xla::ReduceWindowWithGeneralPadding function with the xla:Add computation.
  3. However, if we were to get the indices of the min/max values, we can probably concatenate the original tensor with iota as indicies and use a computation that keeps both the values and indices. Need to investigate more to see if this is already supported somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants