Skip to main content

Mojo function

is_p2p_enabled

is_p2p_enabled() -> Bool

Checks whether P2P access is available between GPUs.

Intended as a read-only status check for use in kernels and ops. Callers should ensure enable_p2p() is called during initialization (e.g., during model setup) before relying on this function.

The underlying global is initialized lazily, so if enable_p2p() has not yet been called, this function will trigger initialization as a fallback. However, explicit enable_p2p() calls at startup are preferred to avoid side effects during kernel execution.

Returns:

Bool: True if P2P access is available between all GPU pairs, False otherwise.

Was this page helpful?