{"record":{"id":"7579286937ff04ac","repo":"jax-ml/jax","slug":"unsupported-pipeline-mode-pipeline-mode","errorCode":null,"errorMessage":"Unsupported pipeline mode: {pipeline_mode}.","messagePattern":"Unsupported pipeline mode: (.+?)\\.","errorType":"validation","errorClass":"LoweringException","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/mosaic/lowering.py","lineNumber":1267,"sourceCode":"            isinstance(bd, (pallas_core.Element, pallas_core.Squeezed))\n            for bd in bm.block_shape\n        ]\n        if not all(is_element_or_squeezed_block):\n          raise NotImplementedError(\n              \"All block dimensions must be Elements or none of them can be\"\n              \" Elements.\"\n          )\n        padding = [\n            bd.padding if isinstance(bd, pallas_core.Element) else (0, 0)\n            for bd in bm.block_shape\n        ]\n        pad_low, pad_high = map(list, zip(*padding))\n        block_params[\"window_kind\"] = ir.Attribute.parse(\n            f\"#tpu.element_window<{pad_low},{pad_high}>\"\n        )\n      if pipeline_mode is not None:\n        if not isinstance(pipeline_mode, pallas_core.Buffered):\n          raise LoweringException(\n              f\"Unsupported pipeline mode: {pipeline_mode}.\"\n          )\n        if pipeline_mode.use_lookahead:\n          raise NotImplementedError(\n              \"Lookahead is not supported for XLA pipeline emitter lowering.\"\n          )\n        buffer_count = pipeline_mode.buffer_count\n        if buffer_count < 1 or buffer_count > 2:\n          raise LoweringException(\n              \"Only single (1) and double (2) buffering are supported. Got\"\n              f\" {buffer_count}.\"\n          )\n        pipeline_mode_str = \"synchronous\" if buffer_count == 1 else \"double_buffered\"\n        block_params[\"pipeline_mode\"] = ir.Attribute.parse(\n            f\"#tpu.pipeline_mode<{pipeline_mode_str}>\"\n        )\n        if pipeline_mode.revisit is not None:\n          if (","sourceCodeStart":1249,"sourceCodeEnd":1285,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/mosaic/lowering.py#L1249-L1285","documentation":"The pipeline_mode argument of the TPU lowering must be a pallas_core.Buffered instance (single or double buffering). Any other value — an int, string, or a newer/unrecognized pipeline mode object — raises LoweringException with the offending value.","triggerScenarios":"Passing pipeline_mode as a non-Buffered value to lower_jaxpr_into_pipelined_module / lower_jaxpr_to_pipelined_module, e.g. pipeline_mode=2 or pipeline_mode='double_buffered' instead of pallas_core.Buffered(buffer_count=2).","commonSituations":"Calling the lowering API directly instead of via pallas_call; code written against an older/newer JAX where the pipeline_mode representation changed (e.g. from ints/enums to Buffered dataclass); copying internal example code with a stale signature.","solutions":["Pass pallas_core.Buffered(buffer_count=1 or 2) (or None) for pipeline_mode","Prefer the public pallas_call API, which constructs pipeline_mode correctly, over calling the lowering directly","Check the signature of lower_jaxpr_into_pipelined_module in your installed JAX version and update call sites"],"exampleFix":"# before\nlower_jaxpr_into_pipelined_module(..., pipeline_mode=2)\n\n# after\nfrom jax._src.pallas import pallas_core\nlower_jaxpr_into_pipelined_module(..., pipeline_mode=pallas_core.Buffered(buffer_count=2))","handlingStrategy":"type-guard","validationCode":"from jax._src.pallas import pallas_core\ndef valid_pipeline_mode(pm):\n    return pm is None or isinstance(pm, pallas_core.Buffered)","typeGuard":"def is_supported_pipeline_mode(pm) -> bool:\n    from jax._src.pallas import pallas_core\n    return pm is None or isinstance(pm, pallas_core.Buffered)","tryCatchPattern":"try:\n    lower_jaxpr_into_pipelined_module(..., pipeline_mode=pm)\nexcept LoweringException as e:\n    if 'Unsupported pipeline mode' in str(e):\n        pm = pallas_core.Buffered(buffer_count=2); retry","preventionTips":["Only pass pallas_core.Buffered or None as pipeline_mode","Prefer pallas_call's public parameters over calling the lowering directly"],"tags":["jax","pallas","tpu","pipeline-mode","api-misuse"],"backgroundTag":"pallas-invalid-pipeline-mode","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}