question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deprecate X64 flag

See original GitHub issue

This is the external tracking bug for deprecation of the X64 flag.

The final desired outcome here is the following:

  • X64 flag no longer exists
  • jax.numpy functions (e.g. jnp.arange, jnp.zeros, etc.) default to 32-bit, unless an explicit dtype is requested.
  • Python scalars default to weak-typed 64-bit

The plan is roughly the following:

  1. Change jax.numpy function defaults to 32-bit. This should only affect users of X64 mode, and will require adding explicit 64-bit dtypes to some code. At this point, enabling X64 will produce the desired long-term behavior.
  2. Change the default X64 flag state to True. Users can still recover X32 behavior by explicitly setting it to False
  3. Deprecate setting the X64 flag
  4. Remove the X64 flag

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jakevdpcommented, Oct 19, 2021

The main rationale is that the modalism in the API complicates JAX both from a user perspective and a developer perspective.

For the user, there’s no way to reason about how a particular block of code will behave without global knowledge of the environment in which it is run (e.g. the value of the JAX_ENABLE_X64 environment variable at the time that JAX was imported).

Additionally, due to the way JAX tracing works, attempts to allow local overrides of the global state face fundamental challenges (e.g. https://github.com/google/jax/issues/5982).

Confusion about the x64 flag is one of the most common drivers of user confusion in our feedback forums.

Other similar frameworks (e.g. pytorch and tensorflow) do not have any such global modalism.

On the developer side, the global flag doubles the amount of CI testing we need to cover the package, and means that every line of code in the package must be written with this modalism in mind.

Of course, removing this would not come without tradeoffs: namely, some users would have to add more dtype specifications to their code in cases that they want 64-bit values.

These are some of the reasons we’ve decided to explore the possibility of deprecating the X64 flag. I’m curious to hear what thoughts you have – thanks

2reactions
connection-on-fiber-bundlescommented, Oct 19, 2021

Could you please shed some light on the rationale behind this change? It seems quite inconvenient for certain use cases, in which a global switch on 32 or 64 bit could be handy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using deprecated x86_32 instructions in 64 bit mode
It didn't just get 'deprecated', it was entirely removed for 64-bit code. You simple check the OF flag with the JO and JNO...
Read more >
/Wp64 (Detect 64-Bit Portability Issues) | Microsoft Learn
The /Wp64 compiler option and __w64 keyword are deprecated in Visual Studio 2010 and Visual Studio 2012, and not supported starting in Visual ......
Read more >
How To Use Gflags (formerly Google Commandline Flags)
DEFINE_bool defines a boolean flag. Here are the types supported: DEFINE_bool : boolean; DEFINE_int32 : 32-bit integer; DEFINE_int64 : 64-bit ...
Read more >
Modern x64 Assembly 9: The rFlags Register (Flags, pushfq ...
Modern x64 Assembly 9: The rFlags Register ( Flags, pushfq, popfq, pushf, popf).
Read more >
Compiling 64-Bit Code - Apple Developer
Compiling 64-Bit Code Using GCC · Compiling 64-Bit Code Using Xcode · Using Architecture-Specific Flags · Sending feedback… · We're sorry, an error ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found