已开启
[Bug] triton_experimental reduction index alias and linearized store instability #4748
rmch创建于  4 天前
rmch成员
4 天前 创建

在提交新问题之前,请确保您已经在社区中搜索过相关问题,并使用了社区中提供的资源/工具后,仍未找到满意的解决方式。

⚠️ 安全信息提醒:请仔细检查提供的文本内容,确保其不包含敏感数据信息,包括但不限于:

  • API 令牌或密钥
  • 密码或身份验证凭证
  • 私有网址或接口地址
  • 个人或机密数据
  • ...

在分享配置信息或代码示例时,请将敏感信息脱敏处理,或使用 <TOKEN> 等占位符替代原有内容。

环境信息

A2/A3/A5

🐛 问题描述

背景

triton_experimental 在线性化调度和 reduction 代码生成中存在一组相互关联的问题,影响 DALLE2/group-norm、BigBird 和非连续 store 场景的稳定性。

问题范围

  1. 多阶段 reduction 的 range-tree alias 可能跨 reduction pass 泄漏,导致后续 pass 使用未定义或错误作用域的索引。
  2. 相同迭代空间的冗余 divisor-chain 分解会被当作独立轴,破坏连续访问;跨 tree 复合表达式也不能作为非法赋值左值。
  3. linearize 将逻辑轴拆成多个寄存器轴后,singleton constant 的 rank 与 store pointer block rank 不一致,可能触发 Triton-Ascend store codegen 错误。

处理目标

  • alias 表达式保留在结构化 reduction IR 中,并按 reduction loop pass 绑定作用域、校验依赖和抑制已替换 assignment。
  • 只折叠有明确 range-tree 边界关系的冗余分解,保留连续地址语义。
  • linearized store 的 shaped constant 与最终寄存器 rank 保持一致。
  • 测试目录统一放在 test/_inductor/triton_experimental/,测试名称与实际语义一致。

关联变更

验收标准

  • reduction index alias 定向 NPU 用例通过。
  • range-tree decomposition 和 linearized shaped constant 定向 NPU 用例通过。
  • lintrunner、py_compilegit diff --check 通过。
  • PR 46133 合入后关闭本 issue。

欢迎加入社区,感谢您对社区的贡献 🎉!

likedislike
Rrmch成员
4 天前 添加了label:bug
TorchNPU-BotTorchNPU-Bot成员
4 天前 添加了label:triage-review
TorchNPU-Bot
TorchNPU-Bot成员
4 天前 评论:

issue待分派,添加triage-review标签

likedislike
TorchNPU-BotTorchNPU-Bot成员
4 天前 添加了label:bot-triaged;删除了label:triage-review
TorchNPU-Bot
TorchNPU-Bot成员
4 天前 评论:

检测到当前 issue 已关联 PR,自动添加标签:bot-triaged

likedislike