{"record":{"id":"af6011abb2d72071","repo":"jax-ml/jax","slug":"only-the-tma-implementation-supports-collective-co","errorCode":null,"errorMessage":"Only the TMA implementation supports collective copies","messagePattern":"Only the TMA implementation supports collective copies","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/mosaic_gpu/primitives.py","lineNumber":1003,"sourceCode":"      raise ValueError(\n          f\"Expected exactly one collective axis, got {collective_axes=}\"\n      )\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","sourceCodeStart":985,"sourceCodeEnd":1021,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/mosaic_gpu/primitives.py#L985-L1021","documentation":"On pre-Hopper GPUs the cp.async fallback is used, and cp.async has no multicast/collective support — only TMA (Hopper+) implements collective copies. Passing collective_axes on such hardware raises ValueError.","triggerScenarios":"Calling copy_gmem_to_smem(..., collective_axes=...) on a GPU with compute capability < 9.","commonSituations":"Multicast kernel developed for H100 run on A100; CI runners with older GPUs; forgetting hardware gating in a shared kernel file.","solutions":["Gate collective_axes on get_arch().major >= 9 and fall back to per-device copies","Issue separate non-collective copies per device on older hardware","Run on Hopper+ hardware for multicast paths"],"exampleFix":"# before\ncopy_gmem_to_smem(src, smem, collective_axes=('data',))\n# after\nif mgpu.utils.get_arch().major >= 9:\n  copy_gmem_to_smem(src, smem, collective_axes=('data',))\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    collective_axes = None  # cp.async can't multicast","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate collective_axes on SM90+ hardware","Provide a per-device copy fallback path for older GPUs"],"tags":["jax","pallas","mosaic-gpu","gpu-architecture","collective-axes","cp-async"],"backgroundTag":"unsupported-hardware-feature","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}