-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Improve Gamma sampling #12943
Improve Gamma sampling #12943
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
090782c
to
9271e63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, though I'm a bit hesitant to merge this without understanding why lax.map
was used in the first place, and confirming that that reason no longer is important. Have you been able to discern that?
cc @fehiepsi -- looks like it was added when the grad was still implemented in this file. I can try a quick benchmark for now? |
@jakevdp actually it does indeed faster to map on cpu, I had a bug in my benchmark. Also would probably good to leave these potential changes in separate PRs. Therefore I changed this PR to only include the lax cond change |
lax.log(V)))))) | ||
lax.log(V))))) | ||
false_fun = lambda: np.bool_(False) | ||
cond = lax.cond(pred, true_fun, false_fun) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this change make things faster? Could you post some benchmark numbers?
It seems like this has become stale. I'm going to close for now – feel free to re-open if you'd like to continue working on this! |
This fixes: