{"record":{"id":"34cb529206dacc43","repo":"jax-ml/jax","slug":"only-positional-arguments-are-supported-by-debug-p-34cb52","errorCode":null,"errorMessage":"Only positional arguments are supported by debug_print on Pallas.","messagePattern":"Only positional arguments are supported by debug_print on Pallas\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/mosaic_gpu/lowering.py","lineNumber":3523,"sourceCode":"@register_lowering_rule(debugging.debug_print_p, *gpu_core.WGxWARP_SEMANTICS)\ndef _debug_print_lowering_rule(\n    ctx: LoweringRuleContext,\n    *args,\n    fmt,\n    ordered,\n    partitioned,\n    in_tree,\n    static_args,\n    np_printoptions,\n    has_placeholders,\n    logging_record,\n):\n  del partitioned, np_printoptions, has_placeholders\n  if ordered:\n    raise NotImplementedError(\"Ordered debug_print is not supported on Pallas.\")\n  args, kwargs = debugging.merge_callback_args(in_tree, args, static_args)\n  if kwargs:\n    raise ValueError(\n        \"Only positional arguments are supported by debug_print on Pallas.\"\n    )\n  primitives.check_debug_print_format(fmt, *args)\n  if not any(aval.shape for aval in ctx.avals_in):\n    scope = mgpu.ThreadSubset.WARPGROUP\n    if ctx.module_ctx.primitive_semantics == gpu_core.PrimitiveSemantics.Warp:\n      scope = mgpu.ThreadSubset.WARP\n    mgpu.debug_print(\n        fmt,\n        *(\n            _ensure_ir_value(arg, aval.dtype)\n            for arg, aval in zip(args, ctx.avals_in)\n        ),\n        scope=scope\n    )\n  elif len(ctx.avals_in) == 1:\n    if ctx.module_ctx.primitive_semantics == gpu_core.PrimitiveSemantics.Warp:\n      raise NotImplementedError(\"Can only print scalars in warp-level code.\")","sourceCodeStart":3505,"sourceCodeEnd":3541,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/mosaic_gpu/lowering.py#L3505-L3541","documentation":"Pallas GPU debug_print lowering only handles positional arguments; passing keyword arguments (fmt kwargs for values) raises ValueError before codegen.","triggerScenarios":"jax.debug.print(\"v={v}\", v=value) inside a Pallas kernel — the kwarg form — triggers the error even though it's idiomatic in plain JAX.","commonSituations":"Using the named-placeholder style of debug_print (which formats by keyword) inside kernels; it works under jit but not under Pallas.","solutions":["Pass values positionally: jax.debug.print(\"{}\", value)","Use {}-style positional placeholders matching the argument order","Or move the print outside the kernel"],"exampleFix":"// before\njax.debug.print(\"x={x}\", x=x)\n// after\njax.debug.print(\"{}\", x)","handlingStrategy":"validation","validationCode":"# only positional: jax.debug.print('{} {}', a, b)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use positional placeholders in Pallas debug prints","Lint for debug_print kwargs in kernel modules"],"tags":["jax","pallas","debug-print","kwargs"],"backgroundTag":"unsupported-argument-form","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}