已关闭
[Bug] DVM Spec fallback 未使用 load 导致 clone 索引错位和段错误 #4124
SorryNaCN创建于 15 天前关闭于 13 天前
15 天前 添加了label:bug
15 天前 关联了看板:FrameworkPTAdapter 版本issue看板
15 天前 添加了label:triage-review
15 天前 添加了label:bot-triaged;删除了label:triage-review
TorchNPU-Bot
15 天前 评论:
15 天前 评论:
检测到当前 issue 已关联 PR,自动添加标签:bot-triaged


13 天前 关闭了 issue
13 天前 添加了label:resolved
问题描述
TorchBench
pytorch_stargan使用 DVM 后端时,融合核dvm_fused_copy__mean_0在 codegen 阶段触发段错误。该融合核包含copy_ + reshape + reduce/mean。根因
DVM
SpecVector::FallCodeGen()在 Spec fallback 中跳过未被后续计算消费的 load,但原实现仍通过push_back保存后续 clone,导致clones_槽位与原始NDObject::index_不再对应。后续 Reduce clone 按原始 index 取值时会读取非法指针并触发 SIGSEGV。修改方案
load + 未使用 load + reshape + reduce + spec_next + div + store回归用例;r2.10prebuild;v2.7.1、v2.9.0、v2.10.0、v2.11.0、v2.12.0和master的 DVM gitlink 更新到r2.10@6e86795f3ce6832c72e7558454d7bb0864d2688e。上游修改
验证结果
Tester.codegen()触发 SIGSEGV,pytest 退出码为 139;test_spec_vector.py + test_clone.py共 40 passed;make PRE_ASCEND=1 -j8构建通过;test_spec_fall_clone_after_unused_load结果为 1 passed。