{"record":{"id":"060549b6bdc3e6b8","repo":"jax-ml/jax","slug":"unsupported-dot-precision-precision","errorCode":null,"errorMessage":"Unsupported dot precision: {precision}","messagePattern":"Unsupported dot precision: (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/mosaic/lowering.py","lineNumber":2945,"sourceCode":"      dimension_numbers, lhs_aval.shape, rhs_aval.shape\n  )\n\n  if precision is not None:\n    if precision[0] != precision[1]:\n      raise NotImplementedError(\"Per-operand dot precision unsupported\")\n    precision = precision[0]\n  if precision is None or precision == lax.Precision.DEFAULT:\n    precision_attr = None  # That's the default in Mosaic.\n  elif precision == lax.Precision.HIGH:\n    precision_attr = ir.Attribute.parse(\n        \"#tpu.contract_precision<bf16x3>\"\n    )\n  elif precision == lax.Precision.HIGHEST:\n    precision_attr = ir.Attribute.parse(\n        \"#tpu.contract_precision<fp32>\"\n    )\n  else:\n    raise NotImplementedError(f\"Unsupported dot precision: {precision}\")\n  out_tile = arith.constant(\n      out_type, ir.DenseElementsAttr.get_splat(out_type, val)\n  )\n  # Contracting second minor is to transpose the lhs. Only try fusing if it's\n  # an implicit transpose.\n  implicit_transpose = (ctx.avals_in[0].ndim - 2) in lhs_dims\n  return tpu.matmul(\n      out_type,\n      x,\n      y,\n      out_tile,\n      dimension_numbers=tpu_dot_dims,\n      precision=precision_attr,\n      transpose_lhs_hint=not ctx.forward_compatible\n      and ctx.lowering_context.fuse_transposed_lhs_in_matmul\n      and implicit_transpose,\n  )\n","sourceCodeStart":2927,"sourceCodeEnd":2963,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/mosaic/lowering.py#L2927-L2963","documentation":"Mosaic's dot lowering only understands DEFAULT, HIGH (bf16x3), and HIGHEST (fp32) contract precisions. Any other lax.Precision value (or a raw string/enum it doesn't recognize) fails here.","triggerScenarios":"Passing a lax.Precision value outside {None, DEFAULT, HIGH, HIGHEST} to dot_general in a Pallas Mosaic kernel, e.g. a custom or legacy precision enum value.","commonSituations":"Cross-backend kernels that enumerate all Precision members; stale precision constants after JAX version changes.","solutions":["Use lax.Precision.DEFAULT, HIGH, or HIGHEST","Pass precision=None"],"exampleFix":"// before\nout = lax.dot(a, b, precision=some_precision)\n// after\nout = lax.dot(a, b, precision=lax.Precision.HIGHEST)","handlingStrategy":"validation","validationCode":"import jax.lax as lax\nallowed = {None, lax.Precision.DEFAULT, lax.Precision.HIGH, lax.Precision.HIGHEST}\nassert precision in allowed","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Stick to the three canonical Precision values","Centralize precision config per backend"],"tags":["jax","pallas","tpu","precision","dot-general"],"backgroundTag":"unsupported-precision-mode","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}