已合并
test: 新增 GraphPickler NPU 适配验证与统一运行脚本 #34859
yuhongming-2026创建于 4月30日
test: 新增 GraphPickler NPU 适配验证与统一运行脚本 #34859
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 yuhongming-2026 的贡献)4月30日 创建了 pull request,commit 750e2d2d
4月30日 关联了issue:【开源实习】Torch-NPU API一致性对齐:补齐测试用例、API功能对齐、补齐文档(1)
ascend-robot
4月30日 评论:
4月30日 评论:
ascend-robot
4月30日 评论:
4月30日 评论:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| test | ✅ 李伟, huangjingwei (2/2) | ✅ 李伟 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
yuhongming-2026, thanks for your pull request. All authors of the commits have signed the CLA. 👍


4月30日 添加了label:ascend-cla/yes
此处折叠了79条消息 查看更多
5月8日 添加了label:approvedlgtm
openLiBingCI
5月8日 评论:
5月8日 评论:
本PR中共发现代码检查告警抑制1处,请Committer检视合理性
本评论自动扫描PR中使用的开源代码检查工具(ruff、clang-tidy、CodeQL等)的屏蔽注释。
这些屏蔽注释会阻止开源代码检查工具对特定代码区域的检测,可能导致潜在问题被忽略。
| 文件路径 | 行号 | 屏蔽类型 | 代码片段 | 工具名称 |
|---|---|---|---|---|
| test/fx/test_fx_graph_pickler.py | 39 | 块级屏蔽 | 33: return [(node.op, str(node.target)) for node in graph.nodes] 36: def _extract_graph(loaded_obj: object) -> fx.Graph: 37: if isinstance(loaded_obj, fx.Graph): 38: return loaded_obj 39: return loaded_obj.graph # type: ignore[union-attr] 42: def _build_options(): 43: options_cls = getattr(_graph_pickler, "Options", None) 44: if options_cls is None: 45: return None 47: signature = inspect.signature(options_cls) |
mypy |


ascend-robot
5月8日 评论:
5月8日 评论:
Review Guide
This pull-request passes review.
Committers who wrote a comment of /approve are: 李伟.
Reviewers who wrote a comment of /lgtm are: 李伟, huangjingwei.


5月8日 合入了pull request
【合入来源】
【修改方案】
run_graphpickler_npu_unified.py,用于自动选择可用后端并验证torch.fx._graph_pickler三大 API 在 CPU/NPU 环境中的适配性。GraphPickler.dumps、GraphPickler.loads以及Option/Options配置项,兼容torch.fx._graph_pickler、torch_npu.fx._graph_pickler与graphpickler_npu_adapter三种后端。graphpickler_npu_validation_report.json中三大 API 均通过验证,Option配置测试 7/7 通过,NPU 功能测试通过且输出完全匹配。NPU_ADAPTER_FULL_REPORT.md、NPU_ADAPTER_2100_REPORT.md、ADAPTATION_REPORT.md等验证报告进行整理。【资料变更】
不涉及
【接口变更】
不涉及
【功能验证】
run_graphpickler_npu_unified.py运行结果确认:torch.npu.is_available()返回 true。GraphPickler.dumps、GraphPickler.loads、Option均存在且可调用。graphpickler_npu_validation_report.json、NPU_ADAPTER_FULL_REPORT.md、NPU_ADAPTER_2100_REPORT.md等。【CheckList】