已合并
【fix】: modify GraphNode construct func #4256
tang-haojie创建于 15 天前
【fix】: modify GraphNode construct func #4256
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 tang-haojie 的贡献)15 天前 添加了label:enhancement
15 天前 创建了 pull request,commit 1e908021
atomgit-bot
15 天前 评论:
15 天前 评论:
变更摘要
此 PR 修复了 GraphNode 构造函数中因 GetOption 返回空字符串导致 std::stoi("") 抛出异常、进而触发误报警告日志的问题。通过将转换逻辑从 "先转换再捕获异常" 改为 "先检查空值再安全转换",消除了每次构造 GraphNode 时都会产生的 std::invalid_argument 异常和相应的误报警告日志。
主要改动
- 移除
try-catch异常处理块:删除了原有的try { max_num = std::stoi(opt); } catch(...) { ... }结构,避免依赖异常处理来应对空字符串等无效输入。 - 新增空值检查和
ConvertToInt32安全转换:加入了!opt.empty()前置检查,并使用ConvertToInt32(opt, max_num)替代std::stoi,只有在转换成功且值大于 0 时才更新max_load_record_。 max_load_record_赋值改为显式类型转换:将max_load_record_ = max_num改为max_load_record_ = static_cast<uint32_t>(max_num),使int32_t到uint32_t的类型转换更加明确。


atomgit-bot
15 天前 评论:
15 天前 评论:
15 天前 添加了label:cann-cla/yes
CANN-robot
15 天前 评论:
15 天前 评论:
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 |
|---|---|---|
| repo-cann/ge | ✅ 张德鹏, Mexyy, yuht9 (3/2) | ✅ 张德鹏 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
tang-haojie, thanks for your pull request. All authors of the commits have signed the CLA. 👍


15 天前 将yangyongqiang0606,kobemini,tangqunzhang,xchu42,hugo111,lining23666,fu-jun2,depeng1994,wqtshg_wt,peiyang,shengnan666,zhangfan_hanq,zhanj,zhujingjing,Mexyy,wangxiaotian995,stevenaw0,yuht9设为评审人
15 天前 将yangyongqiang0606,kobemini,tangqunzhang,xchu42,hugo111,lining23666,fu-jun2,depeng1994,wqtshg_wt,peiyang,shengnan666,zhangfan_hanq,zhanj,zhujingjing,Mexyy,wangxiaotian995,stevenaw0,yuht9设为评审人
15 天前 将yangyongqiang0606,kobemini,tangqunzhang,xchu42,hugo111,lining23666,fu-jun2,depeng1994,wqtshg_wt,peiyang,shengnan666,zhangfan_hanq,zhanj,zhujingjing,Mexyy,wangxiaotian995,stevenaw0,yuht9设为审查人
15 天前 将yangyongqiang0606,kobemini,tangqunzhang,xchu42,hugo111,lining23666,fu-jun2,depeng1994,wqtshg_wt,peiyang,shengnan666,zhangfan_hanq,zhanj,zhujingjing,Mexyy,wangxiaotian995,stevenaw0,yuht9设为审查人
tang-haojie
15 天前 评论:
15 天前 评论:
compile


Ttang-haojie
15 天前 update merge request[project id: 8824148, iid: 4256, commit_id: 1d9f0a2d5dcf736ee986266a0d273ae2424d108d] virtual merging success
15 天前 update merge request[project id: 8824148, iid: 4256, commit_id: 1d9f0a2d5dcf736ee986266a0d273ae2424d108d] virtual merging success
15 天前 添加了label:ci-pipeline-running
CANN-robot
15 天前 评论:
15 天前 评论:
流水线任务触发成功
任务链接 [ccf7e8ce085845f8af887cb3f56b7d87][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_ARM_compiler | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_executor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_dflow | ✅ SUCCESS | >>>>> | >>>>> |
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> |
[2026-08-04 11:35:23] CI执行结束


CANN-robot
15 天前 评论:
15 天前 评论:
流水线任务触发成功
任务链接 [10ba028bd5794867bcbdc47f1198c001][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_X86_compiler | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_executor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_dflow | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_dflow | ✅ SUCCESS | ||
| UT_Test_ge_common | ✅ SUCCESS | ||
| UT_Test_parser | ✅ SUCCESS | ||
| UT_Test_python | ✅ SUCCESS | >>>>> | |
| UT_Test_rt | ✅ SUCCESS | ||
| UT_Test_acl | ✅ SUCCESS | ||
| UT_Test_autofuse | ✅ SUCCESS | ||
| UT_Test_executor | ✅ SUCCESS | ||
| UT_Test_autofuse_ascendc_api | ✅ SUCCESS | ||
| ST_Test_dflow | ✅ SUCCESS | ||
| ST_Test_ge_common | ✅ SUCCESS | ||
| ST_Test_parser | ✅ SUCCESS | ||
| ST_Test_python | ✅ SUCCESS | >>>>> | |
| ST_Test_rt | ✅ SUCCESS | ||
| ST_Test_autofuse | ✅ SUCCESS | ||
| ST_Test_executor | ✅ SUCCESS | ||
| ST_Test_hetero | ✅ SUCCESS | ||
| ST_Test_autofuse_ascendc_api | ✅ SUCCESS | ||
| ST_Test_autofuse_e2e | ✅ SUCCESS | ||
| UT_Test_fe | ✅ SUCCESS | ||
| UT_Test_tefusion | ✅ SUCCESS | ||
| ST_Test_fe | ✅ SUCCESS | ||
| ST_Test_tefusion | ✅ SUCCESS | ||
| ST_Test_ge_common_atc | ✅ SUCCESS | ||
| UT_Test_Report_graphengine | ✅ SUCCESS | >>>>> | |
| UT_Test_Report_ge_executor_c | ✅ SUCCESS | >>>>> | |
| UT_Test_Report_ge_autofuse | ✅ SUCCESS | >>>>> | |
| ST_Test_Report_graphengine | ✅ SUCCESS | >>>>> | |
| ST_Test_Report_ge_executor_c | ✅ SUCCESS | >>>>> | |
| ST_Test_Report_ge_autofuse | ✅ SUCCESS | >>>>> | |
| UT_Test_Report_fe | ✅ SUCCESS | >>>>> | |
| ST_Test_Report_fe | ✅ SUCCESS | >>>>> |
[2026-08-04 11:42:31] CI执行结束


CANN-robot
15 天前 评论:
15 天前 评论:
流水线任务触发成功
任务链接 [5289c4db764946ec8a44e024dda55616][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck_Pr | ✅ SUCCESS | ||
| antipoison | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| codecheck_dt | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS |
[2026-08-04 11:33:25] CI执行结束


15 天前 添加了label:api-check-pass
此处折叠了9条事件消息 查看更多
15 天前 添加了label:ci-pipeline-passed
15 天前 添加了label:lgtm
14 天前 添加了label:approved
14 天前 合入了pull request
Pull Request
描述
GetOption 未设置该 option 时,opt 为空字符串 ""。std::stoi("") 会抛出 std::invalid_argument 异常,被 catch(...) 捕获并打警告日志。虽然不崩溃,但每次构造 GraphNode 时都会触发一次异常,属于日志层面大量打印警告的问题。空 option 时也走了 catch 分支打印 "Option %s param failed:" 警告,属于误报。
变更类型
请选择本次引入的变更类型:
关联的Issue
如何测试
描述测试此变更的步骤和前提条件:
1.
2.
核对清单
feat:,fix:)其他信息
在此添加任何其他关于本次 PR 的说明。