Skip to content

LoadDataUnzip

产品支持情况

  • Ascend 950PR/Ascend 950DT:不支持
  • Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持
  • Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持
  • Atlas 200I/500 A2 推理产品:不支持
  • Atlas 推理系列产品AI Core:支持
  • Atlas 推理系列产品Vector Core:不支持
  • Atlas 训练系列产品:不支持

功能说明

将GM上的数据解压并搬运到L1 Buffer(A1/B1)或L0B Buffer(B2)上。执行该API前需要执行LoadUnzipIndex加载压缩索引表。

函数原型

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

参数说明

表1 参数说明

参数名称输入/输出含义
dst输出目的操作数,类型为LocalTensor,支持的TPosition为A1/B1/B2。
LocalTensor的起始地址需要保证:
  • TPosition为A1/B1时,32字节对齐。
  • TPosition为B2时,512B对齐。
src输入源操作数,类型为GlobalTensor。数据类型需要与dst保持一致。

数据类型

支持的数据类型为:int8_t。

返回值说明

约束说明

调用示例

该调用示例支持的运行平台为Atlas 推理系列产品AI Core。

C++
uint32_t srcLen = 896, dstLen = 1024, numOfIndexTabEntry = 1;
AscendC::LocalTensor<int8_t> weightB1 = inQueueB1.AllocTensor<int8_t>();
AscendC::LoadUnzipIndex(indexGlobal, numOfIndexTabEntry); // 加载索引数据,加载GM上的压缩索引表到内部寄存器
AscendC::LoadDataUnzip(weightB1, weGlobal); // 根据内部寄存器里的索引表加载数据

免责声明:本站内容由 asc-devkit 仓 master 分支自动编译生成,属于持续开发版本,可能存在缺陷,仅供预览与参考。如需稳定及商用资料,请查阅官方 昇腾社区