cuSPARSELt Data Types¶
Opaque Data Structures¶
cusparseLtHandle_t¶
ThecusparseLtHandle_tstructure holds the cuSPARSELt library context (device properties, system information, etc.).The handle must be initialized and destroyed with cusparseLtInit() and cusparseLtDestroy() functions respectively.
cusparseLtMatDescriptor_t¶
ThecusparseLtMatDescriptor_tstructure captures the shape and characteristics of a matrix.It is initialized with cusparseLtDenseDescriptorInit() or cusparseLtStructuredDescriptorInit() functions and destroyed with cusparseLtMatDescriptorDestroy().
cusparseLtMatmulDescriptor_t¶
ThecusparseLtMatmulDescriptor_tstructure holds the description of the matrix multiplication operation.It is initialized with cusparseLtMatmulDescriptorInit() function.
cusparseLtMatmulAlgSelection_t¶
ThecusparseLtMatmulAlgSelection_tstructure holds the description of the matrix multiplication algorithm.It is initialized with cusparseLtMatmulAlgSelectionInit() function.
cusparseLtMatmulPlan_t¶
ThecusparseLtMatmulPlan_tstructure holds the matrix multiplication execution plan, namely all the information necessary to execute thecusparseLtMatmul()operation.It is initialized and destroyed with cusparseLtMatmulPlanInit() and cusparseLtMatmulPlanDestroy() functions respectively.
Enumerators¶
cusparseLtSparsity_t¶
ThecusparseLtSparsity_tenumerator specifies the sparsity ratio of the structured matrix as
Value |
Description |
|---|---|
|
50% Sparsity Ratio (2:4 for |
The sparsity property is used in the cusparseLtStructuredDescriptorInit() function.
cusparseComputeType¶
ThecusparseComputeTypeenumerator specifies the compute precision modes of the matrix
Value |
Description |
|---|---|
|
- Default mode for 16-bit floating-point precision - All computations and intermediate storage ensure at least 16-bit precision - Tensor Cores will be used whenever possible |
|
- Default mode for 32-bit integer precision - All computations and intermediate storage ensure at least 32-bit integer precision - Tensor Cores will be used whenever possible |
|
- Default mode for 32-bit floating-point precision - The inputs are supposed to be directly represented in TensorFloat-32 precision. The 32-bit floating-point values are truncated to TensorFloat-32 before the computation - All computations and intermediate storage ensure at least TensorFloat-32 precision - Tensor Cores will be used whenever possible |
|
- All computations and intermediate storage ensure at least TensorFloat-32 precision - The inputs are rounded to TensorFloat-32 precision. This mode is slower than - Tensor Cores will be used whenever possible |
The compute precision is used in the cusparseLtMatmulDescriptorInit() function.
cusparseLtMatmulAlg_t¶
ThecusparseLtMatmulAlg_tenumerator specifies the algorithm for matrix-matrix multiplication
Value |
Description |
|---|---|
|
Default algorithm |
The algorithm enumerator is used in the cusparseLtMatmulAlgSelectionInit() function.
cusparseLtMatmulAlgAttribute_t¶
ThecusparseLtMatmulAlgAttribute_tenumerator specifies the matrix multiplication algorithm attributes
Value |
Description |
|---|---|
|
Algorithm ID (set and query) |
|
Algorithm ID limit (query only) |
|
Number of iterations (kernel launches per algorithm) for cusparseLtMatmulSearch(), default=10 |
The algorithm attribute enumerator is used in the cusparseLtMatmulAlgGetAttribute() and cusparseLtMatmulAlgSetAttribute() functions.
cusparseLtPruneAlg_t¶
ThecusparseLtPruneAlg_tenumerator specifies the pruning algorithm to apply to the structured matrix before the compression
Value |
Description |
|---|---|
|
-
- |
|
-
-
The strip direction is chosen according to the operation |
The pruning algorithm is used in the cusparseLtSpMMAPrune() function.