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

Allow OpenCL simplex to use softmax? #2968

Open
SteveBronder opened this issue Oct 25, 2023 · 2 comments
Open

Allow OpenCL simplex to use softmax? #2968

SteveBronder opened this issue Oct 25, 2023 · 2 comments

Comments

@SteveBronder
Copy link
Collaborator

Description

I'm in the process of writing out the deserializer for OpenCL so we can have models that run entirely on the GPU. We do not yet have a simplex_constrain/unconstrain function in OpenCL.

I could do the stick breaking scheme on the gpu, I think it would be a weighted prefix product. That's possible for me to write but will take me a minute. The other alternative is just to use softmax. Since that's just exp(x_i) / sum(exp(X)) that's much easier to write for the GPU.

The downside of the softmax is that the cpu/gpu versions will be different, but we could just add that to the user docs so people know.

Does anyone have thoughts on this?

Current Version:

v4.7.0

@WardBrian
Copy link
Member

@mjhajharia @bob-carpenter

@spinkney
Copy link
Collaborator

spinkney commented Nov 1, 2023

For ease of writing on the gpu and stability I believe the softplus will be better. Retagging @bob-carpenter who has looked into this.

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

No branches or pull requests

3 participants