{"record":{"id":"c80b9ed3222a8071","repo":"jax-ml/jax","slug":"ragged-all-to-all-input-offsets-must-be-integer-ty","errorCode":null,"errorMessage":"ragged_all_to_all input_offsets must be integer type.","messagePattern":"ragged_all_to_all input_offsets must be integer type\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/lax/parallel.py","lineNumber":1645,"sourceCode":"        ir.IntegerType.get_signless(64), mlir.COLLECTIVE_CHANNEL_ID\n    )\n\n  return hlo.CustomCallOp(\n      result=[output.type],\n      inputs=[operand, output, input_offsets, send_sizes, output_offsets,\n              recv_sizes],\n      call_target_name=ir.StringAttr.get('ragged_all_to_all'),\n      backend_config=ir.DictAttr.get(ragged_all_to_all_attrs),\n      api_version=ir.IntegerAttr.get(ir.IntegerType.get_signless(32), 4),\n  ).results\n\ndef _ragged_all_to_all_effectful_abstract_eval(\n    operand, output, input_offsets, send_sizes, output_offsets, recv_sizes,\n    axis_name, axis_index_groups\n):\n  del operand, axis_index_groups\n  if not dtypes.issubdtype(input_offsets.dtype, np.integer):\n    raise ValueError(\"ragged_all_to_all input_offsets must be integer type.\")\n  if not dtypes.issubdtype(send_sizes.dtype, np.integer):\n    raise ValueError(\"ragged_all_to_all send_sizes must be integer type.\")\n  if not dtypes.issubdtype(output_offsets.dtype, np.integer):\n    raise ValueError(\"ragged_all_to_all output_offsets must be integer type.\")\n  if not dtypes.issubdtype(recv_sizes.dtype, np.integer):\n    raise ValueError(\"ragged_all_to_all recv_sizes must be integer type.\")\n  if len(input_offsets.shape) != 1 or input_offsets.shape[0] < 1:\n    raise ValueError(\n        \"ragged_all_to_all input_offsets must be rank 1 with positive dimension\"\n        \" size, but got shape {}\".format(input_offsets.shape)\n    )\n  if len(send_sizes.shape) != 1 or send_sizes.shape[0] < 1:\n    raise ValueError(\n        \"ragged_all_to_all send_sizes must be rank 1 with positive dimension\"\n        \" size, but got shape {}\".format(send_sizes.shape)\n    )\n  if len(output_offsets.shape) != 1 or output_offsets.shape[0] < 1:\n    raise ValueError(","sourceCodeStart":1627,"sourceCodeEnd":1663,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/lax/parallel.py#L1627-L1663","documentation":"ragged_all_to_all describes per-device payload boundaries via offset arrays; input_offsets must be an integer-dtype array. The abstract eval rejects floating (or other) dtypes with ValueError before lowering.","triggerScenarios":"Passing input_offsets as float32/float64 (e.g. from np.array([...]) default or computed float math) to lax.ragged_all_to_all.","commonSituations":"Computing offsets with float arithmetic; loading offsets from JSON/np arrays that default to float.","solutions":["Cast: input_offsets = input_offsets.astype(np.int64)","Compute offsets with integer arithmetic from the start","Validate dtypes before calling"],"exampleFix":"// before\nlax.ragged_all_to_all(x, out, np.array([0.0, 5.0]), sizes, 'i')\n// after\nlax.ragged_all_to_all(x, out, np.array([0, 5], dtype=np.int64), sizes, 'i')","handlingStrategy":"validation","validationCode":"import numpy as np\nassert np.issubdtype(np.asarray(input_offsets).dtype, np.integer), 'input_offsets must be int'","typeGuard":"def is_int_array(a): return np.issubdtype(np.asarray(a).dtype, np.integer)","tryCatchPattern":null,"preventionTips":["Centralize construction of offset arrays with an int dtype helper"],"tags":["jax","ragged-all-to-all","dtype"],"backgroundTag":"dtype-mismatch","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}