Pull Request has been successfully merged by CANN-robot.
(Thank you for 陈展熹's contribution.)变更摘要
本 PR 修复 InplaceApplyFtrl 的 arch35 GEIR 示例在单卡 NPU 环境下初始化失败的问题。两个示例(静态形状与动态形状)在未设置 GE_DEVICE_ID 环境变量或其值为空时,原先默认使用设备 7,在只有一张可见 NPU 的环境中该设备编号不存在,导致 GE 初始化失败。现将默认设备号统一改为 0,同时保留显式指定 GE_DEVICE_ID 时使用调用者所给设备的行为。
主要改动
- 静态形状示例默认设备号:
optim/inplace_apply_ftrl/examples/arch35/test_geir_inplace_apply_ftrl.cpp中devId的兜底值由"7"改为"0",使未配置环境变量时填充到ge.exec.deviceId的设备号为 0。 - 动态形状示例默认设备号:
optim/inplace_apply_ftrl/examples/arch35/test_geir_inplace_apply_ftrl_dynamic.cpp中devId的兜底值同样由"7"改为"0",与静态示例保持一致。 - 环境变量优先级不变: 两处判断仍为
(envDev && *envDev) ? std::string(envDev) : ...,即GE_DEVICE_ID非空时依旧使用调用者指定的设备号,仅调整默认回退取值。
🧩 本次 Review 已使用自定义 Skill:




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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| optim | ✅ 钱泽洪, 上官秦南 (2/2) | ✅ 钱泽洪 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
yourealize, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/lgtm


/lgtm
/approve


您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!
@yangyang016 @su-yueming @chaotang233 @east_yang @yu-xinjie62 @chenfeng61 @pingchuantang


描述
InplaceApplyFtrl 的 arch35 静态、动态 GEIR 示例在未设置
GE_DEVICE_ID(或值为空)时默认选择设备 7。在只有一张可见 NPU 的环境中,这会因设备编号不存在而导致 GE 初始化失败。将两个示例的默认设备号统一改为 0。设置非空
GE_DEVICE_ID时继续使用调用者指定的设备。关联的Issue
关联 Issue:#8754 — InplaceApplyFtrl arch35 示例默认设备 7 导致单卡环境无法运行。
测试
git diff --check通过。文档更新
无。
类型标签
AI/Agent生成声明