已关闭
Reduce no-op copy writes beyond the tensor extent #24
KaranocaVe创建于 9月30日关闭于 14 天前
29 天前 修改标题为 “Reduce no-op copy writes beyond the tensor extent”,原标题为“[Bug-Report|缺陷反馈]: Reduce no-op copy writes beyond the tensor extent”
29 天前 修改标题为 “Reduce no-op copy writes beyond the tensor extent”,原标题为“[Bug-Report|缺陷反馈]: Reduce no-op copy writes beyond the tensor extent”
29 天前 修改了issue 的描述
29 天前 关联了pull request:Fix Reduce no-op copy tail length
29 天前 修改了issue 的描述
14 天前 添加了label:resolved
KaranocaVe
8 天前 评论:
8 天前 评论:
@wulinyu 您好,这个 Issue 对应的修复已经合入:https://gitcode.com/cann/atvc/merge_requests/53
开发者计划反馈,Issue 需要有 Accepted 标签才能计入积分,仅关闭或标记 resolved 还不够。目前这条 Issue 尚未标记 Accepted,麻烦您结合问题和已合入的修复复核一下;确认符合受理条件后,帮忙补上 Accepted 标签。
感谢您的支持!


Reduce no-op copy writes beyond the tensor extent
Behavior
At
cann/atvcsource commitc1c9b60146aea55d71f039042dbe8d09c07b7428,CalcReduceTilingaccepts shape{1}with an empty reduction-axis list andselects the no-reduction
REDUCE_POLICY0. For a one-element float input, theidentity-copy path should write only the one valid output element. Instead, it
overwrites the next seven floats past the declared output extent with following
input values.
Cause
ReduceOpTemplate::CopyInput2Output()rounds the element count up to a 32-byteboundary before copying. Its final tile then uses element-count
DataCopyoperations, so a one-float tensor is copied as eight floats. This affects valid
small no-reduction tensors; an 8-float aligned tensor is copied correctly.
Fix
Keep the logical element count exact and use byte-length
DataCopyPadfor thefinal input and output transfers. Add a host tiling assertion for the empty-axis
no-reduction case and simulator regressions for the one-float extent and the
8-float aligned control.
Scope
The baseline failure and fixed regression were reproduced in the 910B
TikicpuLib CPU simulator. No physical NPU execution was performed.
Validation
Validation
At source commit
c1c9b60146aea55d71f039042dbe8d09c07b7428, the 910B TikicpuLibsimulator reproduced an out-of-extent write for a one-float no-reduction copy:
the seven output guard values after the valid element were overwritten. The
8-element aligned control passed.
After the fix, the one-element and aligned copy regressions passed (2/2), the
host tiling regression selected
REDUCE_POLICY0with one output element, andthe full ATVC unit suite passed (13/13). The patch keeps the logical element
count exact and uses byte-length
DataCopyPadfor the final tile.No physical NPU execution was performed. The simulator coverage is limited to
the tested float copy cases; other data types, platforms, and performance were
not evaluated.
关联 PR: https://gitcode.com/cann/atvc/merge_requests/53