| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
docs: 将 offline_compile_run 示例中的中文改为英文 Co-authored-by: Mexyy<xiaguozheng1@hisilicon.com> # message auto-generated for no-merge-commit merge: !4922 merge f_20260912 into develop docs: 将 offline_compile_run 示例中的中文改为英文 Created-by: Mexyy Commit-by: Mexyy Merged-by: cann-robot Description: ## 描述 将 examples/offline_compile_run/cpp/main.cpp 中的中文示例文本改为英文,便于英文环境使用。 ## 变更类型 <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue 无 ## 如何测试 1. 运行针对 examples/offline_compile_run/cpp/main.cpp 的 pre-commit 检查,全部通过。 2. 检查提交差异,确认仅替换示例中的中文文本,未改变代码逻辑。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 无 See merge request: cann/ge!4922 | 15 天前 | |
fix: replace Chinese log messages with English in examples Co-authored-by: wangyuchen<wangyuchen38@huawei.com> # message auto-generated for no-merge-commit merge: !4883 merge fix/example_log into develop fix: replace Chinese log messages with English in examples Created-by: yuchen97 Commit-by: wangyuchen Merged-by: cann-robot Description: ## Description Replace Chinese log/print messages with English across all examples/ subdirectories to comply with the "no Chinese in logs" rule. Also fix one implicit string concatenation bug (missing space) and improve the English fluency of a previously awkward translation. ## Changes ### examples/es/ (183 issues, 30 files) - C++ main.cpp files (14 subdirs): "GE 初始化失败" → "GE initialization failed", "执行结束" → "Execution completed", "错误: 未知命令" → "Error: unknown command" - Python run_graph() (16 files): all Chinese print statements replaced with fluent English ("图运行成功" → "Graph executed successfully", "清理GE环境" → "Cleaning up GE environment", etc.) - hccl_ep/hccl_tp: "单卡模式"/"多卡模式" → "Single-card mode"/"Multi-card mode" ### examples/fusion_pass/ (68 issues, 12 files) - RuntimeError messages: ES API missing prompts translated from Chinese to English with proper README section references - Pass registration messages: "已注册" → "registered", "请通过 ASCEND_GE_PY_PASS_PATH 指向本文件" → "Please add this file to ASCEND_GE_PY_PASS_PATH" (improved translation per review feedback) - Graph base pass and pattern base pass: all Chinese print/log replaced ### examples/multi_stream_autotune/ (73 issues, 3 files) - ge_ms_autotune.py: ~110 Chinese log/error/print messages replaced; header and column labels in output table anglicized; docstrings updated - sample_run.py: Chinese comments and print statements replaced - README.md / README_en.md: example output section updated to match new English outputs - Fixed missing space bug in find_compiled_om() string concatenation ### examples/offline_compile_run/ (70 issues, 10 files) - C++ files: all std::cerr/std::cout Chinese messages replaced ("失败" → "failed", "初始化成功" → "initialized successfully", etc.) - Python files: all Chinese print/f-string messages replaced with English equivalents ## Change Statistics - **56 files** modified - **467 insertions**, **442 deletions** - **394 Chinese log messages** converted to English across 4 module directories ## Change Type - [ ] 🐛 Bug fix - [ ] ✨ New feature - [ ] 💄 Code style update - [ ] ♻️ Refactoring - [ ] 📦 Build process - [x] 📝 Documentation / example update ## How to Test 1. Build any example under examples/ and verify all output messages are in English 2. Check examples/multi_stream_autotune/ outputs for proper formatting ## Checklist - [x] My code follows the project's code style - [x] I have self-tested the changes - [x] I have updated related documentation - [x] I have used appropriate type label in the title - [x] I have read and followed the contributing guidelines See merge request: cann/ge!4883 | 17 天前 | |
feat: 新增离线图编译执行 C++ 样例并修复 allocator 回调释放问题 Co-authored-by: du-hua1024<duhua2@huawei.com> # message auto-generated for no-merge-commit merge: !1955 merge tmp2 into develop feat: 新增离线图编译执行 C++ 样例并修复 allocator 回调释放问题 Created-by: du-hua1024 Commit-by: du-hua1024 Merged-by: cann-robot Description: # Pull Request ## 描述 本 PR 包含三类变更: ### 1. 新增 GE C++ 离线图编译执行样例( examples/offline_compile_run/cpp/) - 覆盖单模型(Add 图)和 Bundle 模型(Add + Mul 图)两种场景 - 提供完整的 CMake 构建脚本(CMakeLists.txt)和一键执行脚本(run_sample.sh),支持 build_model、run_infer、sample_and_run 等多个 target - 核心 API 流程:aclgrphBuildInitialize → aclgrphBuildModel/aclgrphBundleBuildModel → aclgrphSaveModel/aclgrphBundleSaveModel → aclgrphBuildFinalize,推理通过 aclmdlLoadFromFile/aclmdlBundleLoadFromFile 执行 - 补充 README,与 Python 样例文档结构对齐 ### 2. 编码规范整改 - **ge_api_c_wrapper/c_offline_compile.cc + ge_api_c_wrapper_utils.h**:为离线编译 C Wrapper 接口的指针参数补充 const 修饰(char** → const char**、Graph* → const Graph*、int* → const int*),同时修正函数声明的参数对齐格式,提升接口语义准确性 - **ir_proto_codec.cc**:将 GET_ATTR_JSON_FUNC(Str, std::string) 宏展开为显式函数,增加 AttrUtils::GetStr 返回空指针时的 null 检查,避免潜在的空指针解引用 - **examples/custom_es_api/run_sample.sh**:添加 set -e,确保脚本在任意命令失败时立即退出,增强健壮性 ### 3. 修复 allocator 回调对象提前释放的问题(_allocator_callback_adapter.py) - 原代码在 _on_allocator_destroy 中直接 pop 丢弃回调对象,未触发回调自身的析构逻辑 - 修复后先取出回调对象再显式调用清理,确保 C++ 侧 ~PyCallbackAllocator 触发时 Python 资源正常释放 ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue 暂无 ## 如何测试 1. 安装 CANN toolkit 和 ops 包,执行 source /usr/local/Ascend/cann/set_env.sh 2. 进入 examples/offline_compile_run/cpp/ 目录 3. 运行 bash run_sample.sh -t sample_and_run,验证单模型编译与推理成功 4. 运行 bash run_sample.sh -t sample_and_run_bundle,验证 Bundle 编译与推理成功 5. 验证 add_sample.om 和 bundle_sample.om 文件生成 6. 验证 allocator 回调修复:在有自定义 allocator 的场景下,析构时不再出现资源泄漏 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 - C++ 样例与 Python 样例生成的 om 文件同名(add_sample.om、bundle_sample.om),请勿在同一目录下混用 - run_sample.sh 使用 CMake 增量编译,多次执行不会清空构建目录 See merge request: cann/ge!1955 | 5 个月前 | |
提交英文文档 | 3 个月前 |