ttnn.MatmulMultiCoreReuseMultiCast1DProgramConfig
- class ttnn.MatmulMultiCoreReuseMultiCast1DProgramConfig
-
Bases:
objectConfiguration class for 1D multicast matmul operations with advanced features.
This program config is for use with width and height sharded tensors, or very narrow interleaved tensors.
When
gather_in0is False and the matmul op is invoked with asub_device_id,compute_with_storage_grid_sizeis anchored at the sub-device’s worker bounding-box start instead of(0, 0). The 1D multicast targets a single bounding-box rectangle and the per-core index math assumes a contiguous row-major rectangle, so the sub-device’s worker cores must themselves form a single rectangle. Non-rectangular sub-device worker grids are rejected at validate time. Whengather_in0is True,compute_with_storage_grid_sizeis ignored and the gather path can run on any sub-device worker layout.- property allowed_worker_cores
-
Optional set of worker cores to restrict the matmul computation to.
When set, overrides
compute_with_storage_grid_sizefor determining the active compute grid. Accepts aCoreRangeSetdescribing the exact cores to use.
- property compute_with_storage_grid_size
-
Grid size for compute cores with storage capability.
Defines the 2D grid of cores that will be used for computation. In 1D multicast, this grid is used to determine the communication pattern for broadcasting data along one dimension while distributing computation.
When the matmul op is invoked with a
sub_device_id(andgather_in0is False), this rectangle is anchored at the sub-device’s worker bounding-box start (instead of(0, 0)) and must fit inside that bounding box. Ignored whengather_in0is True.DEPRECATED: Use
allowed_worker_coresinstead for finer control over the compute grid.
- from_json
- property fuse_batch
-
Whether to fuse batch dimensions into matrix dimensions.
When true, batch dimensions are incorporated into the matrix computation, allowing for more efficient processing of batched operations in the 1D multicast implementation.
Note: the batch dimensions need to all be 1 for the second input tensor when fuse_batch is true.
- property fused_activation
-
Optional fused activation function to apply during computation.
If specified, the activation function is applied directly during the matmul operation, eliminating the need for a separate activation pass and improving overall performance in 1D multicast scenarios.
- property gather_in0
-
Defaults to false. Used by ops that call matmul internally. Should not be specified or left as the default value for all other uses.
- property hop_cores
-
Defaults to empty set. Used by ops that call matmul internally. Should not be specified or left as the default value for all other uses.
- property in0_block_w
-
Block width for both input tensors along the K dimension (shared inner dimension).
Determines the data granularity by specifying how many tiles wide each block is along the inner dimension for both input_tensor_a and input_tensor_b. This parameter impacts 1D multicast performance as it affects the size of data chunks that are broadcast across cores and memory access patterns for both tensors.
- property mcast_in0
-
Whether to multicast the first input tensor (input_tensor_a).
When true, input_tensor_a is broadcast across cores using the 1D multicast pattern, which can significantly reduce memory bandwidth requirements for certain matrix shapes and improve performance.
- property num_global_cb_receivers
-
Defaults to 1. Used by ops that call matmul internally. Should not be specified or left as the default value for all other uses.
- property out_block_h
-
Height of output blocks in tiles.
Defines the output block size along the M dimension. If not specified, defaults to per_core_M. This parameter is important for optimizing the 1D multicast pattern and memory access efficiency.
- property out_block_w
-
Width of output blocks in tiles.
Defines the output block size along the N dimension. If not specified, defaults to per_core_N. This affects the efficiency of data distribution in the 1D multicast implementation.
- property out_subblock_h
-
Height of output subblocks in tiles.
Controls computation granularity within output blocks along the M dimension. In 1D multicast, this affects how computation is scheduled and memory usage patterns across the participating cores.
- property out_subblock_w
-
Width of output subblocks in tiles.
Controls computation granularity within output blocks along the N dimension. This parameter affects the efficiency of the 1D multicast communication pattern and compute scheduling.
- property per_core_M
-
Number of output tiles each core processes along the M dimension.
Determines the workload distribution along the M dimension in the 1D multicast pattern. This affects both load balancing and communication efficiency.
- property per_core_N
-
Number of output tiles each core processes along the N dimension.
Determines the workload distribution along the N dimension in the 1D multicast pattern. This parameter is crucial for achieving optimal performance in 1D multicast scenarios.
- property stream_in1
-
Select ring-rotated FIFO delivery for gather_in0 with a DRAM-sender GCB. The weight MUST be queued with the
(weight, block_count, rotation)request form. GCB-backed mcast_in0 consumes natural FIFO order and requires this flag to remain false. Defaults to false.
- to_json
- property untilize_out
-
Whether to untilize the output tensor.
When true, the output is converted from tiled layout to row-major layout during the operation. This can be useful when the subsequent operation expects row-major data and can eliminate a separate untilization pass. Defaults to false.