已合并
docs: example样例README补充运行所需Python依赖包清单与缺失排查指引 #655
yelongjian创建于 10 天前
docs: example样例README补充运行所需Python依赖包清单与缺失排查指引 #655
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 yelongjian 的贡献)10 天前 创建了 pull request,commit ab421bb3
atomgit-bot
10 天前 评论:
10 天前 评论:
变更摘要
本 PR 为 example/README.md 与 example/README_en.md 补充运行样例所需的 Python 依赖声明。针对裸环境(非 CANN 官方镜像)中因缺少 numpy、decorator、sympy、scipy、attrs、psutil 等包导致样例以退出码 255 静默失败的问题,在「前提条件」中给出显式 pip3 install 命令与失败现象描述,并在「结果判定与排查」中增加对应排查指引,中英文文档保持同步。
主要改动
- 补充 Python 依赖安装清单:前提条件条目新增
pip3 install numpy decorator sympy scipy attrs psutil命令,明确 GE 运行期加载算子编译组件时会逐层import这些包,并说明官方 CANN 容器镜像已默认具备、可跳过此步骤。 - 描述依赖缺失的失败现象:说明自主搭建的裸环境通常缺少上述依赖,缺失时样例运行失败表现为退出码
255、stdout 无明显报错、plog 日志出现No module named 'xxx'。 - 完善运行失败排查步骤:在「结果判定与排查」第 3 步补充判断规则——plog 中出现
No module named 'xxx'即判定为 Python 依赖缺失,需按「前提条件」安装对应包后重试。 - 中英文文档同步更新:
example/README_en.md以对应的英文表述同步新增依赖安装命令、失败现象与排查指引,保证两份 README 内容一致。


不准确?
atomgit-bot
10 天前 评论:
10 天前 评论:
10 天前 添加了label:cann-cla/yes
CANN-robot
10 天前 评论:
10 天前 评论:
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 |
|---|---|---|
| repo-cann/metadef | ✅ yangyongqiang0606, kobemini (2/2) | ✅ yangyongqiang0606 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
yelongjian, thanks for your pull request. All authors of the commits have signed the CLA. 👍


CANN-robot
10 天前 评论:
10 天前 评论:
10 天前 将yangyongqiang0606,kobemini,du-hua1024,tangqunzhang,depeng1994,wqtshg_wt,peiyang,shengnan666,zhanj,zhujingjing,Mexyy,wangxiaotian995设为评审人
10 天前 将yangyongqiang0606,kobemini,du-hua1024,tangqunzhang,depeng1994,wqtshg_wt,peiyang,shengnan666,zhanj,zhujingjing,Mexyy,wangxiaotian995设为评审人
10 天前 将yangyongqiang0606,kobemini,du-hua1024,tangqunzhang,depeng1994,wqtshg_wt,peiyang,shengnan666,zhanj,zhujingjing,Mexyy,wangxiaotian995设为审查人
10 天前 将yangyongqiang0606,kobemini,du-hua1024,tangqunzhang,depeng1994,wqtshg_wt,peiyang,shengnan666,zhanj,zhujingjing,Mexyy,wangxiaotian995设为审查人
yelongjian
10 天前 评论:
10 天前 评论:
compile


10 天前 预合并成功(commit_id: 50d534e570cd884fd7770f2b345806c02a3692ba)
CANN-robot
10 天前 评论:
10 天前 评论:
| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


10 天前 添加了label:ci-pipeline-running
此处折叠了8条事件消息 查看更多
10 天前 删除了label:ci-pipeline-passed
CANN-robot
10 天前 评论:
10 天前 评论:
yelongjian
10 天前 评论:
10 天前 评论:
compile


10 天前 预合并成功(commit_id: e483eb54dcf871b7ef9828f54a005e6c6c838aa4)
CANN-robot
10 天前 评论:
10 天前 评论:
| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


10 天前 添加了label:ci-pipeline-running
10 天前 删除了label:ci-pipeline-running
10 天前 添加了label:ci-pipeline-passed
GengChao
10 天前 评论:
10 天前 评论:
/lgtm


yangyongqiang
10 天前 评论:
10 天前 评论:
/lgtm


10 天前 添加了label:lgtm
yangyongqiang
10 天前 评论:
10 天前 评论:
/approve


10 天前 添加了label:approved
10 天前 合入了pull request
Pull Request
描述
修复 example 样例在裸环境的 Python 依赖断链问题(Ascend 910C + CANN 9.3.0~weekly 环境反馈):
问题:新手按文档装好 CANN 并编译 metadef 后运行
example/run_example.sh,样例约 10 秒退出(RC=255),stdout 仅两行 INFO 日志(失败与成功分支同格式,无错误码),真因藏于~/ascend/log/debug/plog/深层日志:GE 初始化时 TBE 等算子编译组件逐层import系统外 Python 包,依次报No module named 'numpy'→'decorator'→'sympy'→'scipy'→'attr'→'psutil',每装一个重跑撞下一个,需多轮试错才能跑通;而全文档对所需 Python 依赖零声明(grep numpy/sympy/scipy/psutil/decorator 零命中,attrs 仅误中 C++ RuntimeAttrs API 文档)。多次独立评估(不同日期)稳定复现,依赖缺失链首个模块恒为 numpy。依据(依赖清单非猜测):
asc_op_compile_base的 METADATA 正式声明Requires-Dist: numpy / decorator / attrs / psutiltbe/tvm组件源码import sympy / scipy(GE 初始化加载 TBE 时触发)说明:反馈中的另两点(①文档无样例入口链接、③example/ 命名误导)已由先前合入的 example/README.md 及 README/quick_install 入口链接解决,本 PR 补齐剩余缺口②——显式依赖声明。
修改:
example/README.md/example/README_en.mdpip3 install numpy decorator sympy scipy attrs psutil,并说明缺失时的失败现象(RC=255、stdout 无明显报错、plog 出现No module named 'xxx');No module named 'xxx'即为 Python 依赖缺失,按前提条件安装后重试。变更类型
关联的Issue
无
如何测试
grep Requires-Dist ${ASCEND_HOME_PATH}/python/site-packages/asc_op_compile_base-*.dist-info/METADATA输出 numpy/decorator/attrs/psutil;grep -rl "import sympy\|import scipy" ${ASCEND_HOME_PATH}/python/site-packages/tbe/命中 tvm 组件源码bash example/run_example.sh,plog 中首个缺失模块为 numpy,按 README 新增命令一次性安装后依赖链不再阻塞核对清单
其他信息
无