{"record":{"id":"4c2d5a34e2e6da33","repo":"jax-ml/jax","slug":"input-tiling-t-in-tiling-is-not-compatible-with","errorCode":null,"errorMessage":"Input tiling {t_in.tiling} is not compatible with {op}","messagePattern":"Input tiling (.+?) is not compatible with (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/experimental/mosaic/gpu/dialect_lowering.py","lineNumber":2285,"sourceCode":"        f\"but got {in_transforms=} and {out_transforms=}\"\n    )\n  src_ty = ir.MemRefType(op.src.type)\n  strides, _ = src_ty.get_strides_and_offset()\n  if strides != utils.get_contiguous_strides(src_ty.shape):\n    raise NotImplementedError(\n        \"Collapsing the shape of a memref with non-contiguous strides is not \"\n        \"supported\"\n    )\n  reassociation = tuple(len(ir.ArrayAttr(idx)) for idx in op.reassociation)\n\n  collapsed_tiling = cs.reduce_expression(\n      cs.CollapseShape(cs.SMEMTransforms(t_in, None), tuple(src_ty.shape),\n                       reassociation),\n      {},\n  )\n\n  if isinstance(collapsed_tiling, cs.Unsatisfiable):\n    raise ValueError(f\"Input tiling {t_in.tiling} is not compatible with {op}\")\n\n  assert isinstance(collapsed_tiling, cs.SMEMTransforms)\n  expected_t_out = collapsed_tiling.tiling\n  assert expected_t_out is not None\n  if expected_t_out != t_out:\n    raise ValueError(\n        \"Input/output tiling mismatch when attempting to collapse a shape. \"\n        f\"Expected output tiling to be {expected_t_out.tiling} for input \"\n        f\"tiling {t_in.tiling}, but got {t_out.tiling}\"\n    )\n\n\n@_register_lowering(memref.CollapseShapeOp, support_warp_semantics=True)\ndef _memref_collapse_shape_op_lowering_rule(\n    ctx: LoweringContext, op: memref.CollapseShapeOp\n) -> Sequence[ir.Value]:\n  del ctx\n","sourceCodeStart":2267,"sourceCodeEnd":2303,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/experimental/mosaic/gpu/dialect_lowering.py#L2267-L2303","documentation":"The input tiling is not collapsible under the given reassociation: the symbolic collapse computation (cs.CollapseShape) returned Unsatisfiable, meaning no output tiling exists that preserves the tile semantics for this reassociation pattern.","triggerScenarios":"memref.collapse_shape where a tile group would merge dimensions in a way incompatible with the tiling, e.g. collapsing a tiled dim with a partially-covering group so tiles cannot be represented.","commonSituations":"Collapsing leading dimensions of a tiled tensor where the tiling spans the collapse boundary with non-integer-multiple sizes.","solutions":["Change the reassociation so tile boundaries are respected (collapse whole tiles together)","Adjust tile shape so tiling aligns with the collapse groups","Retile or untile before collapsing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    lowered = lower_collapse(op)\nexcept ValueError as e:\n    if 'not compatible' in str(e):\n        regroup_reassociation(op)  # or untile first\n    raise","preventionTips":["Make reassociation groups respect tile boundaries","Choose tilings divisible by group sizes"],"tags":["jax","mosaic-gpu","collapse-shape","tiling","unsatisfiable"],"backgroundTag":"invalid-tiling-permutation","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}