jax-ml/jax · error · ValueError
Mesh has subcores, but the current TPU chip has only…
Error message
Mesh has {self.num_subcores} subcores, but the current TPU chip has only {sc_info.num_subcores} subcores What it means
Validation in VectorSubcoreMesh.__post_init__: the requested num_subcores cannot exceed the physical subcore count of the current TPU chip (sc_info.num_subcores); an oversized mesh raises ValueError. The input at fault is the num_subcores field of the mesh.
Solutions
- Omit num_subcores so it defaults to the hardware value
- Set num_subcores = get_sparse_core_info().num_subcores
Example fix
# before mesh = pl_mosaic.VectorSubcoreMesh(..., num_subcores=8) # after mesh = pl_mosaic.VectorSubcoreMesh(..., num_subcores=get_sparse_core_info().num_subcores)
Defensive patterns
Strategy: validation
Validate before calling
n = get_sparse_core_info().num_subcores
assert kwargs.get('num_subcores', n) <= n Type guard
null
Try / catch
null
Prevention
- Leave num_subcores at its default
- Query hardware before constructing meshes
When it happens
Trigger: Building a VectorSubcoreMesh whose num_subcores exceeds get_sparse_core_info().num_subcores; default (num_subcores default_factory) normally matches hardware, so this happens when overriding it.
Common situations: Manually setting num_subcores for a different chip generation; assuming 2x subcore count relative to actual hardware.
Related errors
- Gather only supports loading from VMEM, got
- Get does not support loading from
- Get does not support masked scalar loads
- Get only supports loading scalars from SMEM.
- Get only supports slices with stride 1, got
AI-assisted analysis of jax-ml/jax@1e1c6a8fc0 (2026-08-27).
Data as JSON: /api/errors/23073126d78323bb.
Report an issue: GitHub.
Appendix: source
Thrown at jax/_src/pallas/mosaic/sc_core.py:134
class VectorSubcoreMesh(pallas_core.Mesh):
core_axis_name: str
subcore_axis_name: str
num_cores: int = dataclasses.field(
default_factory=lambda: get_sparse_core_info().num_cores
)
num_subcores: int = dataclasses.field(
default_factory=lambda: get_sparse_core_info().num_subcores
)
def __post_init__(self):
sc_info = get_sparse_core_info()
if self.num_cores > sc_info.num_cores:
raise ValueError(
f"Mesh has {self.num_cores} cores, but the current TPU chip has only"
f" {sc_info.num_cores} SparseCores"
)
if self.num_subcores > sc_info.num_subcores:
raise ValueError(
f"Mesh has {self.num_subcores} subcores, but the current TPU chip has"
f" only {sc_info.num_subcores} subcores"
)
@property
def core_type(self) -> tpu_core.CoreType:
return tpu_core.CoreType.SC_VECTOR_SUBCORE
@property
def default_memory_space(self) -> tpu_core.MemorySpace:
return tpu_core.MemorySpace.HBM
@property
def shape(self):
return collections.OrderedDict({
self.core_axis_name: self.num_cores,
self.subcore_axis_name: self.num_subcores,
})View on GitHub (pinned to 1e1c6a8fc0)