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

Track and update changes to percentile in PyTorch and JAX backends #1693

Open
matthewfeickert opened this issue Nov 11, 2021 · 3 comments
Open
Assignees
Labels
API Changes the public API refactor A code change that neither fixes a bug nor adds a feature

Comments

@matthewfeickert
Copy link
Member

percentile was added to the tensorlib backends in PR #817 but there was outstanding issues with both PyTorch and JAX that required some nuance.

  • PyTorch is missing interpolation methods as of v1.10.1:

I've checked in again on pytorch/pytorch#59397 (comment) but I'm not really sure if we'll see this an interpolation option in torch in v1.10.1, so we might want to implement raise not implemented errors for the time being so that PR #817 can finally move forward. :/

Originally posted by @matthewfeickert in #815 (comment)

Both these Issues should be monitored in the future so that they can hopefully be resolved along the way to a patch release.

@matthewfeickert matthewfeickert self-assigned this Nov 11, 2021
@matthewfeickert matthewfeickert added refactor A code change that neither fixes a bug nor adds a feature API Changes the public API labels Nov 11, 2021
matthewfeickert added a commit that referenced this issue Nov 11, 2021
* Add percentile function to the tensor backends
* Add tests for percentile and its interpolation methods
   - JAX requires additional dtype support with the 'linear' interpolation method
     c.f. jax-ml/jax#8513
   - PyTorch has yet to implement interpolation method options
   - c.f. #1693
@matthewfeickert
Copy link
Member Author

Tracking for PyTorch has moved from pytorch/pytorch#59397 to pytorch/pytorch#70637. 👍

@matthewfeickert
Copy link
Member Author

matthewfeickert commented Feb 8, 2022

pytorch/pytorch#70637 has been merged on 2022-01-05, but was not in torch v1.10.2 which was released on 2022-01-27. It is scheduled to be in the next minor release: torch v1.11.0.


The JAX issue was already resolved through Issue #1729 and PR #1730.

@matthewfeickert
Copy link
Member Author

torch v1.11.0 which was released today (2022-03-10) and it now supports an interpolation keyword for torch.quantile

torch.quantile(input, q, dim=None, keepdim=False, *, interpolation='linear', out=None):
   ...

We should now be able to unify the percentile API support across backends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes the public API refactor A code change that neither fixes a bug nor adds a feature
Projects
Status: To do
Development

No branches or pull requests

1 participant