已合并
add t5 config #44026
lihui创建于 13 天前
add t5 config #44026
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 lihui 的贡献)ascend-robot
13 天前 评论:
13 天前 评论:
atomgit-bot
13 天前 评论:
13 天前 评论:
变更摘要
此PR将 aten.native_dropout.default 操作注册为 _EffectType.ORDERED 效果操作的代码,从 torch_npu/_inductor/dvm/decomp.py 模块级别移至 benchmarks/torchbench/npu_support.py 中的 _patch_model_24() 函数(T5模型补丁函数)内,使其由全局无条件注册变为仅在T5 benchmark场景下按需注册,避免了对其他模型的潜在副作用。
主要改动
native_dropout效果注册位置迁移:将_register_effectful_op(torch.ops.aten.native_dropout.default, _EffectType.ORDERED)调用连同其import语句从torch_npu/_inductor/dvm/decomp.py的模块顶层移除,转而添加至benchmarks/torchbench/npu_support.py的_patch_model_24()函数中,使该注册仅在T5模型benchmark补丁阶段生效。- T5模型配置补充:在
_patch_model_24()中新增native_dropout的效果操作注册,确保T5模型在NPU上运行时native_dropout被视为有序副作用操作,与T5ForConditionalGeneration的已有补丁逻辑保持一致。


atomgit-bot
13 天前 评论:
13 天前 评论:
代码审查
审查总结
| 优先级 | 数量 |
|---|---|
| P2 | 1 |
已审查文件:
benchmarks/torchbench/npu_support.py:发现 1 个问题(P2)torch_npu/_inductor/dvm/decomp.py:无独立问题(该文件的变更是移除代码,被移除的代码被移至npu_support.py,其缺失构成了上述 P2 问题的另一面)
整体风险判断:中等风险。该变更将 native_dropout 的 ORDERED effectful 注册从全局 DVM 编译路径(decomp.py 模块顶层)移入了仅对 T5ForConditionalGeneration benchmark 生效的 model patch 中。对于所有其他模型,该注册将丢失,可能导致 Inductor 编译器对 dropout 操作进行不当优化。如果上游 PyTorch 已另行对 native_dropout 做了全局注册,则此变更为安全;否则构成功能回归,建议将注册恢复至全局路径。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 1 |
💬 仅评论


13 天前 添加了label:ascend-cla/yes
此处折叠了47条消息 查看更多
daifu1234567
9 天前 评论:
9 天前 评论:
/lgtm


9 天前 添加了label:lgtm
9 天前 删除了label:ci-pipeline-passed
9 天前 合入了pull request
ascend-robot
9 天前 评论:
9 天前 评论:
流水线 pytorch_gitcode_PR_multiVersion#13848 [ commitID:6a701235 ] 运行失败


【合入来源】
【修改方案】
在npu_support.py里面针对T5网络增加dropout算子保序副作用
【资料变更】
否
【接口变更】
不涉及
【功能验证】
本地验证通过
【CheckList】