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

GPJAX silently enables JAX 64bit #128

Closed
thomaspinder opened this issue Nov 2, 2022 Discussed in #126 · 0 comments
Closed

GPJAX silently enables JAX 64bit #128

thomaspinder opened this issue Nov 2, 2022 Discussed in #126 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@thomaspinder
Copy link
Collaborator

Discussed in #126

Originally posted by patel-zeel November 1, 2022
Hi,

I was recently comparing my implementation of a method with GPJAX and noticed that things completely change after I import gpjax as gpx. It took me a while to figure out that it happened because of a change in the precision (from 32bit to 64 bit). Since, jax.random behaves differently for different precisions, I was getting completely different results (please refer to the code below). Would it be useful not to enable 64bit by default to avoid such problems? Another way to handle this might be to use jax.config.update("jax_enable_x64", True) in all documentation examples to make it a habit for gpjax users.

import jax
jax.config.update("jax_enable_x64", True)

key = jax.random.PRNGKey(0)
print(jax.random.normal(key, dtype=jax.numpy.float32))
print(jax.random.normal(key, dtype=jax.numpy.float64))

# Output
# -0.20584226
# -0.7847657764467411
```</div>
@thomaspinder thomaspinder added enhancement New feature or request good first issue Good for newcomers labels Nov 2, 2022
@thomaspinder thomaspinder added this to the v0.5.0 milestone Nov 2, 2022
@thomaspinder thomaspinder moved this to Todo in GPJax Nov 2, 2022
@thomaspinder thomaspinder self-assigned this Nov 3, 2022
@thomaspinder thomaspinder mentioned this issue Nov 3, 2022
6 tasks
Repository owner moved this from Todo to Done in GPJax Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant