[object Object]

[object Object][object Object]undefined
[object Object]
  • Function: During the l@r matrix multiplication, the msModelSlim tool can be used to losslessly compress the r matrix to reduce the memory usage of the r matrix. Then, this API is called to perform lossless decompression, matrix multiplication, and dequantization.
  • Formula:x2_unzip=unzip(x2,compressIndex,compressInfo)result=(x1@x2_unzip+bias)deqScalex2\_unzip = unzip(x2, compressIndex, compressInfo)\\ result=(x1 @ x2\_unzip + bias)*deqScale [object Object] indicates the one-dimensional data of the r matrix after being compressed by the msModelSlim tool. [object Object] and [object Object] indicate the information related to the compression algorithm. [object Object] is the data after lossless decompression in this API (consistent with the original r matrix data). For details about the compression and calling example of this API, see .
[object Object]

Each operator has calls. First, [object Object] is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, [object Object] is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters

    [object Object]
  • Return Value

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter verification. The following errors may be thrown.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Return Value

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic computation
    • [object Object] defaults to deterministic implementation.
[object Object]
  • Prepare data before compression.

    Assume that the input data is generated using the [object Object] script. The following is an example for reference only:

    [object Object]

    Execute gen_data.py. Assume that the input shapes of mat1 and mat2 are m=512, k=1024, and n=1024.

    [object Object]
  • Preprocess the data.

    • Use the msModelSlim compression tool to generate the compressed x2, compressIndex, and compressInfo from the original weights.

      When using the following APIs, you need to compile the msModelSlim tool in the CANN package. For details, see [object Object] in the [object Object] directory in the .

      [object Object]
    • Convert the dequantization parameter deqscale of the original float type to obtain the uint64 data required by the aclnn API.

      The original deqScale is of the float type. It is read as int32 and converted to int64.

      [object Object]
  • Call the aclnn API for computation.

    The following example is for reference only. For details, see .

[object Object]