Metadata#

class cutlass.operators.metadata.base.OperatorMetadata(
operator_name: str,
operator_class: type[Operator],
supported_targets: list[TargetSm],
operands: OperandsMetadata,
design: DesignMetadata | None = None,
epilogue: EpilogueMetadataBase | None = None,
)#

Bases: object

OperatorMetadata exposes a uniform schema to inspect the properties of an Operator.

It allows users to programmatically and uniformly inspect properties of an Operator without manually inspecting its source code, and without learning a different schema of properties for each Operator.

It describes fixed properties of the Operator in three categories:

  • OperandsMetadata: properties of the operands passed to the Operator and the constraints it places on them. It describes the conditions for an Operator to functionally support (compute the correct result of) an operation.

  • DesignMetadata: architectural, performance, or design characteristics of the kernel. Useful for inspecting and comparing otherwise functionally equivalent Operators.

  • EpilogueMetadata: any custom epilogue computation that was fused into the Operator.

These properties are declared by the Operator itself when it is instantiated, and are fixed after that.

They may be determined by design, or the Operator’s implementation may be parametrized to generate instances supporting different values of a metadata field.

operator_name: str#

A unique human-readable Operator name.

Important

There are no backward-compatibility guarantees for these names, even for patch releases. Users are strongly advised to not use these names for filtering, and use metadata fields instead.

operator_class: type[Operator]#

The derived class of cutlass.operators.Operator that implements interfaces to expose a DSL kernel

supported_targets: list[TargetSm]#

Supported targets that this Operator can be compiled for

Only the earliest portable target in each architecture family is reported, as support for future targets is implied.

Examples

  • supported_targets=[TargetSm("100f"), TargetSm("120f")] implies support for ["100a", "103a", ... , "120a", "121a", ...] for all members of 100f & 120f arch families

  • supported_targets=[TargetSm("80")] implies support for ["80","89","90","90a","100", ...]

To check if this Operator is supported on a desired target_sm, use target_sm.supports_operators_from(supported_targets).

operands: OperandsMetadata#

per-operand constraints and any operand-independent choices (e.g. the accumulator type for a GEMM).

Type:

Describes the per-operand requirements of the Operator

design: DesignMetadata | None = None#

Describes characteristics of the design & implementation of the Operator

epilogue: EpilogueMetadataBase | None = None#

Describes the custom epilogue of the Operator.

property provider: Provider#

The Provider that this Operator’s class is registered with.

supports(
args: RuntimeArguments | None,
*,
target_sm: TargetSm | str | None = None,
) → Status#

Check if the provided args/target_sm satisfy the properties described by this OperatorMetadata.

Parameters:
  • args (RuntimeArguments | None) – Check if Operator supports these RuntimeArguments. Can be explicitly set to None, in order to check only target_sm.

  • target_sm (TargetSm | str | None) – Check if Operator can be compiled/ran on given TargetSm architecture, if any.

Returns:

Status indicating whether the args/target_sm are supported, and reason for failure if not.

Return type:

Status

Raises:

ValueError – If both args and target_sm are None.

Operands metadata#

class cutlass.operators.metadata.operands.OperandsMetadata#

Bases: ABC

Describes properties expected of the logical operands passed to an Operator.

It describes the conditions under which an Operator can correctly execute a given RuntimeArguments. It mirrors the fields of a RuntimeArguments subclass implemented by the Operator, and describes requirements placed on each field. For instance, GemmOperandsMetadata mirrors GemmArguments.

RuntimeArguments describes what operation the user wishes to perform, independent of which Operator will perform it.
OperandsMetadata describes conditions under which an Operator can accept and correctly execute RuntimeArguments passed to it.

If an Operator’s OperandsMetadata supports the RuntimeArguments presented by a user, then it produces functionally correct result for those RuntimeArguments.

abstract supports(args: RuntimeArguments) → Status#

Check whether args satisfy the operand requirements described by this metadata.

Parameters:

args (RuntimeArguments) – Runtime arguments to validate.

Returns:

Status indicating whether args satisfy the operand requirements described by this metadata.

Return type:

Status

class cutlass.operators.metadata.operands.GemmOperandsMetadata(
A: OperandConstraints,
B: OperandConstraints,
out: OperandConstraints,
accumulator_type: Numeric,
)#

Bases: OperandsMetadata

Describes conditions under which an Operation functionally supports GemmArguments.

A: OperandConstraints#

Constraints on operand A of the GEMM

B: OperandConstraints#

Constraints on operand B of the GEMM

out: OperandConstraints#

Constraints on operand out of the GEMM

accumulator_type: Numeric#

The required data type of the accumulator tensor

supports(
other: GemmArguments | GemmOperandsMetadata,
) → Status#

Check whether other arguments or metadata are compatible with GEMM operands described by this metadata.

Parameters:

other (GemmArguments | GemmOperandsMetadata) – Either runtime GemmArguments or a peer GemmOperandsMetadata to validate.

Returns:

Status.success() if every operand and the accumulator type match, otherwise Status.fail(...) with the first failing operand’s reason.

Return type:

Status

class cutlass.operators.metadata.operands.GroupedGemmOperandsMetadata(
A: OperandConstraints,
B: OperandConstraints,
out: OperandConstraints,
offsets: OperandConstraints,
accumulator_type: Numeric,
)#

Bases: IndexPtrGroupedGemmOperandsMetadata

Compatibility metadata for the released M-offset grouped GEMM API.

class cutlass.operators.metadata.operands.IndexPtrGroupedGemmOperandsMetadata(
A: OperandConstraints,
B: OperandConstraints,
out: OperandConstraints,
offsets: OperandConstraints,
offsets_along: Literal['m', 'n', 'k'],
accumulator_type: Numeric,
offsets_value_divisibility: int = 1,
accumulate_on_output: bool = False,
)#

Bases: OperandsMetadata

Operand constraints for M/N/K index-pointer grouped GEMM operations.

A: OperandConstraints#

Constraints on dense operand A.

B: OperandConstraints#

Constraints on dense operand B.

out: OperandConstraints#

Constraints on dense operand out.

offsets: OperandConstraints#

Constraints on the grouped-problem boundary tensor.

offsets_along: Literal['m', 'n', 'k']#

Logical GEMM dimension partitioned by offsets.

accumulator_type: Numeric#

Required accumulator data type.

offsets_value_divisibility: int = 1#

Minimum divisibility of every offsets value required by this Operator.

A block-scaled Operator that reuses the data boundaries as its scale-factor boundaries records the scale-factor padding here, so a caller whose promise is weaker than that simply does not match it.

accumulate_on_output: bool = False#

Whether the Operator adds each GEMM result to the existing output.

supports(
other: RuntimeArguments | IndexPtrGroupedGemmOperandsMetadata,
) → Status#

Check index-pointer arguments or peer metadata for compatibility.

class cutlass.operators.metadata.operand_constraints.OperandConstraints#

Bases: ABC

Abstract base class describing the constraints an Operator places on an Operand.

An instance of this class describes the requirements an Operator places on one Operand, such as its data type, stride pattern, divisibility, and pointer alignment.

abstract supports(
operand: Operand | OperandConstraints,
) → Status#

Check whether operand satisfies these constraints.

Parameters:

operand (Operand | OperandConstraints) – The runtime operand or another constraints object to check against self.

Returns:

Status.success() when operand is accepted, otherwise Status.fail(...) with a human-readable reason.

Return type:

Status

class cutlass.operators.metadata.operand_constraints.DenseTensorConstraints(
dtype: Numeric,
stride: tuple[int, ...] | None,
divisibility: int,
ptr_alignment_bytes: int | None = None,
)#

Bases: OperandConstraints

Constraints on a single DenseTensor.

Describes the data type, stride pattern, divisibility, and pointer alignment that an Operator requires a DenseTensor to satisfy.

dtype: Numeric#

The data type of the tensor

stride: tuple[int, ...] | None#

The stride of the tensor. If none, any arbitrary stride is allowed.

divisibility: int#

The divisibility requirement on a tensor’s stride and shape elements

ptr_alignment_bytes: int#

The alignment of the tensor’s data pointer, in bytes By default, it matches the number of bytes in stride/shape alignment.

supports(
operand: DenseTensor | DenseTensorConstraints,
) → Status#

Check whether operand satisfies the constraints described by this object.

Parameters:

operand (Operand | OperandConstraints) – Operand or peer constraints object to validate.

Returns:

Status.success() if accepted, Status.fail(...) otherwise.

Return type:

Status

class cutlass.operators.metadata.operand_constraints.ScaledOperandConstraints(
quantized: DenseTensorConstraints,
scale: DenseTensorConstraints,
mode: ScaleMode | tuple[int, ...],
swizzle: ScaleSwizzleMode,
)#

Bases: OperandConstraints

Constraints on a scaled (quantized + scale-factor) operand.

A scaled operand combines a quantized tensor and a scale tensor with a chosen scale mode + scale swizzle. Constraints on each piece are carried in quantized and scale; supports() checks all four.

quantized: DenseTensorConstraints#

Constraints on the narrow-precision tensor holding the quantized values.

scale: DenseTensorConstraints#

Constraints on the scale-factor tensor.

mode: ScaleMode | tuple[int, ...]#

Descriptor of the elements over which each scale factor operates

swizzle: ScaleSwizzleMode#

Swizzling pattern used within scale factor tensor

supports(
operand: ScaledOperand | ScaledOperandConstraints,
) → Status#

Check whether operand satisfies these scaled-operand constraints.

Design metadata#

class cutlass.operators.metadata.design.DesignMetadata#

Bases: ABC

Describes architectural, performance, or design characteristics of the kernel separate from its functional contribution.

These properties do not directly alter the logical result of the Operator. Instead, they distinguish the design characteristics of otherwise logically-equivalent Operators, and can be used to guide Operator selection and performance characterization.

This could include properties like:

  • inherent design choices like which MMA instruction it uses, or use of other architectural features

  • its performance options, tile scheduling algorithm, etc.

  • its tile shape, cluster shape, number of shared memory stages, etc.

abstract supports(
args: RuntimeArguments,
target_sm: TargetSm | None = None,
) → Status#

Checks whether the provided args satisfy the properties described by this DesignMetadata.

It validates that PerformanceControls within args.performance are supported by the Operator with this DesignMetadata.

DesignMetadata does not directly influence the logical result of the Operator, and thus does not affect what logical operands can be supported in RuntimeArguments.

Parameters:
  • args (RuntimeArguments) – The arguments to check support for.

  • target_sm (TargetSm | None) – The target SM to check support for. If None, skips arch-specific checks.

Returns:

Status indicating whether the provided args satisfy the properties described by the design in this metadata

Return type:

Status

class cutlass.operators.metadata.design.BLASDesignMetadata(
*,
mma_instruction_type: type[MmaInstruction],
tile_shape: tuple[int, ...],
cluster_shape: tuple[int, ...],
num_smem_stages: int | None = None,
)#

Bases: DesignMetadata

Design metadata for a BLAS (basic-linear algebra subprogram) operation, like GEMM.

It describes fields common to many kernels that perform BLAS-like operations, such as tile/cluster shape, MMA instruction type, etc.

mma_instruction_type: type[MmaInstruction]#

The type of the MMA instruction used by the Operator, if any.

tile_shape: tuple[int, ...]#

Shape of the threadblock-level tile

cluster_shape: tuple[int, ...]#

Shape of the cluster used in terms of threadblocks

num_smem_stages: int | None#

Number of shared memory buffers used to pipeline data loading and computation. When None, the Operator determines this internally.

supports(
args: RuntimeArguments,
target_sm: TargetSm | None = None,
) → Status#

Checks whether the provided args satisfy the properties described by the design in this metadata.

Parameters:
  • args (RuntimeArguments) – The arguments to check support for

  • target_sm (TargetSm | None) – The target SM to check support for. If None, skips arch-specific checks.

Returns:

Status indicating whether the provided args satisfy the properties described by the design in this metadata

Return type:

Status

class cutlass.operators.metadata.design.Sm100DesignMetadata(
use_2cta_mma: bool,
use_tma_store: bool,
tile_scheduler: TileSchedulerMetadata | None = None,
fallback_cluster_shape: tuple[int, ...] | None = None,
pdl: ProgrammaticDependentLaunchMetadata = ProgrammaticDependentLaunchMetadata(early_launch_dependent=False, early_start=None),
*,
mma_instruction_type: type[MmaInstruction],
tile_shape: tuple[int, ...],
cluster_shape: tuple[int, ...],
num_smem_stages: int | None = None,
)#

Bases: BLASDesignMetadata

Design metadata for operators in the SM100 architecture family.

use_2cta_mma: bool#

Whether to use a 2CTA MMA instruction

use_tma_store: bool#

Whether to use TMA to store the results of the operation

tile_scheduler: TileSchedulerMetadata | None#

Describes the tile scheduling strategy used by the Operator

fallback_cluster_shape: tuple[int, ...] | None#

Fallback cluster shape for preferred cluster mode.

When None (default), the Operator uses a single fixed cluster shape (BLASDesignMetadata.cluster_shape). When set:

  • the Operator uses two cluster shapes: cluster_shape as the preferred (larger) shape and fallback_cluster_shape as the smaller fallback for tiles that cannot fill a full preferred cluster.

  • Preferred cluster depth (Z dimension) must be the same as that of fallback cluster.

  • Fallback cluster shape must evenly divide the preferred cluster shape.

max_cluster_size: ClassVar[int] = 16#

Maximum non-portable cluster size allowed by sm100f architecture.

mma_instruction_type: type[MmaInstruction]#

The type of the MMA instruction used by the Operator, if any.

tile_shape: tuple[int, ...]#

Shape of the threadblock-level tile

cluster_shape: tuple[int, ...]#

Shape of the cluster used in terms of threadblocks

num_smem_stages: int | None#

Number of shared memory buffers used to pipeline data loading and computation. When None, the Operator determines this internally.

pdl: ProgrammaticDependentLaunchMetadata#

Programmatic Dependent Launch capabilities for this design.

supports(
args: RuntimeArguments,
target_sm: TargetSm | None = None,
) → Status#

Checks whether the provided args satisfy the properties described by the design in this metadata.

use_fallback_cluster() → bool#

Return True when this design uses a preferred (larger) and fallback (smaller) cluster shape.

classmethod is_valid_fallback_cluster(
cluster_shape: tuple[int, int, int],
fallback_cluster_shape: tuple[int, int, int],
) → Status#

Check if the fallback_cluster_shape is valid for the given cluster_shape.

class cutlass.operators.metadata.design.Sm107DesignMetadata(use_2cta_mma: bool, use_tma_store: bool, tile_scheduler: TileSchedulerMetadata | None = None, fallback_cluster_shape: tuple[int, ...] | None = None, pdl: ProgrammaticDependentLaunchMetadata = ProgrammaticDependentLaunchMetadata(early_launch_dependent=False, early_start=None), enable_breuse: bool = False, data_driven_sync: ~cutlass.operators.metadata.design.data_driven_sync.DataDrivenSyncMetadata = <factory>, *, mma_instruction_type: type[MmaInstruction], tile_shape: tuple[int, ...], cluster_shape: tuple[int, ...], num_smem_stages: int | None = None)#

Bases: Sm100DesignMetadata

Design metadata for operators in the SM107 architecture family.

enable_breuse: bool#

Whether the kernel retains each B tile for a second MMA along M.

max_cluster_size: ClassVar[int] = 30#

Maximum non-portable cluster size allowed by sm107 architecture.

mma_instruction_type: type[MmaInstruction]#

The type of the MMA instruction used by the Operator, if any.

tile_shape: tuple[int, ...]#

Shape of the threadblock-level tile

cluster_shape: tuple[int, ...]#

Shape of the cluster used in terms of threadblocks

num_smem_stages: int | None#

Number of shared memory buffers used to pipeline data loading and computation. When None, the Operator determines this internally.

use_2cta_mma: bool#

Whether to use a 2CTA MMA instruction

use_tma_store: bool#

Whether to use TMA to store the results of the operation

tile_scheduler: TileSchedulerMetadata | None#

Describes the tile scheduling strategy used by the Operator

fallback_cluster_shape: tuple[int, ...] | None#

Fallback cluster shape for preferred cluster mode.

When None (default), the Operator uses a single fixed cluster shape (BLASDesignMetadata.cluster_shape). When set:

  • the Operator uses two cluster shapes: cluster_shape as the preferred (larger) shape and fallback_cluster_shape as the smaller fallback for tiles that cannot fill a full preferred cluster.

  • Preferred cluster depth (Z dimension) must be the same as that of fallback cluster.

  • Fallback cluster shape must evenly divide the preferred cluster shape.

pdl: ProgrammaticDependentLaunchMetadata#

Programmatic Dependent Launch capabilities for this design.

data_driven_sync: DataDrivenSyncMetadata#

Data-driven synchronization metadata about whether Operator is producer/consumer.

Typically paired with PDL.

supports(
args: RuntimeArguments,
target_sm: TargetSm | None = None,
) → Status#

Ensures runtime arguments satisfy the design metadata.

Parameters:
  • args (RuntimeArguments) – The arguments to check support for.

  • target_sm (TargetSm | None) – The target SM to check support for. If None, skips arch-specific checks.

Returns:

Status indicating whether the provided args satisfy the design metadata.

Return type:

Status

class cutlass.operators.metadata.design.TileSchedulerMetadata(
persistence: PersistenceMetadata,
reduction: ReductionMetadata,
rasterization: RasterizationMetadata,
)#

Bases: object

A tile scheduler fully described by three strategy axes.

  • PersistenceMetadata – whether the kernel is persistent and how that persistence is driven.

  • ReductionMetadata – whether (and how) the GEMM’s K reduction is split across tiles.

  • RasterizationMetadata – the order in which tiles are scheduled.

supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

Returns all the supported targets for the tile scheduler.

Considers optional design and operands metadata when determining which targets are supported.

supports(args: RuntimeArguments) → Status#

Checks whether arguments are supported by the tile scheduler metadata.

An unspecified args.performance, and the ... default for tile_scheduler_controls, both express no opinion and are accepted. args.performance=None asks for an operator without performance controls, and tile_scheduler_controls=None asks for one without a tile scheduler; this metadata satisfies neither. Otherwise every requested setting must fall inside the domain this scheduler offers.

Parameters:

args (RuntimeArguments) – The arguments to check support for.

Returns:

Success, or a failure naming the unsupported control.

Return type:

Status

class cutlass.operators.metadata.design.NonPersistentMetadata#

Bases: PersistenceMetadata

A non-persistent tile scheduler that launches one CTA per tile.

classmethod arg_name() → str#

Returns the commonly used name for this persistence strategy for kernel arguments.

classmethod supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

Returns all the supported targets for the non-persistent mode.

class cutlass.operators.metadata.design.StaticPersistentMetadata#

Bases: PersistenceMetadata

A statically persistent scheduler that reuses CTAs across tiles.

classmethod arg_name() → str#

Returns the commonly used name for this persistence strategy for kernel arguments.

classmethod supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

Returns all the supported targets for the static persistent mode.

class cutlass.operators.metadata.design.CLCDynamicPersistentMetadata#

Bases: PersistenceMetadata

A CLC-driven dynamically persistent tile scheduler.

classmethod arg_name() → str#

Returns the commonly used name for this persistence strategy for kernel arguments.

classmethod supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

Returns all the supported targets for the CLC dynamic persistent mode.

class cutlass.operators.metadata.design.NoReductionMetadata#

Bases: ReductionMetadata

A reduction strategy that does not split the K dimension.

classmethod arg_name() → str#

Returns the commonly used name for this reduction strategy for kernel arguments.

classmethod supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

Returns all the supported targets for the no-reduction strategy.

class cutlass.operators.metadata.design.SplitKReductionMetadata(
split_count: tuple[int, ...] | AnyValue[int] | None = None,
)#

Bases: ReductionMetadata

A reduction strategy that splits the K dimension into multiple tiles.

classmethod arg_name() → str#

Returns the commonly used name for this reduction strategy for kernel arguments.

classmethod supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

Returns all the supported targets for the split-K reduction strategy.

class cutlass.operators.metadata.design.ClusterSplitKReductionMetadata(split_count: tuple[int] | None = None)#

Bases: ReductionMetadata

A reduction strategy that splits K with cluster awareness.

Contains a compile-time setting for split_count.

classmethod arg_name() → str#

Returns the commonly used name for this reduction strategy for kernel arguments.

classmethod supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

Returns all the supported targets for the cluster split-K reduction strategy.

class cutlass.operators.metadata.design.NoRasterizationMetadata#

Bases: RasterizationMetadata

A rasterization strategy that does not rasterize the tiles.

classmethod arg_name() → str#

Returns the commonly used name for this rasterization strategy for kernel arguments.

classmethod supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

Returns all the supported targets for the no-rasterization strategy.

class cutlass.operators.metadata.design.TileSwizzleRasterizationMetadata(
raster_order: tuple[RasterOrder, ...] | None = None,
swizzle_size: tuple[int, ...] | AnyValue[int] | None = None,
)#

Bases: RasterizationMetadata

A rasterization strategy using a raster-order + swizzle pattern.

classmethod arg_name() → str#

Returns the commonly used name for this rasterization strategy for kernel arguments.

classmethod supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

Returns all the supported targets for the raster-order + swizzle strategy.

class cutlass.operators.metadata.design.EarlyStartMetadata(
independent_operands: Iterable[str] = (),
)#

Bases: object

Metadata for compiling a kernel with PDL early-start support.

independent_operands: Iterable[str]#

Operands that may load without waiting on the PDL dependency.

An empty iterable means all operands are dependent and must wait. The names are validated against the kernel’s declared operands by OperatorMetadata.

class cutlass.operators.metadata.design.ProgrammaticDependentLaunchMetadata(
early_launch_dependent: bool = False,
early_start: EarlyStartMetadata | None = None,
)#

Bases: object

Describe a kernel’s Programmatic Dependent Launch (PDL) capabilities.

PDL allows a dependent kernel to begin executing before its producer has completed. A launch can use same-stream serialization, a programmatic CUDA event, or both.

  • early_launch_dependent indicates whether the kernel can signal dependent kernels.

  • early_start indicates whether the kernel can start as a consumer before its producer completes.

early_launch_dependent: bool#

Whether this kernel supports signaling dependent kernels for early launch.

early_start: EarlyStartMetadata | None#

Whether the kernel can start before its producer completes.

Optional independent operands may load without waiting for the producer.

supports(
runtime_pdl_controls: ProgrammaticDependentLaunchControl | None,
) → Status#

Check whether PDL metadata supports the requested runtime controls.

is_enabled() → bool#

Whether PDL is enabled.

class cutlass.operators.metadata.design.DataDrivenSyncMetadata(
*,
producer: DataDrivenSyncProducerMetadata | None = None,
consumer: DataDrivenSyncConsumerMetadata | None = None,
)#

Bases: object

Describe an operator’s data-driven synchronization capabilities.

Data-driven synchronization allows a consumer operator to read producer-written operands before the producer operator has completed and fully computed its output. This metadata records whether an operator can produce such data, consume it, or both.

The primary synchronization mechanism is the use of a sentinel pattern to communicate whether the chunk of data is ready to be read. The producer prepares the output tensor with the sentinel pattern before writing the computed results. The consumer polls the output tensor chunks and once a chunk has no sentinel pattern, then it is considered valid and can be read.

The sentinel pattern is defined by the TMA report_valid load and is typically -0.0 encoded for that data type. Scale factors use NaN 0xff as the sentinel pattern. Software emulation of data-driven synchronization is not supported at this time.

Typically used in conjunction with PDL to overlap the producer and consumer launches for concurrent reads/writes to the synchronized tensor.

For the full up-to-date details on validity reporting (report_valid):

https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#report-mechanisms-for-asynchronous-copy-operations

producer: DataDrivenSyncProducerMetadata | None#

Capabilities for producing data streamed to data-driven sync consumers.

consumer: DataDrivenSyncConsumerMetadata | None#

Capabilities for consuming operands streamed by data-driven sync producers.

supports(
perf_controls: DataDrivenSyncControls,
target_sm: TargetSm | None = None,
) → Status#

Check whether the runtime controls are supported on target_sm.

Unfulfilled requested capabilities are reported in one status.

Parameters:
  • perf_controls (DataDrivenSyncControls) – Runtime producer/consumer role requests to validate against this metadata.

  • target_sm (TargetSm | None) – Target compute capability to validate against, if known.

Returns:

Status.success() if every requested role is supported, otherwise Status.fail(...) describing each unfulfilled request.

Return type:

Status

is_enabled() → bool#

Return whether this operator supports either data-driven synchronization role.

class cutlass.operators.metadata.design.DataDrivenSyncProducerMetadata(
*,
minimum_atomic_write_bytes: int = 0,
output_sentinel_prefill: bool = True,
)#

Bases: object

Producer-side data-driven synchronization metadata.

A data-driven sync producer writes output that consumers may load and compute upon before the producer operator completes, using the sentinel pattern to denote data readiness.

Completed output must never contain a legitimate sentinel pattern, because consumers interpret that pattern as unwritten data. As such, operator is responsible with canonicalizing computed output before writes.

The sentinel pattern is defined as -0.0 for data tensors and 0xff for scale factors on sm107a. For other architectures, please refer to PTX documentation.

SM107A_MINIMUM_ATOMIC_WRITE_BYTES: ClassVar[int] = 16#

Minimum atomic output write size, in bytes, that sm107a TMA report_valid consumers require.

REPORT_VALID_ATOMIC_WRITE_TARGETS: ClassVar[tuple[TargetSm, ...]] = (TargetSm(cc=107, portability=<ArchPortability.ArchConditional: 3>), TargetSm(cc=107, portability=<ArchPortability.FamilyPortable: 2>))#

Targets whose TMA report_valid consumers require SM107A_MINIMUM_ATOMIC_WRITE_BYTES writes.

minimum_atomic_write_bytes: int#

Minimum size, in bytes, of an atomic output write. Auxiliary scale factors are excluded from this requirement.

output_sentinel_prefill: bool#

Whether the operator prefills the output with the TMA report_valid sentinel pattern before consumer launch.

When False, the Operator’s caller must initialize the output with the sentinel pattern and request that behavior within DataDrivenSyncControls.

supports(
producer_controls: DataDrivenSyncProducer,
target_sm: TargetSm | None = None,
) → Status#

Check whether the runtime producer controls are supported on target_sm.

Parameters:
  • producer_controls (DataDrivenSyncProducer) – Runtime producer controls to validate against this metadata.

  • target_sm (TargetSm | None) – Target compute capability to validate against, if known.

Returns:

Status.success() if the producer controls are supported, otherwise Status.fail(...) describing the reason.

Return type:

Status

class cutlass.operators.metadata.design.DataDrivenSyncConsumerMetadata(
*,
consumed_operands: tuple[str, ...] = (),
)#

Bases: object

Consumer-side data-driven synchronization metadata.

A data-driven sync consumer reads producer-written operands with TMA report_valid loads. A retry warp must reissue TMA report_valid loads until the data is valid.

consumed_operands: tuple[str, ...]#

Operands this operator loads with report_valid enabled.

Requested operands must not produce the TMA report_valid sentinel pattern as a valid output value.

supports(
perf_controls: DataDrivenSyncConsumer,
target_sm: TargetSm | None = None,
) → Status#

Check whether the runtime consumer controls request supported operands.

Parameters:
  • perf_controls (DataDrivenSyncConsumer) – Runtime consumer controls to validate against this metadata.

  • target_sm (TargetSm | None) – Unused; kept for signature symmetry with the producer and aggregate supports methods.

Returns:

Status.success() if the requested consumed operand set matches exactly, otherwise Status.fail(...) describing the mismatch.

Return type:

Status

Epilogue metadata#

class cutlass.operators.metadata.epilogue.EpilogueMetadataBase#

Bases: ABC

Common metadata interface for custom and fixed epilogues.

abstract supports(args: RuntimeArguments) → Status#

Check whether runtime arguments satisfy this epilogue metadata.

class cutlass.operators.metadata.epilogue.EpilogueMetadata(epilogue_args: EpilogueArguments)#

Bases: EpilogueMetadataBase

Describes properties related to custom EpilogueArguments that an Operator may support.

classmethod from_args(
args: EpilogueArguments,
) → EpilogueMetadata#

Creates an EpilogueMetadata from an EpilogueArguments.

property parameters: list[cute.Tensor | Numeric]#

Returns the list of input and output parameters of the epilogue.

property parameter_names: list[str]#

Returns the list of names of the input and output parameters of the epilogue.

supports(args: RuntimeArguments) → Status#

Checks if the provided EpilogueArguments are supported by the Operator.

class cutlass.operators.metadata.epilogue.PerGroupScaleEpilogueMetadata(
global_scale_a: DenseTensorConstraints | None = None,
global_scale_b: DenseTensorConstraints | None = None,
)#

Bases: EpilogueMetadataBase

Constraints for a PerGroupScaleEpilogueArguments fixed epilogue.

global_scale_a: DenseTensorConstraints | None = None#

Constraints for A’s per-group scale, or None when the scale is omitted.

global_scale_b: DenseTensorConstraints | None = None#

Constraints for B’s per-group scale, or None when the scale is omitted.

supports(
args: RuntimeArguments,
) → Status#

Check whether runtime arguments provide compatible per-group scales.

MMA instructions#

class cutlass.operators.mma.MmaInstruction#

Bases: object

Models properties of an abstract MMA instruction.

static supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

Return all the supported targets for the MMA instruction, given optional design and operands metadata.

static shape_k(operands: OperandsMetadata) → int#

Return the K dimension of the shape of matrix multiplication performed by this instruction.

class cutlass.operators.mma.BlackwellTcgen05Mma#

Bases: MmaInstruction

Models the tcgen05.mma instruction for the Blackwell architecture.

classmethod supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

See MmaInstruction.supported_targets().

static shape_k(operands: OperandsMetadata) → int#

See MmaInstruction.shape_k().

class cutlass.operators.mma.RubinTcgen05Mma#

Bases: MmaInstruction

Models the tcgen05 MMA instruction for the Rubin architecture.

classmethod supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

See MmaInstruction.supported_targets().

classmethod shape_k_for_dtypes(
a_dtype: type[Numeric],
b_dtype: type[Numeric],
) → int#

Return the instruction K for an A/B operand dtype pair.

Provided alongside shape_k() for callers that carry bare dtypes rather than an OperandsMetadata: 128 for FP4 pairs, 64 for FP8 pairs, 8 for F32/TF32 and 16 for F16/BF16.

classmethod shape_k(operands: OperandsMetadata) → int#

See MmaInstruction.shape_k().

class cutlass.operators.mma.BlackwellTcgen05MmaSparse#

Bases: MmaInstruction

Models the tcgen05.mma.sp instruction for the Blackwell architecture.

static supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

See MmaInstruction.supported_targets().

class cutlass.operators.mma.HopperWgmma#

Bases: MmaInstruction

Models the wgmma Tensor Core MMA instruction for the Hopper architecture.

classmethod supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

See MmaInstruction.supported_targets().

class cutlass.operators.mma.AmpereMma#

Bases: MmaInstruction

Models the Tensor Core MMA instruction for the Ampere architecture.

classmethod supported_targets(
design: DesignMetadata | None = None,
operands: OperandsMetadata | None = None,
) → list[TargetSm]#

See MmaInstruction.supported_targets().