rocm.bindings.hipblaslt#
2026-09-24
31 min read time
Advanced Micro Devices, Inc.
Attributes#
Classes#
Specifies the enumeration type to set the postprocessing options for the epilogue. |
|
Specify the batch mode of the matrices. |
|
Specifies the attributes that define the details of the matrix. |
|
Pointer mode to use for alpha. |
|
Block scale mode for A and B. |
|
Mode values for the |
|
Specifies the attributes that define the specifics of the matrix multiply operation. |
|
This is an enumerated type used to apply algorithm search preferences while fine-tuning the heuristic function. |
|
Enumeration for data ordering. |
|
Matrix transform descriptor attributes to define details of the operation. |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
Semi-opaque descriptor for hipblasLtMatrixTransform() operation details |
Functions#
|
|
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
(No short description, might be part of a group.) |
|
Create a hipBLASLt handle |
|
|
Destroy a hipBLASLt handle. |
|
Set the handle-level target compute-unit (CU / SM) count. |
|
Return the handle-level target compute-unit (CU / SM) count. |
|
Drain the post-GEMM check-numerics flag without destroying the handle. |
|
Create a matrix layout descriptor. |
|
Destroy a matrix layout descriptor |
|
Set an attribute for a matrix descriptor. |
|
Query an attribute from a matrix descriptor. |
|
Create a matrix multiply descriptor. |
|
Destroy a matrix multiply descriptor. |
|
Set attribute to a matrix multiply descriptor. |
|
Query attribute from a matrix multiply descriptor. |
Create a preference descriptor. |
|
Destroy a preference descriptor. |
|
|
Set attribute in a preference descriptor. |
|
Query attribute from a preference descriptor. |
|
Retrieve the possible algorithms. |
|
Compute a matrix multiplication on the described inputs. |
|
Create a new matrix transform operation descriptor. |
|
Destroy a matrix transform operation descriptor. |
Set a matrix transform operation descriptor attribute. |
|
Gets the matrix transform attribute. |
|
|
Matrix layout conversion helper. |
Module Contents#
- rocm.bindings.hipblaslt.HIPBLASLT_VERSION_MAJOR: Any#
- rocm.bindings.hipblaslt.HIPBLASLT_VERSION_MINOR: Any#
- rocm.bindings.hipblaslt.HIPBLASLT_VERSION_PATCH: Any#
- class rocm.bindings.hipblaslt.hipblasLtEpilogue_t#
Bases:
enum.IntEnumSpecifies the enumeration type to set the postprocessing options for the epilogue.
- class rocm.bindings.hipblaslt.hipblasLtBatchMode_t#
Bases:
enum.IntEnumSpecify the batch mode of the matrices.
- class rocm.bindings.hipblaslt.hipblasLtMatrixLayoutAttribute_t#
Bases:
enum.IntEnumSpecifies the attributes that define the details of the matrix.
- class rocm.bindings.hipblaslt.hipblasLtPointerMode_t#
Bases:
enum.IntEnumPointer mode to use for alpha.
- class rocm.bindings.hipblaslt.hipblasLtMatmulMatrixScale_t#
Bases:
enum.IntEnumBlock scale mode for A and B.
- class rocm.bindings.hipblaslt.hipblasLtStreamKTileSchedulingMode_t#
Bases:
enum.IntEnumMode values for the
HIPBLASLT_MATMUL_DESC_STREAMK_TILE_SCHEDULING_EXTattribute and the C++ extGemmPreference::setStreamKTileSchedulingMode.The attribute storage stays
int32_t; values outside{0, 1, 2}are rejected by the setter withHIPBLAS_STATUS_INVALID_VALUE.
- class rocm.bindings.hipblaslt.hipblasLtMatmulDescAttributes_t#
Bases:
enum.IntEnumSpecifies the attributes that define the specifics of the matrix multiply operation.
- class rocm.bindings.hipblaslt.hipblasLtMatmulPreferenceAttributes_t#
Bases:
enum.IntEnumThis is an enumerated type used to apply algorithm search preferences while fine-tuning the heuristic function.
- class rocm.bindings.hipblaslt.hipblasLtOrder_t#
Bases:
enum.IntEnumEnumeration for data ordering.
- class rocm.bindings.hipblaslt.hipblasLtMatrixTransformDescAttributes_t#
Bases:
enum.IntEnumMatrix transform descriptor attributes to define details of the operation.
- class rocm.bindings.hipblaslt.hipblasLtMatmulDescOpaque_t(*args, **kwargs)#
Bases:
rocm.bindings.util.types.Pointer(No short description)
- data: Any#
- static fromObj(pyobj) Any#
- as_c_void_p() Any#
- class rocm.bindings.hipblaslt.hipblasLtMatrixLayoutOpaque_t(*args, **kwargs)#
Bases:
rocm.bindings.util.types.Pointer(No short description)
- data: Any#
- static fromObj(pyobj) Any#
- as_c_void_p() Any#
- class rocm.bindings.hipblaslt.hipblasLtMatmulPreferenceOpaque_t(*args, **kwargs)#
Bases:
rocm.bindings.util.types.Pointer(No short description)
- data: Any#
- static fromObj(pyobj) Any#
- as_c_void_p() Any#
- class rocm.bindings.hipblaslt.hipblasLtMatrixTransformDescOpaque_t(*args, **kwargs)#
Bases:
rocm.bindings.util.types.PointerSemi-opaque descriptor for hipblasLtMatrixTransform() operation details
- data: Any#
- static fromObj(pyobj) Any#
- as_c_void_p() Any#
- rocm.bindings.hipblaslt.hipblasLtMatrixTransformDesc_t#
- rocm.bindings.hipblaslt.hipblasLtMatmulDesc_t#
- rocm.bindings.hipblaslt.hipblasLtMatrixLayout_t#
- rocm.bindings.hipblaslt.hipblasLtMatmulPreference_t#
- rocm.bindings.hipblaslt.hipblasLtMatmulAlgo_t#
- rocm.bindings.hipblaslt.hipblasLtMatmulHeuristicResult_t#
- rocm.bindings.hipblaslt.hipblasLtGetVersion(handle)#
(No short description, might be part of a group.)
- Args:
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: (undocumented)- version (
int): (undocumented)
- version (
C signature
hipblasStatus_t hipblasLtGetVersion(hipblasLtHandle_t handle, int * version)
- rocm.bindings.hipblaslt.hipblasLtGetGitRevision(handle, rev)#
(No short description, might be part of a group.)
- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipblasStatus_t: (undocumented)
C signature
hipblasStatus_t hipblasLtGetGitRevision(hipblasLtHandle_t handle, char * rev)
- rocm.bindings.hipblaslt.hipblasLtGetArchName()#
(No short description, might be part of a group.)
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: (undocumented)
C signature
hipblasStatus_t hipblasLtGetArchName(char ** archName)
- rocm.bindings.hipblaslt.hipblasLtCreate()#
Create a hipBLASLt handle
This function initializes the hipBLASLt library and creates a handle to an opaque structure holding the hipBLASLt library context. It allocates light hardware resources on the host and device and must be called prior to making any other hipBLASLt library calls. The hipBLASLt library context is tied to the current ROCm device. To use the library on multiple devices, one hipBLASLt handle should be created for each device.
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: The allocation completed successfully.HIPBLAS_STATUS_INVALID_VALUE:handle== NULL.
C signature
hipblasStatus_t hipblasLtCreate(hipblasLtHandle_t * handle)
- rocm.bindings.hipblaslt.hipblasLtDestroy(handle)#
Destroy a hipBLASLt handle.
- This function releases hardware resources used by the hipBLASLt library.
It is usually the last call with a particular handle to the
hipBLASLt library. Because hipblasLtCreate() allocates some internal resources and the release of those resources by calling hipblasLtDestroy() implicitly calls
hipDeviceSynchronize, it is recommended to minimize the number of hipblasLtCreate() / hipblasLtDestroy() occurrences.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: The hipBLASLt context was successfully destroyed.HIPBLAS_STATUS_NOT_INITIALIZED: The hipBLASLt library was not initialized.HIPBLAS_STATUS_INVALID_VALUE:handle== NULL.
C signature
hipblasStatus_t hipblasLtDestroy(const hipblasLtHandle_t handle)
- rocm.bindings.hipblaslt.hipblasLtSetSmCountTarget(handle, smCountTarget)#
Set the handle-level target compute-unit (CU / SM) count.
The hipBLASLt analogue of cuBLAS’s
cublasSetSmCountTarget. The value hints how many compute units hipBLASLt should target for kernel selection and persistent-grid sizing on subsequent matmul calls that use this handle.0(the default) means “no override; use all CUs the device exposes”. Negative values are rejected withHIPBLAS_STATUS_INVALID_VALUE. A per-matmul-descriptor (HIPBLASLT_MATMUL_DESC_SM_COUNT_TARGET) or per-preference (HIPBLASLT_MATMUL_PREF_SM_COUNT_TARGET) attribute, when set to a non-zero value, takes precedence over this handle-level value.The user must ensure thread safety when modifying handle state from multiple threads, the same as for any other handle-mutating helper.
- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: value stored.HIPBLAS_STATUS_NOT_INITIALIZED:handleis null / uninitialized.HIPBLAS_STATUS_INVALID_VALUE:smCountTargetis negative.
C signature
hipblasStatus_t hipblasLtSetSmCountTarget(hipblasLtHandle_t handle, int32_t smCountTarget)
- rocm.bindings.hipblaslt.hipblasLtGetSmCountTarget(handle)#
Return the handle-level target compute-unit (CU / SM) count.
Returns the value previously programmed via
hipblasLtSetSmCountTarget. Equivalent to cuBLAS’scublasGetSmCountTarget.- Args:
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: value returned.HIPBLAS_STATUS_NOT_INITIALIZED:handleis null / uninitialized.HIPBLAS_STATUS_INVALID_VALUE:smCountTargetis null.
int:receives the previously stored value (
0if never set).
C signature
hipblasStatus_t hipblasLtGetSmCountTarget(hipblasLtHandle_t handle, int32_t * smCountTarget)
- rocm.bindings.hipblaslt.hipblasLtCheckNumericsDrain(handle)#
Drain the post-GEMM check-numerics flag without destroying the handle.
When
HIPBLASLT_CHECK_NUMERICSis set, this function performs a device-wide synchronize, reads the persistent NaN flag, and resets it. The matmulcall_idof the FIRST scanned NaN observed since the previous drain (or handle creation) is written tofirst_nan_call_idif non-null. Zero means no NaN was observed in that window. Frameworks (e.g. PyTorch) call this to obtain a result without relying on the handle destructor (which may not run if the process is killed).When the env var is not set, the function is a no-op and returns
HIPBLAS_STATUS_SUCCESSwith*first_nan_call_idset to 0.- Args:
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: Drain completed (or scanning disabled).HIPBLAS_STATUS_NOT_INITIALIZED:handleis null.
int:Optional. If non-null, receives the call_id of the first NaN seen in this drain window (0 = none).
C signature
hipblasStatus_t hipblasLtCheckNumericsDrain(hipblasLtHandle_t handle, uint32_t * first_nan_call_id)
- rocm.bindings.hipblaslt.hipblasLtMatrixLayoutCreate(type, rows, cols, ld)#
Create a matrix layout descriptor.
This function creates a matrix layout descriptor by allocating the memory needed to hold its opaque structure.
- Args:
- type (
hipDataType) – IN: Enumerant that specifies the data precision for the matrix layout descriptor created by this function. See hipDataType.
- rows (
int) – IN: Number of rows of the matrix.
- cols (
int) – IN: Number of columns of the matrix.
- ld (
int) – IN: The leading dimension of the matrix. In column major layout, this is the number of elements to jump to reach the next column. Therefore, ld >= m (number of rows).
- type (
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: If the descriptor was created successfully.HIPBLAS_STATUS_ALLOC_FAILED: If the memory could not be allocated.
hipblasLtMatrixLayoutOpaque_t:Pointer to the structure holding the matrix layout descriptor created by this function. See
hipblasLtMatrixLayout_t.
C signature
hipblasStatus_t hipblasLtMatrixLayoutCreate(hipblasLtMatrixLayout_t * matLayout, hipDataType type, uint64_t rows, uint64_t cols, int64_t ld)
- rocm.bindings.hipblaslt.hipblasLtMatrixLayoutDestroy(matLayout)#
Destroy a matrix layout descriptor
This function destroys a previously created matrix layout descriptor object.
- Args:
- matLayout (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Pointer to the structure holding the matrix layout descriptor to be destroyed by this function. see
hipblasLtMatrixLayout_t.
- matLayout (
- Returns:
A
tupleof size 1 that contains (in that order):hipblasStatus_t:HIPBLAS_STATUS_SUCCESS: If the operation was successful.
C signature
hipblasStatus_t hipblasLtMatrixLayoutDestroy(const hipblasLtMatrixLayout_t matLayout)
- rocm.bindings.hipblaslt.hipblasLtMatrixLayoutSetAttribute(matLayout, attr, buf, sizeInBytes)#
Set an attribute for a matrix descriptor.
This function sets the value of the specified attribute belonging to a previously created matrix descriptor.
- Args:
- matLayout (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Pointer to the previously created structure holding the matrix descriptor queried by this function. See
hipblasLtMatrixLayout_t.- attr (
hipblasLtMatrixLayoutAttribute_t) – IN: The attribute that will be set by this function. See ref hipblasLtMatrixLayoutAttribute_t.
- buf (
Pointer/object) – IN: The value to which the specified attribute should be set.
- sizeInBytes (
int) – IN: Size of the buf buffer (in bytes) for verification.
- matLayout (
- Returns:
A
tupleof size 1 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: If the attribute was set successfully.HIPBLAS_STATUS_INVALID_VALUE: Ifbufis NULL orsizeInBytesdoesn’t match the size of the internal storage for the selected attribute.
C signature
hipblasStatus_t hipblasLtMatrixLayoutSetAttribute(hipblasLtMatrixLayout_t matLayout, hipblasLtMatrixLayoutAttribute_t attr, const void * buf, size_t sizeInBytes)
- rocm.bindings.hipblaslt.hipblasLtMatrixLayoutGetAttribute(matLayout, attr, buf, sizeInBytes)#
Query an attribute from a matrix descriptor.
This function returns the value of the queried attribute belonging to a previously created matrix descriptor.
- Args:
- matLayout (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Pointer to the previously created structure holding the matrix descriptor queried by this function. See
hipblasLtMatrixLayout_t.- attr (
hipblasLtMatrixLayoutAttribute_t) – IN: The attribute that will be retrieved by this function. See
hipblasLtMatrixLayoutAttribute_t.- buf (
Pointer/object) – OUT: Memory address containing the attribute value retrieved by this function.
- sizeInBytes (
int) – IN: Size of the
bufbuffer (in bytes) for verification.
- matLayout (
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: If the attribute’s value was successfully written to user memory.HIPBLAS_STATUS_INVALID_VALUE: If p sizeInBytes is 0 andsizeWrittenis NULL, or ifsizeInBytesis non-zero andbufis NULL, orsizeInBytesdoesn’t match the size of the internal storage for the selected attribute.
int:Valid only when the return value is HIPBLAS_STATUS_SUCCESS. If sizeInBytes is non-zero, then sizeWritten is the number of bytes actually written. If sizeInBytes is 0, then sizeWritten is the number of bytes needed to write the full contents.
C signature
hipblasStatus_t hipblasLtMatrixLayoutGetAttribute(hipblasLtMatrixLayout_t matLayout, hipblasLtMatrixLayoutAttribute_t attr, void * buf, size_t sizeInBytes, size_t * sizeWritten)
- rocm.bindings.hipblaslt.hipblasLtMatmulDescCreate(computeType, scaleType)#
Create a matrix multiply descriptor.
This function creates a matrix multiply descriptor by allocating the memory needed to hold its opaque structure.
- Args:
- computeType (
hipblasComputeType_t) – IN: Enumerant that specifies the data precision for the matrix multiply descriptor this function creates. See hipblasComputeType_t.
- scaleType (
hipDataType) – IN: Enumerant that specifies the data precision for the matrix transform descriptor this function creates. See hipDataType.
- computeType (
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: If the descriptor was created successfully.HIPBLAS_STATUS_ALLOC_FAILED: If the memory could not be allocated.
hipblasLtMatmulDescOpaque_t:Pointer to the structure holding the matrix multiply descriptor created by this function. See
hipblasLtMatmulDesc_t.
C signature
hipblasStatus_t hipblasLtMatmulDescCreate(hipblasLtMatmulDesc_t * matmulDesc, hipblasComputeType_t computeType, hipDataType scaleType)
- rocm.bindings.hipblaslt.hipblasLtMatmulDescDestroy(matmulDesc)#
Destroy a matrix multiply descriptor.
This function destroys a previously created matrix multiply descriptor object.
- Args:
- matmulDesc (
hipblasLtMatmulDescOpaque_t/object) – IN: Pointer to the structure holding the matrix multiply descriptor to be destroyed by this function. See
hipblasLtMatmulDesc_t.
- matmulDesc (
- Returns:
A
tupleof size 1 that contains (in that order):hipblasStatus_t:HIPBLAS_STATUS_SUCCESS: If operation was successful.
C signature
hipblasStatus_t hipblasLtMatmulDescDestroy(const hipblasLtMatmulDesc_t matmulDesc)
- rocm.bindings.hipblaslt.hipblasLtMatmulDescSetAttribute(matmulDesc, attr, buf, sizeInBytes)#
Set attribute to a matrix multiply descriptor.
This function sets the value of the specified attribute belonging to a previously created matrix multiply descriptor.
- Args:
- matmulDesc (
hipblasLtMatmulDescOpaque_t/object) – IN: Pointer to the previously created structure holding the matrix multiply descriptor queried by this function. See
hipblasLtMatmulDesc_t.- attr (
hipblasLtMatmulDescAttributes_t) – IN: The attribute that will be set by this function. See ref hipblasLtMatmulDescAttributes_t.
- buf (
Pointer/object) – IN: The value to which the specified attribute should be set.
- sizeInBytes (
int) – IN: Size of the buf buffer (in bytes) for verification.
- matmulDesc (
- Returns:
A
tupleof size 1 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: If the attribute was set successfully.HIPBLAS_STATUS_INVALID_VALUE: Ifbufis NULL orsizeInBytesdoesn’t match the size of the internal storage for the selected attribute.
C signature
hipblasStatus_t hipblasLtMatmulDescSetAttribute(hipblasLtMatmulDesc_t matmulDesc, hipblasLtMatmulDescAttributes_t attr, const void * buf, size_t sizeInBytes)
- rocm.bindings.hipblaslt.hipblasLtMatmulDescGetAttribute(matmulDesc, attr, buf, sizeInBytes)#
Query attribute from a matrix multiply descriptor.
This function returns the value of the queried attribute belonging to a previously created matrix multiply descriptor.
- Args:
- matmulDesc (
hipblasLtMatmulDescOpaque_t/object) – IN: Pointer to the previously created structure holding the matrix multiply descriptor queried by this function. See
hipblasLtMatmulDesc_t.- attr (
hipblasLtMatmulDescAttributes_t) – IN: The attribute that will be retrieved by this function. See
hipblasLtMatmulDescAttributes_t.- buf (
Pointer/object) – OUT: Memory address containing the attribute value retrieved by this function.
- sizeInBytes (
int) – IN: Size of the
bufbuffer (in bytes) for verification.
- matmulDesc (
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: If the attribute’s value was successfully written to user memory.HIPBLAS_STATUS_INVALID_VALUE: If p sizeInBytes is 0 andsizeWrittenis NULL, or ifsizeInBytesis non-zero andbufis NULL, orsizeInBytesdoesn’t match the size of the internal storage for the selected attribute.
int:Valid only when the return value is HIPBLAS_STATUS_SUCCESS. If sizeInBytes is non-zero, then sizeWritten is the number of bytes actually written. If sizeInBytes is 0, then sizeWritten is the number of bytes needed to write the full contents.
C signature
hipblasStatus_t hipblasLtMatmulDescGetAttribute(hipblasLtMatmulDesc_t matmulDesc, hipblasLtMatmulDescAttributes_t attr, void * buf, size_t sizeInBytes, size_t * sizeWritten)
- rocm.bindings.hipblaslt.hipblasLtMatmulPreferenceCreate()#
Create a preference descriptor.
This function creates a matrix multiply heuristic search preferences descriptor by allocating the memory needed to hold its opaque structure.
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: If the descriptor was created successfully.HIPBLAS_STATUS_ALLOC_FAILED: If memory could not be allocated.
hipblasLtMatmulPreferenceOpaque_t:Pointer to the structure holding the matrix multiply preferences descriptor created by this function. see
hipblasLtMatmulPreference_t.
C signature
hipblasStatus_t hipblasLtMatmulPreferenceCreate(hipblasLtMatmulPreference_t * pref)
- rocm.bindings.hipblaslt.hipblasLtMatmulPreferenceDestroy(pref)#
Destroy a preference descriptor.
This function destroys a previously created matrix multiply preferences descriptor object.
- Args:
- pref (
hipblasLtMatmulPreferenceOpaque_t/object) – IN: Pointer to the structure holding the matrix multiply preferences descriptor to be destroyed by this function. See ref hipblasLtMatmulPreference_t.
- pref (
- Returns:
A
tupleof size 1 that contains (in that order):hipblasStatus_t:HIPBLAS_STATUS_SUCCESS: If operation was successful.
C signature
hipblasStatus_t hipblasLtMatmulPreferenceDestroy(const hipblasLtMatmulPreference_t pref)
- rocm.bindings.hipblaslt.hipblasLtMatmulPreferenceSetAttribute(pref, attr, buf, sizeInBytes)#
Set attribute in a preference descriptor.
This function sets the value of the specified attribute belonging to a previously created matrix multiply preferences descriptor.
- Args:
- pref (
hipblasLtMatmulPreferenceOpaque_t/object) – IN: Pointer to the previously created structure holding the matrix multiply preferences descriptor queried by this function. See ref hipblasLtMatmulPreference_t.
- attr (
hipblasLtMatmulPreferenceAttributes_t) – IN: The attribute that will be set by this function. See ref hipblasLtMatmulPreferenceAttributes_t.
- buf (
Pointer/object) – IN: The value to which the specified attribute should be set.
- sizeInBytes (
int) – IN: Size of the
bufbuffer (in bytes) for verification.
- pref (
- Returns:
A
tupleof size 1 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: If the attribute was set successfully.HIPBLAS_STATUS_INVALID_VALUE: Ifbufis NULL orsizeInBytesdoesn’t match the size of the internal storage for the selected attribute.
C signature
hipblasStatus_t hipblasLtMatmulPreferenceSetAttribute(hipblasLtMatmulPreference_t pref, hipblasLtMatmulPreferenceAttributes_t attr, const void * buf, size_t sizeInBytes)
- rocm.bindings.hipblaslt.hipblasLtMatmulPreferenceGetAttribute(pref, attr, buf, sizeInBytes)#
Query attribute from a preference descriptor.
This function returns the value of the queried attribute belonging to a previously created matrix multiply heuristic search preferences descriptor.
- Args:
- pref (
hipblasLtMatmulPreferenceOpaque_t/object) – IN: Pointer to the previously created structure holding the matrix multiply heuristic search preferences descriptor queried by this function. See
hipblasLtMatmulPreference_t.- attr (
hipblasLtMatmulPreferenceAttributes_t) – IN: The attribute that will be retrieved by this function. See
hipblasLtMatmulPreferenceAttributes_t.- buf (
Pointer/object) – OUT: Memory address containing the attribute value retrieved by this function.
- sizeInBytes (
int) – IN: Size of the
bufbuffer (in bytes) for verification.
- pref (
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: If the attribute’s value was successfully written to user memory.HIPBLAS_STATUS_INVALID_VALUE: If p sizeInBytes is 0 andsizeWrittenis NULL, or ifsizeInBytesis non-zero andbufis NULL, orsizeInBytesdoesn’t match the size of the internal storage for the selected attribute.
int:Valid only when the return value is HIPBLAS_STATUS_SUCCESS. If sizeInBytes is non-zero, then sizeWritten is the number of bytes actually written. If sizeInBytes is 0, then sizeWritten is the number of bytes needed to write the full contents.
C signature
hipblasStatus_t hipblasLtMatmulPreferenceGetAttribute(hipblasLtMatmulPreference_t pref, hipblasLtMatmulPreferenceAttributes_t attr, void * buf, size_t sizeInBytes, size_t * sizeWritten)
- rocm.bindings.hipblaslt.hipblasLtMatmulAlgoGetHeuristic(handle, matmulDesc, Adesc, Bdesc, Cdesc, Ddesc, pref, requestedAlgoCount, heuristicResultsArray)#
Retrieve the possible algorithms.
This function retrieves the possible algorithms for the matrix multiply operation hipblasLtMatmul() with the given input matrices A, B, and C, and the output matrix D. The output is placed in
heuristicResultsArrayin order of increasing estimated compute time. Note that the wall duration increases if therequestedAlgoCountincreases.- Args:
- handle (
Pointer/object) – IN: Pointer to the allocated hipBLASLt handle for the hipBLASLt context. See
hipblasLtHandle_t.- matmulDesc (
hipblasLtMatmulDescOpaque_t/object) – IN: Handle to a previously created matrix multiplication descriptor of type
hipblasLtMatmulDesc_t.- Adesc (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Handles to the previously created matrix layout descriptors of the type
hipblasLtMatrixLayout_t.- Bdesc (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Handles to the previously created matrix layout descriptors of the type
hipblasLtMatrixLayout_t.- Cdesc (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Handles to the previously created matrix layout descriptors of the type
hipblasLtMatrixLayout_t.- Ddesc (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Handles to the previously created matrix layout descriptors of the type
hipblasLtMatrixLayout_t.- pref (
hipblasLtMatmulPreferenceOpaque_t/object) – IN: Pointer to the structure holding the heuristic search preferences descriptor. See
hipblasLtMatmulPreference_t.- requestedAlgoCount (
int) – IN: Size of the
heuristicResultsArray(in elements). This is the requested maximum number of algorithms to return.- heuristicResultsArray (
Pointer/object) – OUT: [] Array containing the algorithm heuristics and associated runtime characteristics returned by this function, in order of increasing estimated compute time.
- handle (
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: If query was successful. InspectheuristicResultsArray[0 to (returnAlgoCount -1)].statefor the status of the results.HIPBLAS_STATUS_NOT_SUPPORTED: If no heuristic function is available for current configuration.HIPBLAS_STATUS_INVALID_VALUE: IfrequestedAlgoCountis less than or equal to zero.
int:Number of algorithms returned by this function. This is the number of
heuristicResultsArrayelements written.
C signature
hipblasStatus_t hipblasLtMatmulAlgoGetHeuristic(hipblasLtHandle_t handle, hipblasLtMatmulDesc_t matmulDesc, hipblasLtMatrixLayout_t Adesc, hipblasLtMatrixLayout_t Bdesc, hipblasLtMatrixLayout_t Cdesc, hipblasLtMatrixLayout_t Ddesc, hipblasLtMatmulPreference_t pref, int requestedAlgoCount, hipblasLtMatmulHeuristicResult_t[] heuristicResultsArray, int * returnAlgoCount)
- rocm.bindings.hipblaslt.hipblasLtMatmul(handle, matmulDesc, alpha, A, Adesc, B, Bdesc, beta, C, Cdesc, D, Ddesc, algo, workspace, workspaceSizeInBytes, stream)#
Compute a matrix multiplication on the described inputs.
This function computes the matrix multiplication of matrices A and B to produce the output matrix D, according to the following operation:
D= p alpha*(A*B)+beta*(C), whereA,B,andCare input matrices, andalphaandbetaare input scalars. Note: This function supports both in-place matrix multiplication (C == DandCdesc == Ddesc) and out-of-place matrix multiplication (C != D, both matrices must have the same data type, number of rows, number of columns, batch size, and memory order). In the out-of-place case, the leading dimension ofCcan be different from the leading dimension ofD. Specifically, the leading dimension ofCcan be 0 to achieve row or column broadcast. IfCdescis omitted, this function assumes it to be equal toDdesc.- Args:
- handle (
Pointer/object) – IN: Pointer to the allocated hipBLASLt handle for the hipBLASLt context. See
hipblasLtHandle_t.- matmulDesc (
hipblasLtMatmulDescOpaque_t/object) – IN: Handle to a previously created matrix multiplication descriptor of type
hipblasLtMatmulDesc_t.- alpha (
Pointer/object) – IN: Pointers to the scalars used in the multiplication.
- A (
Pointer/object) – IN: Pointers to the GPU memory associated with the corresponding descriptors
Adesc,Bdesc,andCdesc.- Adesc (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Handles to the previously created matrix layout descriptors of the type
hipblasLtMatrixLayout_t.- B (
Pointer/object) – IN: Pointers to the GPU memory associated with the corresponding descriptors
Adesc,Bdesc,andCdesc.- Bdesc (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Handles to the previously created matrix layout descriptors of the type
hipblasLtMatrixLayout_t.- beta (
Pointer/object) – IN: Pointers to the scalars used in the multiplication.
- C (
Pointer/object) – IN: Pointers to the GPU memory associated with the corresponding descriptors
Adesc,Bdesc,andCdesc.- Cdesc (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Handles to the previously created matrix layout descriptors of the type
hipblasLtMatrixLayout_t.- D (
Pointer/object) – OUT: Pointer to the GPU memory associated with the descriptor
Ddesc.- Ddesc (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Handles to the previously created matrix layout descriptors of the type
hipblasLtMatrixLayout_t.- algo (
Pointer/object) – IN: Handle for matrix multiplication algorithm to be used. See
hipblasLtMatmulAlgo_t. When NULL, an implicit heuristics query with default search preferences will be performed to determine the actual algorithm to use.- workspace (
Pointer/object) – IN: Pointer to the workspace buffer allocated in the GPU memory. Pointer must be 16B aligned (that is, the lowest 4 bits of the address must be 0).
- workspaceSizeInBytes (
int) – IN: Size of the workspace.
- stream (
Pointer/object) – IN: The HIP stream where all GPU work is submitted.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_SUCCESS: If the operation completed successfully.HIPBLAS_STATUS_EXECUTION_FAILED: If HIP reported an execution error from the device.HIPBLAS_STATUS_ARCH_MISMATCH: If the configured operation cannot be run using the selected device. retval HIPBLAS_STATUS_NOT_SUPPORTED If the current implementation on the selected device doesn’t support the configured operation. retval HIPBLAS_STATUS_INVALID_VALUE If the parameters are unexpectedly NULL, in conflict, or in an impossible configuration. For example, when workspaceSizeInBytes is less than the workspace required by the configured algorithm.HIBLAS_STATUS_NOT_INITIALIZED: If the hipBLASLt handle has not been initialized.
C signature
hipblasStatus_t hipblasLtMatmul(hipblasLtHandle_t handle, hipblasLtMatmulDesc_t matmulDesc, const void * alpha, const void * A, hipblasLtMatrixLayout_t Adesc, const void * B, hipblasLtMatrixLayout_t Bdesc, const void * beta, const void * C, hipblasLtMatrixLayout_t Cdesc, void * D, hipblasLtMatrixLayout_t Ddesc, const hipblasLtMatmulAlgo_t * algo, void * workspace, size_t workspaceSizeInBytes, hipStream_t stream)
- rocm.bindings.hipblaslt.hipblasLtMatrixTransformDescCreate(scaleType)#
Create a new matrix transform operation descriptor.
- Args:
- scaleType (
hipDataType): (undocumented)
- scaleType (
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_ALLOC_FAILED: If memory could not be allocated.HIPBLAS_STATUS_SUCCESS: If the descriptor was created successfully.
- transformDesc (
hipblasLtMatrixTransformDescOpaque_t): (undocumented)
- transformDesc (
C signature
hipblasStatus_t hipblasLtMatrixTransformDescCreate(hipblasLtMatrixTransformDesc_t * transformDesc, hipDataType scaleType)
- rocm.bindings.hipblaslt.hipblasLtMatrixTransformDescDestroy(transformDesc)#
Destroy a matrix transform operation descriptor.
- Args:
- transformDesc (
hipblasLtMatrixTransformDescOpaque_t/object): (undocumented)
- transformDesc (
- Returns:
A
tupleof size 1 that contains (in that order):hipblasStatus_t:HIPBLAS_STATUS_SUCCESS: If the operation was successful.
C signature
hipblasStatus_t hipblasLtMatrixTransformDescDestroy(hipblasLtMatrixTransformDesc_t transformDesc)
- rocm.bindings.hipblaslt.hipblasLtMatrixTransformDescSetAttribute(transformDesc, attr, buf, sizeInBytes)#
Set a matrix transform operation descriptor attribute.
- Args:
- transformDesc (
hipblasLtMatrixTransformDescOpaque_t/object) – IN: The descriptor.
- attr (
hipblasLtMatrixTransformDescAttributes_t) – IN: The attribute.
- buf (
Pointer/object) – IN: Memory address containing the new value.
- sizeInBytes (
int) – IN: Size of the buf buffer for verification (in bytes).
- transformDesc (
- Returns:
A
tupleof size 1 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_INVALID_VALUE: If buf is NULL or sizeInBytes doesn’t match the size of the internal storage for the selected attribute.HIPBLAS_STATUS_SUCCESS: If the attribute was set successfully.
C signature
hipblasStatus_t hipblasLtMatrixTransformDescSetAttribute(hipblasLtMatrixTransformDesc_t transformDesc, hipblasLtMatrixTransformDescAttributes_t attr, const void * buf, size_t sizeInBytes)
- rocm.bindings.hipblaslt.hipblasLtMatrixTransformDescGetAttribute(transformDesc, attr, buf, sizeInBytes)#
Gets the matrix transform attribute.
Gets the attribute from the matrix transform operation descriptor.
- Args:
- transformDesc (
hipblasLtMatrixTransformDescOpaque_t/object) – IN: The descriptor.
- attr (
hipblasLtMatrixTransformDescAttributes_t) – IN: The attribute.
- buf (
Pointer/object) – OUT: Memory address containing the new value.
- sizeInBytes (
int) – IN: Size of the buf buffer for verification (in bytes).
- transformDesc (
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_INVALID_VALUE: If sizeInBytes is 0 and sizeWritten is NULL, or sizeInBytes is non-zero and buf is NULL, or sizeInBytes doesn’t match the size of the internal storage for the selected attribute.HIPBLAS_STATUS_SUCCESS: If the attribute’s value was successfully written to user memory.
int:Only valid when return value is HIPBLAS_STATUS_SUCCESS. If sizeInBytes is non-zero, the number of bytes actually written. If sizeInBytes is 0, the number of bytes needed to write the full contents.
C signature
hipblasStatus_t hipblasLtMatrixTransformDescGetAttribute(hipblasLtMatrixTransformDesc_t transformDesc, hipblasLtMatrixTransformDescAttributes_t attr, void * buf, size_t sizeInBytes, size_t * sizeWritten)
- rocm.bindings.hipblaslt.hipblasLtMatrixTransform(lightHandle, transformDesc, alpha, A, Adesc, beta, B, Bdesc, C, stream)#
Matrix layout conversion helper.
The matrix layout conversion helper (
C = alpha * op(A) + beta * op(B)), can be used to change the memory order of the data or to scale and shift the values.- Args:
- lightHandle (
Pointer/object) – IN: Pointer to the allocated hipBLASLt handle for the hipBLASLt context. See
hipblasLtHandle_t.- transformDesc (
hipblasLtMatrixTransformDescOpaque_t/object) – IN: Pointer to the allocated matrix transform descriptor.
- alpha (
Pointer/object) – IN: Pointer to scalar alpha. Pointer to either the host or device address.
- A (
Pointer/object) – IN: Pointer to matrix A. Must be a pointer to the device address.
- Adesc (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Pointer to the layout for input matrix A.
- beta (
Pointer/object) – IN: Pointer to scalar beta. Pointer to either the host or device address.
- B (
Pointer/object) – IN: Pointer to the layout for matrix B. Must be a pointer to the device address.
- Bdesc (
hipblasLtMatrixLayoutOpaque_t/object) – IN: Pointer to the layout for input matrix B.
- C (
Pointer/object) – IN: Pointer to matrix C. Must be a pointer to the device address.
- stream (
Pointer/object) – IN: The HIP stream where all the GPU work will be submitted.
- lightHandle (
- Returns:
A
tupleof size 2 that contains (in that order):hipblasStatus_t: One of:HIPBLAS_STATUS_NOT_INITIALIZED: If the hipBLASLt handle has not been initialized.HIPBLAS_STATUS_INVALID_VALUE: If the parameters are in conflict or in an impossible configuration, for example, when A is not NULL but Adesc is NULL.HIPBLAS_STATUS_NOT_SUPPORTED: If the current implementation on the selected device doesn’t support the configured operation.HIPBLAS_STATUS_ARCH_MISMATCH: If the configured operation cannot be run using the selected device.HIPBLAS_STATUS_EXECUTION_FAILED: If HIP reported an execution error from the device.HIPBLAS_STATUS_SUCCESS: If the operation completed successfully.
hipblasLtMatrixLayoutOpaque_t:Pointer to the layout for output matrix C.
C signature
hipblasStatus_t hipblasLtMatrixTransform(hipblasLtHandle_t lightHandle, hipblasLtMatrixTransformDesc_t transformDesc, const void * alpha, const void * A, hipblasLtMatrixLayout_t Adesc, const void * beta, const void * B, hipblasLtMatrixLayout_t Bdesc, void * C, hipblasLtMatrixLayout_t Cdesc, hipStream_t stream)