Repository navigation
What is the default multicore behaviour on TPUs? #36155
Replies: 1 comment
|
On TPU v4, a JAX logical device is normally configured as a Megacore containing two physical TensorCores. You can confirm the active configuration with This is intra-device parallelism, so it does not require an explicit JAX sharding primitive. HLO describes the computation and shapes for the whole logical device. Consequently, XProf can associate both TensorCore executions with the same full-shaped HLO instruction. That does not mean that both cores process the entire tensor. In a reproduction of Zero CMEM bandwidth is expected for this kernel. CMEM is shared scratch memory, not a cache that every Megacore operation must traverse. This elementwise operation has no cross-core communication or shared-data reuse, so XLA uses HBM → per-core VMEM/registers → HBM and does not use CMEM. If explicit control is required, Pallas exposes the TensorCore mesh within the logical device. A kernel can use |
Uh oh!
There was an error while loading. Please reload this page.
Hello, I'm benchmarking some simple kernels like
jax.lax.add,jax.lax.subtract, etc., on the TPUv4, and it looks like the kernel gets executed on both cores:The above is the trace from running jax.lax.abs on a 1x4096x256 tensor. It looks like both cores execute the kernel at the same time.
What I find confusing, though, is that the tensor does not seem to be split between the tensor cores. For example, selecting one of the blocks gives the same HLO for both cores:
I'm not using any Jax primitives to split the work, and I don't understand why it's running the operation on both cores. From the profile, it also looks like CMEM is not being used at all, as the read and write bandwidth utilization for both is zero. Could you please explain the behaviour?
All reactions