hipSPARSELt datatypes reference

Contents

hipSPARSELt datatypes reference#

hipsparseLtHandle_t#

struct hipsparseLtHandle_t#

Handle to the hipSPARSELt library context queue.

The hipSPARSELt handle is a structure holding the hipSPARSELt library context. It must be initialized using hipsparseLtInit and the returned handle must be passed to all subsequent library function calls. It should be destroyed at the end using hipsparseLtDestroy.

hipsparseLtMatDescriptor_t#

struct hipsparseLtMatDescriptor_t#

Descriptor of the matrix.

The hipSPARSELt matrix descriptor is a structure holding all properties of a matrix. It must be initialized using hipsparseLtDenseDescriptorInit and the returned descriptor must be passed to all subsequent library calls that involve the matrix. It should be destroyed at the end using hipsparseLtMatDescriptorDestroy.

hipsparseLtMatmulDescriptor_t#

struct hipsparseLtMatmulDescriptor_t#

Descriptor of the matrix multiplication operation.

The hipSPARSELt matrix multiplication descriptor is a structure holding the description of the matrix multiplication operation. It is initialized with the hipsparseLtMatmulDescriptorInit function.

hipsparseLtMatmulAlgSelection_t#

struct hipsparseLtMatmulAlgSelection_t#

Descriptor of the matrix multiplication algorithm.

It is initialized with the hipsparseLtMatmulAlgSelectionInit function.

hipsparseLtMatmulPlan_t#

struct hipsparseLtMatmulPlan_t#

Descriptor of the matrix multiplication execution plan.

The hipSPARSELt matrix multiplication execution plan descriptor is a structure holding all the information necessary to execute the hipsparseLtMatmul operation. It is initialized and destroyed using the hipsparseLtMatmulPlanInit and hipsparseLtMatmulPlanDestroy functions, respectively.

hipsparseLtSparsity_t#

enum hipsparseLtSparsity_t#

Specify the sparsity of the structured matrix.

The enumerator specifies the sparsity ratio of the structured matrix as sparsity = nnz / total elements. The sparsity property is used in the hipsparseLtStructuredDescriptorInit function.

Values:

enumerator HIPSPARSELT_SPARSITY_50_PERCENT#

50% sparsity ratio:

  • 1:2 for TF32 and float.

  • 2:4 for half, bfloat16, and int.

hipsparseLtComputetype_t#

enum hipsparseLtComputetype_t#

Specify the compute precision modes of the matrix.

Values:

enumerator HIPSPARSELT_COMPUTE_16F#

16-bit floating-point precision. CUDA backend only.

enumerator HIPSPARSELT_COMPUTE_32I#

32-bit integer precision.

enumerator HIPSPARSELT_COMPUTE_32F#

32-bit floating-point precision. HIP backend only.

enumerator HIPSPARSELT_COMPUTE_TF32#

32-bit floating point value, rounded to TF32 before the computation. CUDA backend only.

enumerator HIPSPARSELT_COMPUTE_TF32_FAST#

32-bit floating point value, truncated to TF32 before the computation. CUDA backend only.

hipsparseLtMatDescAttribute_t#

enum hipsparseLtMatDescAttribute_t#

Specify the additional attributes of a matrix descriptor.

The hipsparseLtMatDescAttribute_t enumeration is used in the hipsparseLtMatDescSetAttribute and hipsparseLtMatDescGetAttribute functions.

Values:

enumerator HIPSPARSELT_MAT_NUM_BATCHES#

Number of matrices in a batch. READ/WRITE.

enumerator HIPSPARSELT_MAT_BATCH_STRIDE#

Stride between consecutive matrices in a batch expressed in terms of matrix elements. READ/WRITE.

hipsparseLtMatmulDescAttribute_t#

enum hipsparseLtMatmulDescAttribute_t#

Specify the additional attributes of a matrix multiplication descriptor.

The hipsparseLtMatmulDescAttribute_t enumeration is used in the hipsparseLtMatmulDescSetAttribute and hipsparseLtMatmulDescGetAttribute functions.

Values:

enumerator HIPSPARSELT_MATMUL_ACTIVATION_RELU#

ReLU activation function.

enumerator HIPSPARSELT_MATMUL_ACTIVATION_RELU_UPPERBOUND#

Upper bound of the ReLU activation function.

enumerator HIPSPARSELT_MATMUL_ACTIVATION_RELU_THRESHOLD#

Lower threshold of the ReLU activation function.

enumerator HIPSPARSELT_MATMUL_ACTIVATION_GELU#

GeLU activation function.

enumerator HIPSPARSELT_MATMUL_ACTIVATION_GELU_SCALING#

Scaling coefficient for the GeLU activation function. It implies GeLU is endable.

enumerator HIPSPARSELT_MATMUL_ALPHA_VECTOR_SCALING#

Enable/disable alpha vector (per-channel) scaling.

enumerator HIPSPARSELT_MATMUL_BETA_VECTOR_SCALING#

Enable/disable beta vector (per-channel) scaling.

enumerator HIPSPARSELT_MATMUL_BIAS_STRIDE#

Bias pointer. The Bias vector size must be equal to the number of rows of the output matrix (D).

enumerator HIPSPARSELT_MATMUL_BIAS_POINTER#

Bias stride between consecutive Bias vectors. 0 means broadcast the first bias vector.

enumerator HIPSPARSELT_MATMUL_ACTIVATION_ABS#

ABS activation function. HIP backend only.

enumerator HIPSPARSELT_MATMUL_ACTIVATION_LEAKYRELU#

LeakyReLU activation function. HIP backend only.

enumerator HIPSPARSELT_MATMUL_ACTIVATION_LEAKYRELU_ALPHA#

Alpha value of the LeakyReLU activation function. HIP backend only.

enumerator HIPSPARSELT_MATMUL_ACTIVATION_SIGMOID#

Sigmoid activation function. HIP backend only.

enumerator HIPSPARSELT_MATMUL_ACTIVATION_TANH#

Tanh activation function. HIP backend only.

enumerator HIPSPARSELT_MATMUL_ACTIVATION_TANH_ALPHA#

Alpha value of the Tanh activation function. HIP backend only.

enumerator HIPSPARSELT_MATMUL_ACTIVATION_TANH_BETA#

Beta value of the Tanh activation function. HIP backend only.

enumerator HIPSPARSELT_MATMUL_BIAS_TYPE#

Precision of Bias. HIP backend only.

  • When the input datatype is FP16, the Bias type can be FP16 or FP32. (default FP16)

  • When the input datatype is BF16, the Bias type can be BF16 or FP32. (default BF16)

  • In other cases, the Bias type is FP32.

enumerator HIPSPARSELT_MATMUL_SPARSE_MAT_POINTER#

Pointer to the pruned sparse matrix.

hipsparseLtMatmulAlg_t#

enum hipsparseLtMatmulAlg_t#

Specify the algorithm for matrix-matrix multiplication.

The hipsparseLtMatmulAlg_t enumeration is used in the hipsparseLtMatmulAlgSelectionInit function.

Values:

enumerator HIPSPARSELT_MATMUL_ALG_DEFAULT#

hipsparseLtMatmulAlgAttribute_t#

enum hipsparseLtMatmulAlgAttribute_t#

Specify the matrix multiplication algorithm attributes.

The hipsparseLtMatmulAlgAttribute_t enumeration is used in the hipsparseLtMatmulAlgGetAttribute and hipsparseLtMatmulAlgSetAttribute functions.

Values:

enumerator HIPSPARSELT_MATMUL_ALG_CONFIG_ID#
enumerator HIPSPARSELT_MATMUL_ALG_CONFIG_MAX_ID#
enumerator HIPSPARSELT_MATMUL_SEARCH_ITERATIONS#
enumerator HIPSPARSELT_MATMUL_SPLIT_K#
enumerator HIPSPARSELT_MATMUL_SPLIT_K_MODE#
enumerator HIPSPARSELT_MATMUL_SPLIT_K_BUFFERS#

hipsparseLtPruneAlg_t#

enum hipsparseLtPruneAlg_t#

Specify the pruning algorithm to apply to the structured matrix before the compression.

The hipsparseLtPruneAlg_t enumeration is used in the hipsparseLtSpMMAPrune and hipsparseLtSpMMAPrune2 functions.

Values:

enumerator HIPSPARSELT_PRUNE_SPMMA_TILE#

Zero out eight elements in a 4x4 tile. Non-zero elements have the maximum L1-norm value in all combinations in the tile. Exactly two elements in each row and column.

enumerator HIPSPARSELT_PRUNE_SPMMA_STRIP#

Zero out two elements in a 1x4 strip. Non-zero elements have the maximum L1-norm value in all combinations in the strip.

hipsparseLtSplitKMode_t#

enum hipsparseLtSplitKMode_t#

Specify the Split-K mode value.

The hipsparseLtSplitKMode_t enumeration is used by the HIPSPARSELT_MATMUL_SPLIT_K_MODE attribute in hipsparseLtMatmulAlgAttribute_t.

Values:

enumerator HIPSPARSELT_SPLIT_K_MODE_ONE_KERNEL#

Use the same SP-MM kernel to do the final reduction.

enumerator HIPSPARSELT_SPLIT_K_MODE_TWO_KERNELS#

Use another kernel to do the final reduction.