已关闭
【26.2.0众测】Guard Filter 要求 PyTorch≥2.9.0,但《软件安装》配套表把 2.7.1 列为 TorchNPU 26.1.0 的配套版本 #4777
fpwdh创建于 9月14日关闭于 14 天前
9月14日 添加了label:triage-review
TorchNPU-Bot
9月14日 评论:
9月14日 评论:
issue待分派,添加triage-review标签


9月14日 关联了pull request:【TorchNPU 26.1.0 众测】fpwdh 交付材料:安装验证 + 快速入门 + torch.compile 13 示例
9月14日 添加了label:bot-triaged;删除了label:triage-review
TorchNPU-Bot
9月14日 评论:
9月14日 评论:
检测到当前 issue 已关联 PR,自动添加标签:bot-triaged


14 天前 关闭了 issue
14 天前 issue状态由 TODO 改变为 DONE
14 天前 添加了label:help-wanted
TorchNPU-Bot
14 天前 评论:
14 天前 评论:
检测到社区任务相关 issue,自动添加标签:help-wanted


14 天前 添加了label:resolved
问题描述(文档一致性 / 新手易踩)
《Guard Filter》文档在“约束说明”中写明:
而《软件安装》的“方式一:离线安装(Whl)”表格中,TorchNPU 26.1.0 同时列出了 5 个 PyTorch 配套版本
(2.7.1 / 2.9.0 / 2.10.0 / 2.11.0 / 2.12.0),其中 2.7.1 排在表格前部、也是最常见的“默认”选择,
安装表格本身没有任何提示说明“Guard Filter 需要 ≥2.9.0”。
复现步骤
torch 2.7.1 + torch_npu 2.7.1.post10(TorchNPU 26.1.0 的 2.7.1 配套包)。import torch, torch_npu def filter_dict_guards(entries): return [entry.guard_type not in {"DICT_VERSION"} for entry in entries] model = MyModel().npu() compiled = torch.compile(model, options={"guard_filter_fn": filter_dict_guards})(错误来自
torch/__init__.py的_TorchCompileInductorWrapper.apply_options,说明该 PyTorch 版本根本不认识这个选项。)期望结果
文档能明确告知:使用 Guard Filter 必须选择 PyTorch ≥ 2.9.0 的配套行,最好不要和 2.7.1 的安装说明
平铺在同一张表里而不加任何提示(新手很难从“约束说明”里把这个前置条件与安装步骤关联起来)。
影响
众测任务书 5.2 明确要求完成 6 个 Guard Filter 示例,而按文档默认路径安装后这 6 个示例全部无法开工,
需要先自行推断并重装 2.9.0 配套版本,体验割裂。
建议
“如需使用 Guard Filter(guard_filter_fn),必须选择 PyTorch ≥ 2.9.0 的配套行”。
(本反馈来自 TorchNPU 26.1.0 众测,材料见 pytorch-ecosystem 仓
01_tasks/2026/torch_npu_public_beta/fpwdh/)