CANN/pypto gather_in_l1 API 文档
pypto.experimental.gather_in_l1【免费下载链接】pyptoPyPTO发音: pai p-t-oParallel Tensor/Tile Operation编程范式。项目地址: https://gitcode.com/cann/pypto产品支持情况产品是否支持Ascend 950PR/Ascend 950DT√Atlas A3 训练系列产品/Atlas A3 推理系列产品√Atlas A2 训练系列产品/Atlas A2 推理系列产品√功能说明该接口为定制接口约束较多。不保证稳定性。从GM上的Tensor离散搬运指定行的数据同时每行搬运前size个数据至L1。函数原型gather_in_l1(src: Tensor, indices: Tensor, block_table: Tensor, block_size: int, size: int, is_b_matrix: bool, is_trans: bool) - Tensor参数说明参数名输入/输出说明src输入源操作数。支持的数据类型为DT_FP32, DT_FP16, DT_BF16, DT_INT8。不支持空Tensor支持两维。indices输入源操作数的行偏移。支持的数据类型为DT_INT32, DT_INT64。不支持空Tensor支持两维。Shape形状为[1,n]。block_table输入源操作数。支持的数据类型为DT_INT32。不支持空Tensor支持两维。在实际使用中表示为 Page Attention 中的页表形状为[1,block_table_size]其中block_table_size表示页表的长度。block_size输入源操作数。int 类型。表示 Page Attention 中一个块可以放多少个token。size输入每行搬运的数据数。数据数要小于源操作数的列数。is_b_matrix输入搬运后的结果即输出Tensor是否作为matmul的B矩阵。is_trans输入搬运后的结果即输出Tensor是否转置。返回值说明返回输出Tensor调用示例src pypto.tensor([16, 32], pypto.DT_FP32, tensor_src) offset pypto.tensor([1, 32], pypto.DT_INT32, tensor_offset) out pypto.experimental.gather_in_l1(src , offset, 20, false, false)【免费下载链接】pyptoPyPTO发音: pai p-t-oParallel Tensor/Tile Operation编程范式。项目地址: https://gitcode.com/cann/pypto创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考