{"record":{"id":"040b78e8750ecf76","repo":"jax-ml/jax","slug":"only-the-tma-implementation-supports-leader-tracke","errorCode":null,"errorMessage":"Only the TMA implementation supports leader_tracked copies","messagePattern":"Only the TMA implementation supports leader_tracked copies","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/mosaic_gpu/primitives.py","lineNumber":1005,"sourceCode":"      )\n    if math.prod(ctx.launch_ctx.cluster_size) != 2:\n      raise NotImplementedError(\n          \"Partitioned loads only supported for clusters of size 2. Got\"\n          f\" cluster size {ctx.launch_ctx.cluster_size}.\"\n      )\n\n  # TMA is only available on Hopper and newer. On older architectures we fall\n  # back to the cp.async implementation.\n  if is_cp_async := mgpu.utils.get_arch().major < 9:\n    if barrier is not None:\n      raise ValueError(\n          \"copy_gmem_to_smem with a barrier is only supported Hopper and newer\"\n          \" GPUs, which use the TMA implementation\"\n      )\n    if collective_axes is not None:\n      raise ValueError(\"Only the TMA implementation supports collective copies\")\n    if leader_tracked is not None:\n      raise ValueError(\n          \"Only the TMA implementation supports leader_tracked copies\"\n      )\n    # cp.async does not predicate out-of-bounds accesses, so the caller has to\n    # guarantee that the copy stays in bounds.\n    if oob_mode != OOBFillMode.PROMISE_IN_BOUNDS:\n      raise ValueError(\n          \"The cp.async implementation only supports \"\n          \"oob_mode=OOBFillMode.PROMISE_IN_BOUNDS\"\n      )\n    if has_user_predicate:\n      raise NotImplementedError(\n          \"The cp.async implementation does not support user-defined predicates\"\n      )\n  else:\n    if oob_mode is None:\n      oob_mode = OOBFillMode.ZEROS\n\n    if barrier is None:","sourceCodeStart":987,"sourceCodeEnd":1023,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/mosaic_gpu/primitives.py#L987-L1023","documentation":"On pre-Hopper GPUs (cp.async path), leader_tracked copies are unsupported — the leader/completion-tracking mechanism relies on TMA mbarrier features. Passing leader_tracked on such hardware raises ValueError.","triggerScenarios":"Calling copy_gmem_to_smem(..., leader_tracked=...) on a GPU with compute capability < 9.","commonSituations":"Porting leader-based synchronization schemes to older GPUs; running the same kernel across heterogeneous clusters.","solutions":["Gate leader_tracked on get_arch().major >= 9","Use ordinary barriers or warp synchronization on pre-Hopper hardware","Restrict leader-tracked kernels to Hopper+ devices"],"exampleFix":"# before\ncopy_gmem_to_smem(src, smem, leader_tracked=lt)\n# after\nif mgpu.utils.get_arch().major >= 9:\n  copy_gmem_to_smem(src, smem, leader_tracked=lt)\nelse:\n  copy_gmem_to_smem(src, smem)","handlingStrategy":"fallback","validationCode":"from jax._src.pallas.mosaic_gpu import mgpu\nif mgpu.utils.get_arch().major < 9:\n    leader_tracked = None  # unsupported on cp.async","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate leader_tracked on Hopper+; use plain barriers elsewhere"],"tags":["jax","pallas","mosaic-gpu","gpu-architecture","leader-tracked","cp-async"],"backgroundTag":"unsupported-hardware-feature","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}