-
Notifications
You must be signed in to change notification settings - Fork 661
Feature: Multinomial sampling #2850
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
base: main
Are you sure you want to change the base?
Conversation
Great timing as I quite need this function! I just need the CubeCL version, would you say that is already usable? Any plans to continue this PR? Thank you for the contribution |
@ArthurBrussee Hey, so I am currently kinda stuck on the CubeCL version, as I am very new to CubeCL in general. I will then want to run some benchmarks to make sure nothing silly is happening, especially with the Candle backend. I tested it a little locally and it seems to work well, but I wanna make sure it is at least as good as the CPU impl for large Tensors + that it uses GPU resources as much as possible. |
dd3883c
to
b1a0b95
Compare
This PR has been marked as stale because it has not been updated for over a month |
Hi @Pablo1785 , any progress on this PR? I'm interested in this functionality. |
2bf28d3
to
b70dfd8
Compare
This PR has been marked as stale because it has not been updated for over a month |
Pull Request Template
Checklist
run-checks all
script has been executed.Related Issues/PRs
Would resolve:
#1121
Since the discussion seemed to die down in the issue and I found myself in need of the Multinomial distribution sampler, I decided to take a shot at implementing this.
One issue to solve is how to pass the probabilities to the Cube Launch (how to turn a Tensor into a TensorArg?)
Changes
Add multinomial distribution implementation for all backends. Potential breaking change: Distribution can no longer derive Copy, since Multinomial distribution has to contain a collection of probabilities, which could potentially be very large.
Testing
Describe how these changes have been tested.