burn
burn copied to clipboard
Feature: Multinomial sampling
Pull Request Template
Checklist
- [ ] Confirmed that
run-checks allscript has been executed. - [ ] Made sure the book is up to date with changes in this PR.
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.
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.
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.
This PR has been marked as stale because it has not been updated for over a month
This PR has been marked as stale because it has not been updated for over a month
There hasn't been activity in this PR. Closing it for now. Please feel to reopen or create a brand new PR.