Memory Registration Methods
Methods on Communicator for registering buffers and windows for
zero-copy and RMA operations. The returned handle classes are documented
under Memory Management.
register_buffer
- Communicator.register_buffer(buffer: Buffer | SupportsDLPack | SupportsCAI) RegisteredBufferHandle
Registers a buffer with this communicator for zero-copy communication.
Registered buffers can enable performance optimizations in NCCL operations. Buffer size is automatically derived from buffer count and dtype. The returned
RegisteredBufferHandleis tracked by the communicator and may be released explicitly via itsclose()method, or automatically when the communicator is destroyed or aborted.- Parameters:
buffer – Buffer to register (array, Buffer, or buffer-like object).
- Returns:
RegisteredBufferHandlefor the registered buffer.- Raises:
NcclInvalid – If the buffer is on the wrong device or the communicator is not initialized.
See also
register_window
- Communicator.register_window(buffer: Buffer | SupportsDLPack | SupportsCAI, flags: WindowFlag | None = None) RegisteredWindowHandle | None
Collectively registers a local buffer into an NCCL window.
This is a collective call: every rank in the communicator must participate, and buffer size must be equal among ranks by default. Buffer size is automatically derived from buffer count and dtype. If called within a group, the handle value may not be filled until
ncclGroupEndcompletes. For non-blocking communicators, the handle may remain0untilget_async_error()reports success.The returned
RegisteredWindowHandleis tracked by the communicator and may be released explicitly via itsclose()method, or automatically when the communicator is destroyed or aborted.- Parameters:
buffer – Local buffer to register as a window.
flags – Window registration flags. Defaults to
None(DEFAULT).
- Returns:
RegisteredWindowHandlefor the registered window, orNoneif NCCL returns a NULL handle (e.g. windows are unsupported on this platform).- Raises:
NcclInvalid – If the buffer is on the wrong device or the communicator is not initialized.
See also
WindowFlag
- class nccl.core.WindowFlag(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
IntFlagWindow registration behavior flags for
Communicator.register_window().- DEFAULT = 0
Default window registration.
- COLL_SYMMETRIC = 1
Collective symmetric window registration.
- STRICT_ORDERING = 2
Strict ordering for window operations.