BlockCyclic#
-
class cuquantum.
tensornet. experimental. distributed. BlockCyclic( - process_grid: ProcessGrid,
- block_sizes: Sequence[int | None],
- *,
- first_process: Sequence[int] | None = None,
N-D block-cyclic distribution with per-mode slab support.
Each tensor mode is partitioned across the corresponding process-grid dimension. An integer block size assigns consecutive blocks round-robin across grid coordinates (the final block may be shorter), while
Noneassigns one near-even contiguous slab per coordinate. A grid extent of one leaves that mode undistributed.- Parameters:
process_grid – The
ProcessGridof this subpackage (the nvmath parent class is not accepted).block_sizes – Per-mode entries, one per process-grid dimension: a positive integer for block-cyclic partitioning, or
Nonefor slab partitioning.first_process – Optional grid coordinates of the process owning the first block of each mode; defaults to the grid origin.
Warning
This API is experimental and subject to future changes.
Methods
- __init__(
- process_grid: ProcessGrid,
- block_sizes: Sequence[int | None],
- *,
- first_process: Sequence[int] | None = None,
- copy() Distribution#
This is a common implementation for those distributions that only require a shallow copy.
- shape( ) tuple[int, ...][source]#
Return the local shard shape for
rankandglobal_shape.When
global_shapeis omitted, use the bound global shape.
- to(cls, /, *, ndim=None, copy=False)[source]#
Convert to a compatible nvmath distribution type.
Block-cyclic conversions return this distribution (or a copy). Conversion to
Slabrequires exactly one unshifted slab-distributed mode and no replica layers. Other conversions are not supported.
Attributes
- block_sizes#
Per-mode block size;
Nonedenotes contiguous slab partitioning.
- first_process#
Index in the process grid of the process who owns the first block of the distributed tensor.
- ndim#
- process_grid#
The process grid of this BlockCyclic distribution