已合并
update MIN_SUPPORTED to 2.13 #45447
huangyunlong创建于 7 天前
update MIN_SUPPORTED to 2.13 #45447
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 huangyunlong 的贡献)7 天前 创建了 pull request,commit 8190fcf1
atomgit-bot
7 天前 评论:
7 天前 评论:
变更摘要
本 PR 将 torch_npu 的最低支持 PyTorch 版本从 2.10 提升到 2.13(torch_npu/_compat/version.py 中 MIN_SUPPORTED_VERSION 由 (2, 10) 更新为 (2, 13),torch_npu/csrc/_compat/version.h 中 TORCH_NPU_MIN_SUPPORTED_MINOR 同步由 10 改为 13),并据此清理了所有针对旧版本的兼容分支与兼容包装函数,改为直接使用 PyTorch 2.13 及以上的新接口。
主要改动
- 删除旧版本兼容模块:删除了
torch_npu/_compat/inductor.py(含get_sizevars_backed_var_to_val、gen_common_triton_imports两个兼容包装)和torch_npu/_compat/utils.py(含make_config_entry包装),调用方全部改为直接使用上游接口。 - 直接使用
sizevars.backed_var_to_val:catlass_utils.py、gemm_template.py、kernel_analysis.py、split_tiling.py、triton.py中的索引/形状表达式替换由get_sizevars_backed_var_to_val(V.graph.sizevars)改为直接调用V.graph.sizevars.backed_var_to_val。 - 精简 distributed 兼容导入:
torch_npu/_compat/distributed.py移除了基于CURRENT_VERSION的版本分支及register_prop_rule导出,仅保留从torch.distributed.tensor._ops.utils直接导入register_op_strategy。 - 移除 autograd 节点指针类型分支:
torch_npu/csrc/_compat/autograd.h删除了 2.13 以下的std::shared_ptr分支,GradFnPtr统一使用c10::intrusive_ptr,make_grad_fn统一走c10::make_intrusive;reducer.hpp中相应的兼容注释一并移除。 - 直接构造
_ConfigEntry:torch_npu/utils/_dynamo.py不再经make_config_entry包装,直接在apply_options补全npu_backend、enable_shape_handling、shape_handling_configs、shape_handling_dict配置时以name=参数构造_ConfigEntry。


AtlasAccount
7 天前 评论:
7 天前 评论:
atomgit-bot
7 天前 评论:
7 天前 评论:
7 天前 添加了label:ascend-cla/yes
此处折叠了61条消息 查看更多
梁松伟
2 天前 评论:
2 天前 评论:
/lgtm


2 天前 添加了label:lgtm
2 天前 合入了pull request
ascend-robot
2 天前 评论:
2 天前 评论:
Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


AtlasAccount
2 天前 评论:
2 天前 评论:
流水线 pytorch_gitcode_PR_multiVersion#14816 [ commitID:9e14dca9 ] 已完成


【合入来源】
【修改方案】
master分支最小支持的torch版本升级到2.13,对应更新python和c++侧_compat目录中对2.12及以下版本的兼容,同步更新对应使用的地方
【资料变更】
【接口变更】
【功能验证】
【CheckList】