已合并
fix: 修正课程代码语法和 npugraph_ex 配置逻辑 #482
likeA_star创建于 27 天前
fix: 修正课程代码语法和 npugraph_ex 配置逻辑 #482
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 likeA_star 的贡献)27 天前 创建了 pull request,commit d79b6404
atomgit-bot
27 天前 评论:
27 天前 评论:
变更摘要
此 PR 修复了三个独立的问题:修复 MC2 集合通信演示 Notebook 中因多余反斜杠导致的 Python 字符串语法错误;修复 Ascend C V2 Tensor API 章节中 cmake 未被正确作为 Shell 命令执行且未进入 build 目录的问题;修复 Qwen3-8B 推理配置中 npugraph_ex 模式下 TASK_QUEUE_ENABLE 环境变量的分支反转逻辑,确保配置校验幂等。
主要改动
- 修复 MC2 Notebook 字符串转义错误: 在
01.02_MC2_fused_operator_concept_intro.ipynb中,将\"AllReduce(one-shot)\\\"和\"AllReduce(two-shot)\\\"末尾的多余反斜杠移除,恢复为合法的\"AllReduce(one-shot)\"和\"AllReduce(two-shot)\",消除了unterminated string literal语法错误。 - 修复 Ascend C 编译命令执行方式: 在
03.03.05_simd_c++_programming_base_on_tensor.ipynb中,将原来分两行且cmake未通过!前缀执行的错误写法,合并为一条完整的!mkdir -p Sources/build && cd Sources/build && cmake ... && make -jShell 命令,确保构建目录正确创建并进入后再执行编译。 - 修复
npugraph_ex配置分支反转: 在inference_config.py的ModelConfig校验逻辑中,移除and os.getenv("TASK_QUEUE_ENABLE", "2") != "1"条件,使exe_mode == "npugraph_ex"时无条件设置TASK_QUEUE_ENABLE=1,避免原先当环境变量已为"1"时错误地落入else分支被改为"2"。


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


likeA_star
27 天前 评论:
27 天前 评论:
/compile


27 天前 添加了label:ci-pipeline-running
CANN-robot
27 天前 评论:
27 天前 评论:
27 天前 删除了label:ci-pipeline-running
27 天前 添加了label:ci-pipeline-passed
YANXI_ZHAO
26 天前 评论:
26 天前 评论:
/approve


26 天前 添加了label:approved
YANXI_ZHAO
26 天前 评论:
26 天前 评论:
/lgtm


21 天前 关联了issue:[Course-Feedback|课程反馈]: 多处课程代码存在语法、编译命令及 npugraph_ex 配置逻辑错误
19 天前 添加了label:lgtm
19 天前 合入了pull request
修改内容
unterminated string literal,恢复 one-shot/two-shot 示例执行。cmake当作 Python 执行、且未进入build目录的问题,合并为一条完整 Shell 命令。npugraph_ex配置在TASK_QUEUE_ENABLE=1时反而改为2的分支反转,保证配置校验幂等。验证
.py文件,无语法错误。TASK_QUEUE_ENABLE以未设置、0、1、2为初值时,npugraph_ex校验后均为1;连续校验结果保持不变。bash -n语法检查。范围说明
全仓扫描还发现 3 个历史遗留的 0 字节 Notebook 占位文件。由于仓库中没有可恢复正文,本 PR 不生成猜测性空壳内容。