jax.experimental.pallas.mosaic_gpu.async_prefetch#
- jax.experimental.pallas.mosaic_gpu.async_prefetch(ref, *, collective_axes=None, leader_tracked=None, predicate=None)[source]#
Asynchronously prefetches a GMEM reference to the L2 cache.
If collective_axes is specified, each CUDA block only prefetches a part of the
ref, with other parts covered by blocks that share the same index along the collective axis.Specifying leader_tracked and collective_axes doesn’t change the semantics of the prefetch, but if it’s followed by a GMEM to SMEM copy, then it allows us to reuse the same TMA descriptor.
- Parameters:
ref (_Ref) – The source Ref. Must be in GMEM.
collective_axes (str | tuple[str, ...] | None) – The collective axes to use for the prefetch.
leader_tracked (CopyPartition | None) – The partitioning to use for the prefetch.
predicate (bool | jax.Array | None) – A boolean indicating whether the prefetch should be performed. If
None, the prefetch is always performed.
- Return type:
None