{"record":{"id":"c10a879c9e1b4cf6","repo":"jax-ml/jax","slug":"non-mesh-axes","errorCode":null,"errorMessage":"{non_mesh_axes}","messagePattern":"\\{non_mesh_axes\\}","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/mosaic/interpret/utils.py","lineNumber":201,"sourceCode":"  device_id = []\n  for axis in axis_names:\n    if axis in physical_axis_dict:\n      device_id.append(physical_axis_dict[axis])\n    else:\n      device_id.append(axis_indices[axis])\n  non_mesh_axes = {\n      k: v for k, v in physical_axis_dict.items() if k not in axis_names\n  }\n  return tuple(device_id), non_mesh_axes\n\n\ndef device_coords_to_logical_id(device_coords, axis_sizes, axis_indices):\n  if isinstance(device_coords, dict):\n    device_coords, non_mesh_axes = _device_id_dict_to_mesh(\n        device_coords, axis_sizes, axis_indices\n    )\n    if non_mesh_axes:\n      raise NotImplementedError(non_mesh_axes)\n  if not isinstance(device_coords, tuple):\n    device_coords = (device_coords,)\n  assert len(device_coords) == len(axis_sizes)\n  sizes = list(axis_sizes.values())\n  ret = 0\n  for i in range(len(device_coords)):\n    ret += device_coords[i] * math.prod(sizes[i + 1 :])\n  return ret\n\n\ndef _device_id_to_logical(device_id, device_id_type, axis_sizes, axis_indices):\n  if device_id is None:\n    return None\n  if device_id_type == primitives.DeviceIdType.MESH:\n    return device_coords_to_logical_id(device_id, axis_sizes, axis_indices)\n  elif device_id_type == primitives.DeviceIdType.LOGICAL:\n    return device_id\n  else:","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/mosaic/interpret/utils.py#L183-L219","documentation":"After converting a device-coordinate dict to mesh coordinates, some axes remained that are not part of either mesh — they could not be mapped into the logical program ID, so device_coords_to_logical_id raises NotImplementedError listing those axes.","triggerScenarios":"Passing device coordinates (dict form) containing axis names that appear in neither the JAX mesh nor the Pallas grid axis_sizes; e.g. stale or misspelled axis names.","commonSituations":"Renaming mesh axes in one place but not another; leftover axes from a previous sharding config; hand-built device coordinate dicts in tests.","solutions":["Remove or correct the extraneous axes named in the error so all dict axes belong to the mesh/grid","Verify axis_sizes passed to interpret params matches the actual Mesh/Grid axis names","Regenerate device coordinates from the current mesh instead of hardcoding"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"known = set(axis_sizes)\nextra = [a for k in device_coords if isinstance(k, tuple) for a in k if a not in known] or [k for k in device_coords if not isinstance(k, tuple) and k not in known]\nassert not extra, f'unknown axes: {extra}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate device coordinate dicts from the live Mesh/Grid objects instead of hardcoding axis names","Re-validate axis names after any sharding refactor"],"tags":["jax","pallas","mesh","device-id","axis-name","interpret-mode"],"backgroundTag":"unknown-axis-name","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}