Closed
[mainline/master] SIMT 编译路径不应固定注入 simt_stack_limit #5045
stonexxxAdd on  Sep 23Closed at  Sep 29
stonexxx
stonexxxCollaborators
Sep 23 Create

问题描述

mainline/master 分支的 NPU Inductor 在纯 SIMT 编译模式下,会在 TTIR 生成和配置预编译两条路径中固定注入 simt_stack_limit=8192。这会覆盖 Triton 编译器或后端对栈大小的默认管理。

本问题由 v2.10.0 修复 PR https://gitcode.com/Ascend/pytorch/merge_requests/46494 同步发现。

影响范围

  • 分支:mainline/master
  • 组件:torch_npu._inductor
  • 路径:NPUCachingAutotuner._make_ttir_module_from_cfg、NPUCachingAutotuner._precompile_config
  • 场景:SIMT_ONLY 编译模式

根因

torch_npu/_inductor/config.py 定义了固定的 simt_default_warp_stacksize = 256 * 32,两条编译路径在纯 SIMT 模式下无条件将其写入 Triton 编译选项。

期望行为

torch_npu 不再固定设置 simt_stack_limit,由 Triton 编译器或后端使用其默认策略管理栈大小。

修改与验证

  • 删除固定栈大小配置。
  • 删除 TTIR 生成和配置预编译路径中的自动注入逻辑。
  • python3 -m py_compile torch_npu/_inductor/config.py torch_npu/_inductor/runtime/triton_heuristics.py:通过。
  • git diff --check mainline/master...HEAD:通过。
  • 迁移提交与源提交的稳定 patch-id 均为 495e5401e7d86ac029a774bf2a108054f2db9d5e。
  • NPU 功能验证与 CI 结果以 PR 流水线为准。
likedislike
TorchNPU-BotTorchNPU-BotCollaborators
Sep 23 Added label: triage-reviewmodule: graph-mode
TorchNPU-Bot
TorchNPU-BotCollaborators
Sep 23 Comments:

问题涉及 NPU Inductor 编译路径(SIMT 模式)中固定注入 simt_stack_limit 的逻辑,属图编译/图模式问题
添加分类标签:module: graph-mode。
当前分类由社区bot提供,如分类有误请在评论中回复。

likedislike
stonexxxstonexxxCollaborators
Sep 23 Associated pull request
TorchNPU-BotTorchNPU-BotCollaborators
Sep 23 Added label: bot-triaged; Removed label: triage-review
TorchNPU-Bot
TorchNPU-BotCollaborators
Sep 23 Comments:

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

likedislike
chenrayraychenrayrayCollaborators
Sep 24 Associated milestone: v26.2.0
chenrayray
chenrayrayCollaborators
Sep 29 Comments:

因为本单相关实施 PR 已全部结束(1 个已合入、0 个已关闭),按照本轮 issue 整理规则,先关闭此单。

核对的 PR:

如仍有问题或需要继续推进,请重新打开,并补充当前 PyTorch / TorchNPU / CANN 版本、硬件环境、复现步骤及相关日志;需求类请补充尚未完成的具体内容。

likedislike
chenrayraychenrayrayCollaborators
Sep 29 Close issue
chenrayraychenrayrayCollaborators
Sep 29 changed custom state from TODO to DONE
ascend-robotascend-robotCollaborators
Sep 29 Added label: resolved