{"record":{"id":"2bb6c67f162cad1e","repo":"jax-ml/jax","slug":"reshape-not-supported-yet-aval-in-aval-out","errorCode":null,"errorMessage":"reshape not supported yet: {aval_in}, {aval_out}","messagePattern":"reshape not supported yet: (.+?), (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/fuser/block_spec.py","lineNumber":2467,"sourceCode":"          'reshape with non-matching block size on lanes not supported yet:'\n          f' {block_shape}'\n      )\n    new_block_shape = (*block_shape[:-2], total_block_size)\n\n    def new_block_index_transform(*idxs):\n      *idx, second_to_last, last = block_transform.block_index_transform(*idxs)\n      # last should always be 0\n      if not isinstance(last, int) and last != 0:\n        raise NotImplementedError(\n            'Must select entire block on last dimension for reshape'\n        )\n      return *idx, second_to_last\n\n    return [block_transform.replace(\n                block_shape=new_block_shape,\n                block_index_transform=new_block_index_transform,)]\n\n  raise NotImplementedError(f'reshape not supported yet: {aval_in}, {aval_out}')\n\n\n@register_eval_rule(lax.reshape_p)\ndef _reshape_eval_rule(\n    eval_ctx: KernelEvalContext, x, *, dimensions, new_sizes, sharding\n):\n  del sharding, dimensions, new_sizes\n  out_shape_nones = tuple(\n      _block_size(s) for s in eval_ctx.out_block_specs[0].block_shape\n  )\n  out_shape = tuple(s for s in out_shape_nones if s is not None)\n  # Because we have restricted the pull block spec rule, we can just apply a\n  # basic reshape here.\n  x = x.reshape(out_shape)\n  return x\n\n\n@register_pull_block_spec_rule(lax.reduce_sum_p)","sourceCodeStart":2449,"sourceCodeEnd":2485,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/fuser/block_spec.py#L2449-L2485","documentation":"Raised by the Pallas fuser's block-spec propagation when a reshape between two shapes cannot be expressed with the current block-shape machinery: the input/output avals (aval_in, aval_out) do not admit a supported reshape of the tiled block shape (e.g. non-matching block sizes on lanes), which the fuser does not implement yet.","triggerScenarios":"Thrown at jax/_src/pallas/fuser/block_spec.py:2467 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restructure the kernel so the reshape matches the supported fused block patterns (avoid reshaping across tiled/lane dimensions)","Select the entire block on the last dimension so the reshape can legally collapse it","Move the reshape out of the Pallas kernel and perform it in the surrounding JAX code","Update JAX; this 'not supported yet' limitation may be lifted in newer releases"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}