LoadDataUnzip

Applicability

Product

Supported

Atlas 350 Accelerator Card

x

Atlas A3 training product/Atlas A3 inference product

x

Atlas A2 training product/Atlas A2 inference product

x

Atlas 200I/500 A2 inference product

x

Atlas inference product AI Core

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Decompress the data on the GM and load the data to A1, B1, and B2. LoadUnzipIndex needs to be executed to load the compression index table before this API is called.

Prototype

1
2
template <typename T>
__aicore__ inline void LoadDataUnzip(const LocalTensor<T>& dst, const GlobalTensor<T>& src)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

dst

Output

Destination operand. Type: LocalTensor. Supported TPosition: A1/B1/B2.

When TPosition is A1/B1, the start address of LocalTensor must be 32-byte aligned. When TPosition is B2, the start address of LocalTensor must be 512-byte aligned.

The supported data type is int8_t.

src

Input

Source operand of the GlobalTensor type. Its data type must be the same as that of dst.

Restrictions

Returns

None

Examples

This example is supported on the Atlas inference product AI Core.

1
2
3
4
uint32_t srcLen = 896, dstLen = 1024, numOfIndexTabEntry = 1;
AscendC::LocalTensor<int8_t> weightB1 = inQueueB1.AllocTensor<int8_t>();
AscendC::LoadUnzipIndex(indexGlobal, numOfIndexTabEntry); // Load index data and transfer the compressed index table stored in GM into internal registers.
AscendC::LoadDataUnzip(weightB1, weGlobal); // Load data based on the index table in internal registers.