Cannot change `jax_platform_name` on the fly
See original GitHub issueI am using jax.config.update('jax_platform_name', 'cpu')
to change the device placement.
import jax
import jax.numpy as np
a = np.zeros((128, 128))
print(a.device()) # TPU
jax.config.update('jax_platform_name', 'cpu')
a = np.zeros((128, 128))
print(a.device()) # TPU, expected CPU
Related: #8879
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
JAX Frequently Asked Questions (FAQ)
If you have a Python function that changes behavior after using jax.jit() , perhaps your function uses global state, or has side-effects.
Read more >jax rs service on wildfly doesn't seem reachable?
You can go to wildfly administration console and have a look in Deployments section what context path is your deployed application available at....
Read more >2 Oracle WebLogic Server
Change the order of the network cards in the machine so that the card with the actual node's host name is Card 1....
Read more >Beyond Van Gogh Jacksonville: The Immersive Experience
Jacksonville, prepare yourself for the most immersive experience. purchase tickets ... Location. Immersive Art Space 712 N Hogan St, Jacksonville, FL 32202 ...
Read more >I can't breathe. - Citi Blog
Citi bank can go the way of the NBA. Reply. avatar. Antonio. Ok. You are a corporation that's using tragedy to imply you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@theovincent
The correct way is:
jax_platform_name
isn’t intended to be set at run time. I suspect what you actually want to control is the default device placement, for which @skye was adding a context-manager-like API.(I don’t believe it landed yet, though.)