已关闭
Reduce no-op copy writes beyond the tensor extent #24
KaranocaVe创建于  9月30日关闭于  14 天前
KaranocaVe
KaranocaVe
9月30日 创建

Reduce no-op copy writes beyond the tensor extent

Behavior

At cann/atvc source commit c1c9b60146aea55d71f039042dbe8d09c07b7428,
CalcReduceTiling accepts shape {1} with an empty reduction-axis list and
selects the no-reduction REDUCE_POLICY0. For a one-element float input, the
identity-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-byte
boundary before copying. Its final tile then uses element-count DataCopy
operations, 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 DataCopyPad for the
final 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 TikicpuLib
simulator 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_POLICY0 with one output element, and
the full ATVC unit suite passed (13/13). The patch keeps the logical element
count exact and uses byte-length DataCopyPad for 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

likedislike
KaranocaVeKaranocaVe
29 天前 修改标题为 “Reduce no-op copy writes beyond the tensor extent”,原标题为“[Bug-Report|缺陷反馈]: Reduce no-op copy writes beyond the tensor extent”
KaranocaVeKaranocaVe
29 天前 修改了issue 的描述
KaranocaVeKaranocaVe
29 天前 关联了pull request:Fix Reduce no-op copy tail length
KaranocaVeKaranocaVe
29 天前 修改了issue 的描述
Wwulinyu成员
22 天前 将 KaranocaVe 设为负责人
Wwulinyu成员
22 天前 issue类型由 任务 改变为 需求
wulinyu成员
17 天前 评论:

感谢您提出的建议,也看到当前您提交了对应的修复PR,已经安排committer在审核PR修改。

likedislike
wulinyu成员
14 天前 评论:

本issue关联的PR代码已经合入,问题已经解决,issue即将关闭。

likedislike
Wwulinyu成员
14 天前 issue状态由 待办的 改变为 开发中
Wwulinyu成员
14 天前 issue状态由 开发中 改变为 已解决
Wwulinyu成员
14 天前 关闭了 issue
CANN-robotCANN-robot成员
14 天前 添加了label:resolved
KaranocaVe
KaranocaVe
8 天前 评论:

@wulinyu 您好,这个 Issue 对应的修复已经合入:https://gitcode.com/cann/atvc/merge_requests/53

开发者计划反馈,Issue 需要有 Accepted 标签才能计入积分,仅关闭或标记 resolved 还不够。目前这条 Issue 尚未标记 Accepted,麻烦您结合问题和已合入的修复复核一下;确认符合受理条件后,帮忙补上 Accepted 标签。

感谢您的支持!

likedislike