Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Replace numpy cholesky with torch.linalg.cholesky_ex #996

Closed
wants to merge 1 commit into from
Closed

Replace numpy cholesky with torch.linalg.cholesky_ex #996

wants to merge 1 commit into from

Conversation

horizon-blue
Copy link
Contributor

Summary:
In the past we used numpy.cholesky in NMC implementation because torch.cholesky fails very slowly in comparison. Since a workaround has been proposed in pytorch/pytorch#34272, we can now switch back to using torch and avoid the numpy conversion.

A small benchmark to show the run time difference with the workaround: N1136967

(I just happen to spot this when I was looking at NMC to see how to merge the infra together. There will probably be quite a few changes coming on single site infra -- I will try to keep each of them small to make reviewing easier :).)

Differential Revision: D30895231

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Sep 13, 2021
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D30895231

Summary:
Pull Request resolved: #996

In the past we used `numpy.cholesky` in NMC implementation because `torch.cholesky` fails very slowly in comparison. Since a workaround has been proposed in pytorch/pytorch#34272, we can now switch back to using torch and avoid the numpy conversion.

A small benchmark to show the run time difference with the workaround: N1136967

(I just happen to spot this when I was looking at NMC to see how to merge the infra together. There will probably be quite a few changes coming on single site infra -- I will try to keep each of them small to make reviewing easier :).)

Reviewed By: jpchen, neerajprad

Differential Revision: D30895231

fbshipit-source-id: b9c5de5213f22ea68729404415247254e9003968
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D30895231

@facebook-github-bot
Copy link
Collaborator

This pull request has been merged in 33605f1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants