RSSAmplifier

jeffcarp · Mar 13, 2025

How to Fake Multiple CPUs in JAX

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

Here’s how to emulate multiple CPUs when running JAX. This makes it easy to
test multi-TPU/GPU code without actually needing the accelerators. 
 import os
 os . environ[ 'XLA_FLAGS' ] = (
 os . environ . get( 'XLA_FLAGS' , '' ) + 
 ' --xla_force_host_platform_device_count=8' 
 )
 
 import jax
 jax . devices()
 [CpuDevice(id=0),
…

Read on /posts/2025/fake-multiple-cpus-jax/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.