{"record":{"id":"d5007648d24a51af","repo":"jax-ml/jax","slug":"ragged-all-to-all-output-offsets-must-be-integer-t","errorCode":null,"errorMessage":"ragged_all_to_all output_offsets must be integer type.","messagePattern":"ragged_all_to_all output_offsets must be integer type\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/lax/parallel.py","lineNumber":1649,"sourceCode":"      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(\n        \"ragged_all_to_all output_offsets must be rank 1 with positive\"\n        \" dimension size, but got shape {}\".format(output_offsets.shape)\n    )\n  if len(recv_sizes.shape) != 1 or recv_sizes.shape[0] < 1:","sourceCodeStart":1631,"sourceCodeEnd":1667,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/lax/parallel.py#L1631-L1667","documentation":"output_offsets passed to ragged_all_to_all must be an integer-dtype array; the abstract eval rejects non-integer dtypes before compilation.","triggerScenarios":"Passing a float-typed output_offsets array to lax.ragged_all_to_all.","commonSituations":"Reusing a single float offsets buffer for both input and output offsets; serialization round-trips producing floats.","solutions":["Cast output_offsets to an integer dtype","Keep a single validated int offsets helper used for all sides"],"exampleFix":"// before\nlax.ragged_all_to_all(x, out, offs, sizes, 'i', output_offsets=np.array([0., 4.]))\n// after\nlax.ragged_all_to_all(x, out, offs, sizes, 'i', output_offsets=np.array([0, 4], dtype=np.int64))","handlingStrategy":"validation","validationCode":"assert np.issubdtype(np.asarray(output_offsets).dtype, np.integer), 'output_offsets must be int'","typeGuard":"def is_int_array(a): return np.issubdtype(np.asarray(a).dtype, np.integer)","tryCatchPattern":null,"preventionTips":["Avoid reusing float buffers for offsets"],"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"}