Closed
[v2.10.0][Bug] FlexAttention max-autotune may lose mutation outputs in multi-template selection #4722
stonexxxAdd on Sep 9Closed at 8 days ago
Sep 9 Added label: triage-review
TorchNPU-Bot
Sep 9 Comments:
Sep 9 Comments:
issue待分派,添加triage-review标签


Sep 9 Associated pull request
Sep 9 Added label: bot-triaged; Removed label: triage-review
TorchNPU-Bot
Sep 9 Comments:
Sep 9 Comments:
检测到当前 issue 已关联 PR,自动添加标签:bot-triaged


Sep 10 Associated pull request
Sep 10 Deleted associated pull request: [2.9.0]profiler support display addtional headers && fix log
Sep 10 Deleted associated pull request: [2.9.0]profiler support display addtional headers && fix log
10 days ago Added label: module: graph-mode
chenrayray
8 days ago Comments:
8 days ago Comments:
这条开发自提 issue 提出已超过一个月,先关闭。如仍需跟进,请重新打开。


8 days ago Close issue
8 days ago changed custom state from TODO to DONE
8 days ago Added label: resolved
问题描述
v2.10.0 的 AlgorithmSelector 包含与 master 相同的 deferred multi-template 选择逻辑。FlexAttention backward 候选可能通过
mutated_inputs写出中间结果,但当前判定不会阻止其被包装为MultiTemplateBuffer。MultiTemplateBuffer不保留模板 mutation 输出,因此该路径存在 backward mutation 结果丢失及梯度错误风险。复现范围
TORCHINDUCTOR_MAX_AUTOTUNE=1testcase_score_mask_combos_npu.py::test_score_mod_mask_mod_combo[identity-x-noop]根因
AlgorithmSelector 的 deferred multi-template 判定没有检查候选的
mutated_inputs。预期结果
带
mutated_inputs的候选应禁用 deferred multi-template,并按普通 template buffer 完成选择;无 mutation 候选行为保持不变。当前验证限制
当前 v2.10.0 环境在进入 mutation 精度断言前,被该分支已有的 autotune 配置代码生成问题阻塞:未加引号的
no触发NameError,所有候选失效后抛出NoValidChoicesError。应用本修改前后均保持该失败形态,因此不声明端到端通过。