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

[Bug] Fantasizing is very slow on GPU due to torch.qr #1157

Closed
danielrjiang opened this issue May 22, 2020 · 3 comments
Closed

[Bug] Fantasizing is very slow on GPU due to torch.qr #1157

danielrjiang opened this issue May 22, 2020 · 3 comments
Labels

Comments

@danielrjiang
Copy link
Collaborator

🐛 Bug

torch.qr is causing things to be very slow on the GPU, when using fantasies. This is likely caused by pytorch/pytorch#22573.

To reproduce

See the following notebook example.
KG_GPU_investigate.ipynb.txt

** Stack trace/error message **
See the following profile results.
CPU
GPU
kg_cpu.cprofile.txt
kg_gpu.cprofile.txt

Expected Behavior

Running on CUDA should show speedups compared to CPU.

System information

Please complete the following information:

  • latest master
  • 1.6.0a0
  • Mac OS X Catalina 10.15.4
@jacobrgardner
Copy link
Member

Maybe we should put in some logic to use the Woodbury formula for small enough matrices? QR is better stability but likely slower for small matrices. @Balandat @gpleiss

@Balandat
Copy link
Collaborator

Yeah that makes sense. Also, looking through the code above that section, we know that the new_root here is diagonal if we use cholesky for the root decomposition (i.e. if L is lower triangualr). So we don't have to do any work, we can just do a triangular solve against eye to the get the inverse. So we should probably have two code paths, one where L is diagonal and one where it's not. For the general case of tall non-triangular L we can probably do woodbury.

@jacobrgardner
Copy link
Member

Fixed for now by #1224

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

No branches or pull requests

3 participants