已开启
docs: Add torch.onnx.ONNXProgram.optimize to native_api documentation #43671
木路折创建于 8月4日
docs: Add torch.onnx.ONNXProgram.optimize to native_api documentation #43671
已开启
合并受阻
8月4日 关联了issue:【社区任务】7月社区任务第四期-Ascend for PyTorch API 一致性开发(11)
atomgit-bot
8月4日 评论:
8月4日 评论:
变更摘要
本次 PR 为 torch.onnx.ONNXProgram.optimize 在四份 PyTorch 版本对应的 native_api 文档中补齐了支持情况说明。ONNXProgram.optimize() 是 ONNXProgram 类的公开方法,用于通过常量折叠和冗余消除优化 ONNX IR 图,此前各版本文档中该类仅收录了 model_proto() 与 save() 方法,optimize() 缺失。此次变更仅涉及文档更新,未修改任何业务代码。
主要改动
- 在多版本文档中新增
optimize()支持情况:在docs/zh/api/native_api/pytorch_2-7-1/torch-onnx.md、pytorch_2-11-0/torch-onnx.md、pytorch_2-12-0/torch-onnx.md、pytorch_2-13-0/torch-onnx.md四个文件中的ONNXProgram.save()条目之后,统一插入torch.onnx.ONNXProgram.optimize的支持情况描述,标注为"支持,暂不支持 Ascend 950DT"。 - 统一四个版本目录的文档结构:以相同的描述内容和插入位置在 PyTorch 2.7.1、2.11.0、2.12.0、2.13.0 四个版本目录下完成一致性更新,共新增 64 行文档内容。


ascend-robot
8月4日 评论:
8月4日 评论:
atomgit-bot
8月4日 评论:
8月4日 评论:
此处折叠了179条消息 查看更多
6 天前 删除了label:docs-ci-pipeline-running
6 天前 添加了label:docs-ci-pipeline-success
6 天前 删除了label:ci-pipeline-running
6 天前 添加了label:ci-pipeline-passed
AtlasAccount
6 天前 评论:
6 天前 评论:
流水线 PR-pipeline_pytorch#64881 [ commitID:f884ede3 ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | 🛑 | >>> |
| Build_ARM | 🛑 | >>> | |
| Build_X86_torchair | 🛑 | >>> | |
| Build_ARM_torchair | 🛑 | >>> | |
| patch_test | 🛑 | >>> | |
| Build_X86_213 | 🛑 | >>> | |
| Build_ARM_213 | 🛑 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | codecheck_pre-commit | ✅ | >>> |
| check_error | ✅ | >>> | |
| lintrunner | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_ARM_A3_Part_01 | 🛑 | >>> |
| UT_ARM_A3_Part_02 | 🛑 | >>> | |
| UT_ARM_A2_Part_01 | 🛑 | >>> | |
| UT_ARM_A2_Part_02 | 🛑 | >>> | |
| UT_ARM_A2_Part_03 | 🛑 | >>> | |
| UT_inductor_Part_01 | 🛑 | >>> | |
| UT_inductor_Part_02 | 🛑 | >>> | |
| UT_inductor_Part_03 | 🛑 | >>> | |
| UT_inductor_Part_04 | 🛑 | >>> | |
| UT_DIST_ARM_Part_01 | 🛑 | >>> | |
| UT_DIST_ARM_Part_02 | 🛑 | >>> | |
| UT_DIST_ARM_Part_03 | 🛑 | >>> | |
| UT_DIST_ARM_Part_04 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_01 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_02 | 🛑 | >>> | |
| UT_ARM_A2_Part_213 | 🛑 | >>> | |
| UT_inductor_Part_213 | 🛑 | >>> | |
| UT_DIST_ARM_Part_213 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_213 | 🛑 | >>> | |
| 流水线 | PR-pipeline_pytorch | ✅ | >>> |
- compile、compile_inductor、compile_torchair : 运行流水线
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


【合入来源】
关联 issue: https://gitcode.com/Ascend/pytorch/issues/3490
【修改方案】
在 master 资料中为公开 API
torch.onnx.ONNXProgram.optimize补齐支持情况。已覆盖 2-7-1/2-11-0/2-12-0/2-13-0 四个版本目录,2-9-0/2-10-0 已删除不涉及,符号按最新格式使用 ✔/✘”修改文件:
【资料变更】
资料检查结果:此前 master 下各版本的
torch-onnx.md未收录ONNXProgram.optimize(),而
ONNXProgram类本身及model_proto()、save()方法均已收录。optimize()为非计算类 API,实际已支持,故需要补充。本次在以下版本目录的 torch-onnx.md 中新增支持情况:
【接口变更】
【功能介绍】
torch.onnx.ONNXProgram.optimize()是 ONNXProgram 类的公开方法,用于优化 ONNX 模型。该方法通过常量折叠和冗余消除优化 ONNX IR 图,原地生效,返回值为 None。
为非计算类 API,与数据类型和设备无关。
【功能验证】
接口测试由以下 PR 覆盖:
【CheckList】