Description:
Computes the Sinkhorn distance, which can be used for expert routing in MoE models.
Formula:
Input: cost(R, C): 2D cost matrix tol: tolerance
Initialization:
Repeating:
Until:
Output:
Each operator has calls. First, [object Object] is called to obtain the input parameters and compute the required workspace size based on the process. Then, [object Object] is called to perform computation.
[object Object][object Object]
Parameters:
[object Object](aclTensor*, input): cost tensor,[object Object]in the formula, aclTensor on the device. The data type can be BFLOAT16, FLOAT16, or FLOAT. The value must be in the range [0, 1] and can be normalized. supports ND. The input is a two-dimensional matrix with no more than 10,000 rows and no more than 1024 columns. are supported.[object Object](aclScalar*, input): Sinkhorn tolerance. The data type can be FLOAT. If a null pointer is passed, the value of[object Object]is 0.0001.[object Object](aclTensor*, output): optimal transport tensor,[object Object]in the formula, aclTensor on the device. The data type can be BFLOAT16, FLOAT16, or FLOAT. The can be ND. The shape is 2D. are not supported. The data type and shape are the same as those of the input[object Object].[object Object](uint64_t*, output): size of the workspace to be allocated on the device.[object Object](aclOpExecutor**, output): operator executor, containing the operator computation process.
Returns:
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown:
[object Object]
- Deterministic compute:
[object Object]defaults to a deterministic implementation.
The following example is for reference only. For details, see .
[object Object]