{"record":{"id":"9de4f0f80d38fc47","repo":"jax-ml/jax","slug":"unsupported-dot-algorithm-precision","errorCode":null,"errorMessage":"Unsupported dot algorithm: {precision}.","messagePattern":"Unsupported dot algorithm: (.+?)\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/triton/lowering.py","lineNumber":2378,"sourceCode":"    match precision:\n      case lax.DotAlgorithmPreset.TF32_TF32_F32:\n        input_precision = tt_dialect.InputPrecision.TF32\n      case lax.DotAlgorithmPreset.TF32_TF32_F32_X3:\n        input_precision = tt_dialect.InputPrecision.TF32x3\n      case lax.DotAlgorithmPreset.F32_F32_F32:\n        input_precision = tt_dialect.InputPrecision.IEEE\n      case (\n          lax.DotAlgorithmPreset.F16_F16_F16\n          | lax.DotAlgorithmPreset.F16_F16_F32\n          | lax.DotAlgorithmPreset.BF16_BF16_BF16\n          | lax.DotAlgorithmPreset.BF16_BF16_F32\n          | lax.DotAlgorithmPreset.BF16_BF16_F32_X3\n          | lax.DotAlgorithmPreset.BF16_BF16_F32_X6\n          | lax.DotAlgorithmPreset.BF16_BF16_F32_X9\n      ):\n        input_precision = None\n      case _:\n        raise NotImplementedError(f\"Unsupported dot algorithm: {precision}.\")\n\n    assert precision.supported_lhs_types is not None\n    assert precision.supported_rhs_types is not None\n    a = _cast(a, a_aval.dtype, precision.supported_lhs_types[0])\n    b = _cast(b, b_aval.dtype, precision.supported_rhs_types[0])\n    acc_dtype = precision.accumulation_type\n  elif isinstance(precision, tuple):\n    a_precision, b_precision = precision\n    if a_precision in _TF32_PRECISIONS or b_precision in _TF32_PRECISIONS:\n      input_precision = tt_dialect.InputPrecision.TF32\n    elif a_aval.dtype == jnp.float32:\n      input_precision = tt_dialect.InputPrecision.IEEE\n    else:\n      input_precision = None\n\n    acc_dtype = out_aval.dtype\n    if acc_dtype not in (jnp.int32, jnp.float16, jnp.float64):\n      acc_dtype = jnp.float32","sourceCodeStart":2360,"sourceCodeEnd":2396,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/triton/lowering.py#L2360-L2396","documentation":"When a lax.DotAlgorithm (algorithm-based precision, not a simple PrecisionLike string) is passed to a Pallas Triton dot, the lowering only supports a small whitelist of bf16→f32 presets (and a few others handled in other cases). Any other DotAlgorithm combination raises NotImplementedError at kernel lowering.","triggerScenarios":"Passing an explicit lax.DotAlgorithm (e.g. lax.DotAlgorithm(f32, f32, f32, ...)) or an unsupported preset such as F16_F16_F32_X5 to a pallas dot; using precision=lax.DotAlgorithmPreset.DEFAULT on a dtype combination not covered by the supported cases.","commonSituations":"Porting code that tuned matmul algorithms via lax.DotAlgorithm on CUDA/XLA to a Mosaic pallas kernel; assuming XLA's algorithm knobs carry over to the Triton backend.","solutions":["Use a plain precision string (lax.Precision.DEFAULT / HIGHEST) or None instead of a DotAlgorithm in the pallas kernel","If bf16 inputs, use one of the supported presets: BF16_BF16_F32, BF16_BF16_F32_X3/X6/X9","Raise a feature request / fall back to a non-pallas jax.lax.matmul path"],"exampleFix":"# before\nacc = pl.dot(a, b, precision=lax.DotAlgorithm(lax.DotAlgorithmPreset.F16_F16_F32_X9))\n\n# after\nacc = pl.dot(a, b, precision=lax.Precision.DEFAULT)","handlingStrategy":"validation","validationCode":"from jax._src.lax import lax as _lax\nSUPPORTED = {None, _lax.DotAlgorithmPreset.BF16_BF16_F32,\n             _lax.DotAlgorithmPreset.BF16_BF16_F32_X3,\n             _lax.DotAlgorithmPreset.BF16_BF16_F32_X6,\n             _lax.DotAlgorithmPreset.BF16_BF16_F32_X9}\nassert precision in SUPPORTED or precision is None","typeGuard":"def is_supported_precision(p) -> bool:\n    return p is None or isinstance(p, str) or str(type(p)).find('DotAlgorithm') >= 0","tryCatchPattern":null,"preventionTips":["Avoid lax.DotAlgorithm in pallas kernels; stick to Precision enums","Pin a test that runs each pallas kernel in CI to catch lowering gaps"],"tags":["jax","pallas","triton","precision","dot-algorithm"],"backgroundTag":"unsupported-precision-mode","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}