jax icon indicating copy to clipboard operation
jax copied to clipboard

jax.lax.create_token() always returns the same object

Open chaserileyroberts opened this issue 2 years ago • 3 comments

Description

The method jax.lax.create_token() always returns the same singleton object, meaning all tokens are the same. This may be an issue if you want to do concurrent things.

>>> jax.lax.create_token()
<jax._src.core.Token object at 0x7fff35329930>
>>> jax.lax.create_token()
<jax._src.core.Token object at 0x7fff35329930>
>>> jax.lax.create_token()
<jax._src.core.Token object at 0x7fff35329930>
>>> jax.lax.create_token()
<jax._src.core.Token object at 0x7fff35329930>

What jax/jaxlib version are you using?

0.4.25

Which accelerator(s) are you using?

GPU

Additional system info?

Linux

NVIDIA GPU info

No response

chaserileyroberts avatar Feb 11 '24 00:02 chaserileyroberts

Hi @chaserileyroberts

This issue appears to be resolved with JAX 0.4.28. I tested this on Colab GPU using JAX cuda version 0.4.28. Now, jax.lax.create_token() produces different tokens at different runs.

Please find the gist for reference.

Thank you

rajasekharporeddy avatar May 10 '24 12:05 rajasekharporeddy

I think @yueshengys fixed this... Yue confirm?

hawkinsp avatar May 10 '24 12:05 hawkinsp

Yes, it's been fixed since https://github.com/google/jax/pull/20706.

yueshengys avatar May 10 '24 17:05 yueshengys