Skip to content

Conversation

@vishwakftw
Copy link
Contributor

This PR performs a renaming of the function potrf responsible for the Cholesky
decomposition on positive definite matrices to cholesky as NumPy and TF do.

Billing of changes

  • make potrf cname for cholesky in Declarations.cwrap
  • modify the function names in ATen/core
  • modify the function names in Python frontend
  • issue warnings when potrf is called to notify users of the change

cc: @zou3519

This PR performs a renaming of the function `potrf` responsible for the Cholesky
decomposition on positive definite matrices to `cholesky` as NumPy and TF do.

Billing of changes
- make potrf cname in Declarations.cwrap
- modify the function names in ATen/core
- modify the function names in Python frontend
- issue warnings when potrf is called to notify users of the change
@t-vi
Copy link
Collaborator

t-vi commented Oct 16, 2018

Please don't call it cholesky unless the default is lower triangular.
This transforms it from a function that is different from numpy to one that is more subtly different to numpy.

I might add that I would have preferred if we could have had this coordinated with the batch cholesky.

@vishwakftw
Copy link
Contributor Author

I do concur with you regarding the lower triangular property. I'll see what can be done - but on a side note: won't the docs help with this?

Regarding batch_potrf, there seems to be a lot in that PR (potrf, tril and triu), and thought it would take a while before being merged into master. The changes in this PR will perhaps affect only the naming for batch_potrf and maybe doc strings and tests, which is why I isolated this separately.

@ezyang
Copy link
Contributor

ezyang commented Oct 17, 2018

@t-vi @vishwakftw Would you two mind coming up with a plan for how to order these diffs?

@t-vi
Copy link
Collaborator

t-vi commented Oct 17, 2018

The batch potrf needs @vishwakftw 's batch inverse #9949 to go in first and a rebase is waiting on that. Richard left a bunch of review comments on the bug, so if Vishwak is fast to fix them, I'd redo the potrf patch. I don't think tril will be a huge delay.

@vishwakftw
Copy link
Contributor Author

vishwakftw commented Oct 18, 2018

@t-vi @ezyang I chatted with @zou3519 about the batch inverse PR - he said he should be able to complete code review soon.

The stack that I think would be practical

#9949 Batched Inverse
#12699 Rename potrf to cholesky
#11796 Batched potrf

@t-vi
Copy link
Collaborator

t-vi commented Oct 18, 2018

"So my own patch first" is what everyone finds best. 🤷‍♂️ But yeah, I can live with any ordering, as long as it makes everyone else happy.
Personally, I think this renaming should be part of a larger move towards NumPy/SciPy naming, but that's me.

@vishwakftw
Copy link
Contributor Author

@t-vi The ordering is something I don't mind either. It's just that there will be a lot of additional cleaning up to do after your batch potrf PR lands. But it would be equally hard for you if this PR lands, so I think it needs more discussion. I opened this PR after having a chat with @zou3519 (hence the cc).

But yes, maybe renaming potrf to cholesky could be part of a larger move on making PyTorch more NumPy-like :) , and this PR could be deferred accordingly.

@t-vi
Copy link
Collaborator

t-vi commented Oct 18, 2018

No, no, you should go first. Does this PR even conflict with the batch_inverse? If not it wouldn't even have to wait.

@vishwakftw
Copy link
Contributor Author

This PR doesn't conflict with batch inverse. It only conflicts with batch potrf.

@vishwakftw
Copy link
Contributor Author

@zou3519 Is this good to go?

Copy link
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ezyang
Copy link
Contributor

ezyang commented Oct 24, 2018

Unfortunately we're going to need to fix some internal stuff to track this name change, so we can't land this quite yet (your job is done though!). @zou3519 are you going to handle it?

@zou3519
Copy link
Contributor

zou3519 commented Oct 24, 2018

@ezyang yes, can do :)

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@vishwakftw
Copy link
Contributor Author

I am resolving conflicts, will update the branch shortly.

@zou3519
Copy link
Contributor

zou3519 commented Oct 30, 2018

On my way to importing it and merging it...

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

xw285cornell pushed a commit to xw285cornell/pytorch that referenced this pull request Nov 1, 2018
Summary:
This PR performs a renaming of the function `potrf` responsible for the Cholesky
decomposition on positive definite matrices to `cholesky` as NumPy and TF do.

Billing of changes
- make potrf cname for cholesky in Declarations.cwrap
- modify the function names in ATen/core
- modify the function names in Python frontend
- issue warnings when potrf is called to notify users of the change

Reviewed By: soumith

Differential Revision: D10528361

Pulled By: zou3519

fbshipit-source-id: 19d9bcf8ffb38def698ae5acf30743884dda0d88
@vishwakftw
Copy link
Contributor Author

Oh, this got merged in. Thank you @zou3519 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants