ProcessGrid#
-
class cuquantum.
tensornet. experimental. distributed. ProcessGrid(
)[source]#
An N-dimensional regular process grid with complete replica layers.
Ranks fill the grid in
layoutorder (column- or row-major). When the communicator size exceeds the grid size, it must be an integer multiple of it, and the surplus ranks form complete replica layers: rankroccupies the same coordinates as rankr % size, in replica layerr // size. A mode whose grid extent is one is not partitioned.- Parameters:
shape – Per-mode extents of the process grid.
layout –
ProcessGrid.Layout.COL_MAJORorROW_MAJORrank ordering; optional when at most one mode has extent greater than one.process_array – Custom process arrangements are not supported; must be
None.
Warning
This API is experimental and subject to future changes.
Methods
- __init__( )[source]#
Create a new ProcessGrid object.
- Parameters:
shape – Shape of the process grid.
layout – Layout of the process grid (column-major or row-major). This is optional for 1D grid or when a custom grid is provided.
process_array – optional ndarray specifying custom arrangement of processes.
- rank_to_coords(rank: int) tuple[int, ...][source]#
Return a rank’s coordinates within its active-grid replica.
Attributes
- layout#
Layout of process grid if row-major or column-major, otherwise None.
- process_array#
- replication_factor#
Number of complete process-grid replica layers.
- shape#
Shape of process grid.
- size#
Number of coordinates in one active process grid.