Welcome to ask questions and discuss with other members.
https://gitcode.com/cann/asc-devkit/blob/master/impl/adv_api/detail/matmul/stage/copy_cube_out/copy_cube_out_datacopy_wrapper.h#L405 CopyTrans2GMByVecByLineAlign函数中代码 for (int32_t i = 0; i < baseHeight; ++i) { DataCopy(gm[dstOffset], trans[srcOffset], {1, static_cast<uint16_t>(blockLen), 0, 0}); PipeBarrier<PIPE_MTE3>(); dstOffset += offset; srcOffset += blockOffset; } 为什么要加一句PipeBarrier<PIPE_MTE3>()同步呢?每次拷贝的 gm 地址和 trans 地址都是不同的,没有重复的地址。这里多次 DataCopy 的指令是不存在相互冲突的问题的,为什么也要加PipeBarrier<PIPE_MTE3>()同步呢?
@see55 你好,感谢你的关注,经过验证证明此处代码并没有加同步的必要,相关代码已经修改,如果没有其他问题这边先关闭issue了。
Welcome to ask questions and discuss with other members.
问题描述
https://gitcode.com/cann/asc-devkit/blob/master/impl/adv_api/detail/matmul/stage/copy_cube_out/copy_cube_out_datacopy_wrapper.h#L405
CopyTrans2GMByVecByLineAlign函数中代码
for (int32_t i = 0; i < baseHeight; ++i) {
DataCopy(gm[dstOffset], trans[srcOffset], {1, static_cast<uint16_t>(blockLen), 0, 0});
PipeBarrier<PIPE_MTE3>();
dstOffset += offset;
srcOffset += blockOffset;
}
为什么要加一句PipeBarrier<PIPE_MTE3>()同步呢?每次拷贝的 gm 地址和 trans 地址都是不同的,没有重复的地址。这里多次 DataCopy 的指令是不存在相互冲突的问题的,为什么也要加PipeBarrier<PIPE_MTE3>()同步呢?