| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(om2): 支持host tensor H2D/D2H并优化model_executor体积 Co-authored-by: wuzheng-hw<wuzheng14@huawei.com> # message auto-generated for no-merge-commit merge: !4389 merge 0813 into develop feat(om2): 支持host tensor H2D/D2H并优化model_executor体积 Created-by: wuzheng-hw Commit-by: wuzheng-hw Merged-by: cann-robot Description: # Pull Request ## 描述 支持 OM2 在线场景下 host tensor 的 H2D/D2H 拷贝,并对 model_executor 进行体积优化,确保 libge_executor.so 不超限。 主要变更: - 加回 host tensor 支持: LoadOm2Graph 添加 SetDevice,RunOm2Graph 支持 host input/output 的 H2D/D2H 拷贝 - 消除 om2_graph_to_model_map_ 和 om2_map_mutex_,改用 GeRootModel 存储 model_id(与 OM1 设计一致) - 内联 DoReleaseModel,直接调用 ReleaseMemory - 简化 UnloadGraph,去掉冗余的 graph_node 查找 - 删除 RunModel 中冗余的 executor nullptr 检查 - 删除 RunThread 中 is_continue 死代码 - 删除 graph_executor.h 中未使用的 SyncExecuteModelFunc/AsyncExecuteModelFunc 类型别名 - 更新 UT/ST 测试用例适配新接口 体积影响:libge_executor.so 与基线持平(0 bytes 增量) ## 变更类型 - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue ## 如何测试 1. 运行 UT 用例:model_executor_unittest 2. 运行 ST 用例:test_om2_online 3. 验证 libge_executor.so 大小不超过基线 ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定 ## 其他信息 本次变更基于 commit 0ebf3107d。 See merge request: cann/ge!4389 | 30 天前 | |
feat: 支持自动多流配置与自动寻优工作流 Co-authored-by: KenChow<zhouchen53@huawei.com> # message auto-generated for no-merge-commit merge: !4301 merge multi_stream_custom_pass into develop feat: 支持自动多流配置与自动寻优工作流 Created-by: KenChow Commit-by: KenChow Merged-by: cann-robot Description: # Pull Request ## 描述 新增 GE 自动多流的配置入口与自动寻优工作流,使用户无需修改模型代码即可选择、验证并挑选最优的多流并行策略。 **1. 自动多流配置入口(compiler)** - StreamUtils 新增 AutoMultistreamMode / AutoMultistreamConfig,统一解析 ge.autoMultistreamParallelMode 的取值:cv、LoadBalance:N、MainStream:N、WeightedLoadBalance:N(N 取值 [1, 64]),以及仅允许由自定义 Pass 通过图属性下发的 default。 - 模式来源从「仅 option」扩展为「option + 根图同名图属性」,图属性优先,便于自定义 Pass 在编译期动态切换策略。 - 收敛 LogicalStreamAllocator、EnginePartitioner 与 MiniDAGStreamPass 的门控逻辑,统一走上述解析结果,非法取值统一报错。 **2. 执行步骤打点(runtime/v1)** - 新增 runtime/v1/common/multi_stream_tuning:model_tuning_config 通过模型属性 _auto_multistream_tuning_mode 识别调优态;step_recorder 提供 RAII 的 StepScope,按 STEP 日志输出单步耗时。 - 非调优态(mode 为空)退化为空对象,不取时间戳、不分配资源,生产路径零开销;同线程仅统计最外层执行,避免嵌套重复打点。 - 打点接入 DavinciModel(NnExecute / Run)与 RT2.0 ModelV2Executor,覆盖 ACL、静态执行器、Hybrid 与 RT2.0 四条执行路径。 **3. 自动寻优样例(examples/multi_stream_autotune)** - ge_ms_autotune.py:候选模式批量编译、OM 复用、输出一致性校验、耗时统计与最优策略推荐。 - 配套自定义 Pass(下发 auto_multistream_tuning_graph 图属性)、sample_run.py 运行脚本及中英文 README。 **4. 测试** - 新增/补充 UT 与 ST,覆盖模式解析与非法值分支、门控跳过分支、打点记录与执行器集成路径。 ## 变更类型 <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [x] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue 无关联 Issue。 ## 如何测试 前提条件:已安装 CANN Toolkit,并 source <ASCEND_INSTALL_PATH>/set_env.sh。 1. 编译 UT/ST: bash cmake -DCMAKE_BUILD_TYPE=GCOV -DENABLE_OPEN_SRC=True -DENABLE_GE_UT=ON -DENABLE_GE_ST=ON \ -DENABLE_TEST=True -DENABLE_PKG=ON -DASCEND_INSTALL_PATH=${ASCEND_INSTALL_PATH} \ -S . -B cmake-build-gcov make -C cmake-build-gcov ut_libge_multiparts_utest ut_libge_distinct_load_utest \ ut_fast_runtime2_test graph_engine_test st_fast_runtime2_test -j$(nproc) 2. 执行本次新增/修改的用例: bash unset LD_LIBRARY_PATH; unset ASCEND_OPP_PATH ./cmake-build-gcov/ut_libge_multiparts_utest --gtest_filter='*MultiStreamTuning*:*StreamUtils*:*DagStreamAllocatorPass*' ./cmake-build-gcov/ut_libge_distinct_load_utest --gtest_filter='*DavinciModel*' ./cmake-build-gcov/ut_fast_runtime2_test --gtest_filter='*CustomPass*:*ModelV2ExecutorBuilder*' ./cmake-build-gcov/graph_engine_test --gtest_filter='*MultiStreamTuning*:*DagStreamAllocatorPass*' ./cmake-build-gcov/st_fast_runtime2_test --gtest_filter='*MultiStream*' 3. 运行自动寻优样例(端到端): bash cd examples/multi_stream_autotune # 编译并安装寻优自定义 Pass cmake -S custom_pass -B build && cmake --build build --parallel # 单独跑一次被测样例,确认多流生效 GE_AUTO_MULTISTREAM_PARALLEL_MODE=LoadBalance:4 python3 sample_run.py --steps 12 --dim 512 # 批量寻优并查看推荐结果 python3 ge_ms_autotune.py --run-command "python3 sample_run.py --steps 12" \ --strategies LoadBalance,MainStream --streams 2,4,8 --repeat 3 --output-dir ./tune_out 预期:各候选配置的 STEP 打点被正确解析,输出耗时排名与推荐配置;详细步骤与参数见 examples/multi_stream_autotune/README.md。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 - 本 PR 不改变默认行为:未配置 ge.autoMultistreamParallelMode 时编译流程与打点逻辑保持原状。 - git diff --check origin/develop...HEAD 的行尾提示仅涉及 3 个上游原本即全量使用 CRLF 的测试文件,本次保持其既有行尾格式,未引入行尾转换。 See merge request: cann/ge!4301 | 25 天前 | |
【PR】: 内部头文件重名整改 -- 同名不同内容 Co-authored-by: jikai-tyler<jikai5@huawei.com> # message auto-generated for no-merge-commit merge: !3497 merge ge_header_internal_2 into develop 【PR】: 内部头文件重名整改 -- 同名不同内容 Created-by: jikai-tyler Commit-by: jikai-tyler Merged-by: cann-robot Description: # Pull Request ## 描述 | 原文件路径 | 原名 | 修改后名称 | |-----------|------|-----------| | base/common/helper/mobile/ | model.h | mobile_model.h | | base/common/math/ | math_util.h | ge_math_util.h | | compiler/engines/cpu_engine/common/util/ | log.h | aicpu_log.h | | compiler/engines/cpu_engine/inc/ | graph_pass.h | cpu_engine_graph_pass.h | | compiler/engines/cpu_engine/inc/ | pass.h | cpu_engine_pass.h | | compiler/engines/cpu_engine/tf_engine/tf_optimizer/ | tensorflow_util.h | tf_optimizer_tensorflow_util.h | | compiler/engines/hccl_engine/hcom_graph_adaptor/ge_plugin/calculation_tool/ | model.h | hcom_model.h | | compiler/engines/hccl_engine/hcom_graph_adaptor/ge_plugin/ | plugin_manager.h | hcom_plugin_manager.h | | compiler/engines/local_engine/ops_kernel_store/op/ | op.h | ge_local_op.h | | compiler/engines/local_engine/ops_kernel_store/op/ | op_factory.h | ge_local_op_factory.h | | compiler/engines/manager/engine/ | engine_manager.h | dnn_engine_manager.h | | compiler/engines/manager/opskernel_manager/ | ops_kernel_manager.h | dnn_ops_kernel_manager.h | | compiler/engines/nn_engine/inc/common/ | math_util.h | nn_engine_math_util.h | | compiler/engines/nn_engine/optimizer/ops_kernel_builder/task_builder/ | dsa_task_builder.h | ops_kernel_dsa_task_builder.h | | compiler/engines/nn_engine/utils/common/ | plugin_manager.h | nn_engine_plugin_manager.h | | compiler/engines/rts_engine/common/util/ | log.h | rts_log.h | | compiler/graph/build/stream/ | stream_allocator.h | graph_stream_allocator.h | | compiler/graph/common/compress/inc/ | log.h | compress_log.h | | compiler/graph/eager_style_graph_builder/es_generator/ | utils.h | es_generator_utils.h | | compiler/graph/passes/ | pass.h | compiler_pass.h | | compiler/opcompiler/op_compile_adapter/source/compile/ | fusion_manager.h | opcompiler_fusion_manager.h | | dflow/llm_datadist/v1/common/ | cache_manager.h | llm_datadist_cache_manager.h | | dflow/llm_datadist/v1/common/ | llm_common.h | llm_datadist_common.h | | dflow/llm_datadist/v1/common/ | mem_utils.h | llm_datadist_mem_utils.h | | dflow/pydflow/wrapper/ | utils.h | pydflow_utils.h | | dflow/udf/execute/ | memory_statistic_manager.h | udf_memory_statistic_manager.h | | dflow/udf/flow_func/ | flow_model.h | udf_flow_model.h | | inc/framework/common/ | op_types.h | framework_op_types.h | | inc/graph_metadef/common/ge_common/debug/ | log.h | ge_common_log.h | | inc/graph_metadef/graph/utils/ | mem_utils.h | graph_mem_utils.h | | inc/graph_metadef/register/graph_optimizer/graph_fusion/ | connection_matrix.h | fusion_connection_matrix.h | | inc/graph_metadef/register/graph_optimizer/graph_fusion/ | graph_pass.h | graph_fusion_graph_pass.h | | inc/graph_metadef/register/graph_optimizer/graph_fusion/ | pass.h | graph_fusion_pass.h | | parser/parser/common/ | graph_pass.h | parser_graph_pass.h | | parser/parser/common/ | pass.h | parser_pass.h | | runtime/v1/graph/load/model_manager/task_info/ffts_plus/ | ffts_plus_proto_transfer.h | v1_ffts_plus_proto_transfer.h | | runtime/v1/graph/manager/ | host_mem_allocator.h | v1_host_mem_allocator.h | | runtime/v1/hybrid/model/infer/ | shape_utils.h | hybrid_shape_utils.h | | runtime/v2/core/utils/ | executor_utils.h | rt2_executor_utils.h | | runtime/v2/core/utils/ | tensor_utils.h | rt2_tensor_utils.h | | runtime/v2/utils/ | utils.h | rt2_utils.h | ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. 2. ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/ge!3497 | 2 个月前 |