flashmask_get_unique_id

paddle.nn.functional. flashmask_get_unique_id ( ) → Tensor [source]

FlashMask distributed overlap: get the unique ID to initialize NVSHMEM.

Normally, this function only needs to be called once. After initializing NVSHMEM, there is no need to pass the unique_id tensor again. Please refer to the doc of flashmask_attention and check the usage of unique_id for more detailed usage.

Returns

Tensor. CPU Tensor with exactly 128 uint8s (128B). If flashmask module is not compiled with WITH_DISTRIBUTED_OVERLAP flag, this function returns a zero tensor.