{"record":{"id":"a0b1193d42db3aa4","repo":"jax-ml/jax","slug":"f16-bf16-not-supported-for-async-atomics","errorCode":null,"errorMessage":"f16/bf16 not supported for async atomics","messagePattern":"f16/bf16 not supported for async atomics","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"jax/experimental/mosaic/gpu/fragmented_array.py","lineNumber":3904,"sourceCode":"      space = \".shared::cta\" if is_smem else \"\"\n      ptr_constraint = \"r\" if is_smem else \"l\"\n    element_type = self.mlir_dtype\n    element_bitwidth = utils.bitwidth(element_type)\n    noftz = \"\"\n    if isinstance(element_type, ir.F32Type):\n      if cluster_barrier_ptr is not None:\n        raise NotImplementedError(\"f32 not supported for async atomics\")\n      if atomic != \"add\":\n        raise NotImplementedError(f\"f32 only supports add atomics, got {atomic}\")\n      ptx_type = \"f32\"\n    elif isinstance(element_type, ir.IntegerType) and element_bitwidth == 32:\n      if atomic in (\"and\", \"or\", \"xor\"):\n        ptx_type = \"b32\"\n      else:\n        ptx_type = \"s32\" if self.is_signed else \"u32\"\n    elif isinstance(element_type, (ir.F16Type, ir.BF16Type)):\n      if cluster_barrier_ptr is not None:\n        raise NotImplementedError(\"f16/bf16 not supported for async atomics\")\n      if atomic not in (\"add\", \"min\", \"max\"):\n        raise NotImplementedError(\n            f\"f16/bf16 only supports add, min, max atomics, got {atomic}\"\n        )\n      if (is_smem or multimem) and atomic != \"add\":\n        raise NotImplementedError(\n            f\"f16/bf16 SMEM/multimem atomics only support add, got {atomic}\"\n        )\n      ptx_type = f\"{element_type}x2\"\n      noftz = \"\" if multimem else \".noftz\"\n    else:\n      raise NotImplementedError(\n          f\"Unsupported element type for atomic stores: {element_type}\"\n      )\n    [vec_len] = vreg.type.shape\n    if element_bitwidth == 16:\n      if vec_len % 2 != 0:\n        raise NotImplementedError(","sourceCodeStart":3886,"sourceCodeEnd":3922,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/experimental/mosaic/gpu/fragmented_array.py#L3886-L3922","documentation":"f16/bf16 atomics in PTX are synchronous red/atom instructions; there is no async (::complete_tx::bytes) f16/bf16 atomic form to pair with a cluster barrier, so passing cluster_barrier_ptr with an f16/bf16 atomic store is rejected.","triggerScenarios":"Calling store_tiled_async on an F16Type/BF16Type array with atomic in ('add','min','max') and a non-None cluster_barrier_ptr.","commonSituations":"Low-precision accumulation pipelines (common on Hopper tensor-core kernels) where the async barrier plumbing from TMA stores is reused for the atomic accumulation store.","solutions":["Omit cluster_barrier_ptr for the f16/bf16 atomic store","If asynchrony is required, accumulate in a wider type (i32) and convert","Keep the barrier for the non-atomic stores and issue the atomic store separately without it"],"exampleFix":"# before\nfa16.store_tiled_async(ref, atomic='add', cluster_barrier_ptr=bar)\n# after\nfa16.store_tiled_async(ref, atomic='add')","handlingStrategy":"validation","validationCode":"from jax._src.lib import ir\nif isinstance(fa.mlir_dtype, (ir.F16Type, ir.BF16Type)) and cluster_barrier_ptr is not None:\n    cluster_barrier_ptr = None\nfa.store_tiled_async(ref, atomic=atomic, cluster_barrier_ptr=cluster_barrier_ptr)","typeGuard":"from jax._src.lib import ir\n\ndef half_needs_sync(fa, barrier) -> bool:\n    return isinstance(fa.mlir_dtype, (ir.F16Type, ir.BF16Type)) and barrier is not None","tryCatchPattern":"try:\n    fa.store_tiled_async(ref, atomic=atomic, cluster_barrier_ptr=bar)\nexcept NotImplementedError:\n    fa.store_tiled_async(ref, atomic=atomic)","preventionTips":["Issue half-precision atomic stores without async barriers","Group barrier-tracked stores separately from atomic stores"],"tags":["jax","mosaic","gpu","atomics","f16","bf16","cluster-barrier","not-implemented"],"backgroundTag":"unsupported-atomic-dtype","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}