jax.experimental.pallas.mosaic_gpu.get_barrier_semaphore#
- jax.experimental.pallas.mosaic_gpu.get_barrier_semaphore()[source]#
Returns a 1D array of barrier semaphores.
Barrier semaphores are allocated by XLA in clique-bound memory and are guaranteed to be zeroed before the module starts executing, which lets kernels skip the cross-device synchronization that is otherwise required to safely use a GMEM semaphore (see skip_device_barrier in CompilerParams).
Using barrier semaphores requires collective_id to be set in CompilerParams. Each collective_id has its own array of MAX_BARRIER_SEMAPHORES (1024) semaphores, shared by all kernels using the same collective_id (and the same device clique), and at most MAX_COLLECTIVE_IDS (32) distinct collective IDs are supported.