| Files | Last commit | Last update |
|---|---|---|
fix(machine): Fix bisheng warning log Co-authored-by: anyangle<anyangle@huawei.com> # message auto-generated for no-merge-commit merge: !5391 merge bisheng into master fix(machine): Fix bisheng warning log Created-by: quadrate Commit-by: anyangle Merged-by: cann-robot Description: ## 1. 背景与问题 A5 场景下,动态 kernel 编译会调用 bisheng。成功时终端仍会刷大量 note:: text note: .../aicore_entry_dfx.h:117:33: Identify the scenario where the NOP instruction is inserted to prevent a running failure. note: .../aicore_entry_devtask.h:49:72: Identify the scenario where the NOP instruction is inserted to prevent a running failure. 来源是 bisheng 的 **Auto NOP Insert** pass(cce-aicore-auto-nop-insert),用于在特定指令序列中自动插入 NOP,避免上板运行失败。该诊断打在 **stdout**。 ## 2. 方案验证 当前涉及 bisheng 编译的有两个场景,分别在 codegen_npu.cpp 和 aicore_compiler.cpp 中。实验了以下几种方案: | 方案 | 能否消 note | 风险 / 代价 | 结论 | |------|-------------|-------------|------| | -mllvm -cce-aicore-auto-nop-insert=false | 能 | 关闭自动插 NOP,可能上板失败 | 否决 | | 编译命令加 -w | aicore 路径压不住 | 还会掩盖其它 warning | 否决 | | stdout/stderr 全量落盘 | 能 | 真实错误也进日志,终端即时性差 | 过重 | | **仅 stdout 落盘,失败回显** | 能 | 不改编译语义 | **采用** | 经确认,刷屏来自 CompileCoreMachine,leaf(codegen_npu.cpp)无贡献,因此只改 aicore 路径。 ## 3. 实现方案 ### 3.1 核心思路 Checkinject 禁止 std::system() 参数中出现 ; | < > \ 等 shell 元字符,因此 **不能在 C++ 里直接拼 bisheng ... > log**。 改为通过固定脚本 run_to_log.sh 在 shell 内部完成 stdout 重定向;C++ 仅执行不含 > 的 bash 调用。 ### 3.2 调用关系 text CompileAICoreKernel └─ CompileCoreMachine (AIC / AIV) └─ RunBishengQuiet ← 原先 std::system(ccecCmd) └─ bash run_to_log.sh <log_path> <compile_cmd> ### 3.3 RunBishengQuiet 流程 1. 在 objFile 所在目录用 mkstemp 创建临时日志文件 bisheng_log_<pid>_XXXXXX 2. GetRunToLogScriptPath() 查找固定脚本(优先级): - GetPyptoLibPath()/scripts/run_to_log.sh(安装包 / UT 软链) - 源码旁路:aicore_compiler.cpp 同目录下 compile/scripts/run_to_log.sh 3. 拼 runCmd 并 Checkinject 校验后执行: text bash '<script_path>' '<log_path>' '<bisheng ...>' 参数经 QuoteShellArg 单引号转义,避免路径/命令被 shell 拆开 4. run_to_log.sh 内部执行 eval "$2" >"$1":**仅 stdout 落盘**,stderr 仍打到终端 5. 成功:终端无 note,删除临时日志 6. 失败:LogBishengCompileFailure 读取日志全文,经 MACHINE_LOGE(COMPILE_CCEC_FAILED) 回显 > 链接路径(LinkObject)仍使用 RunLdViaSecureTempScript 临时脚本,与 bisheng 编译无关。 ### 3.4 脚本部署 | 场景 | 机制 | |------|------| | wheel / 正式安装 | 根 CMakeLists.txt install 到 lib/scripts/run_to_log.sh | | UT 构建 | framework/tests/cmake/func.cmake PRE_BUILD 软链到 output/lib/scripts/ | ## 4. 代码改动 **Commit 1** fix(machine): Fix bisheng warnning log - 新增 framework/src/machine/compile/scripts/run_to_log.sh - aicore_compiler.cpp:新增 RunBishengQuiet、GetRunToLogScriptPath、QuoteShellArg、LogBishengCompileFailure - CompileCoreMachine 末尾由 std::system(ccecCmd) 改为 RunBishengQuiet - 根 CMakeLists.txt:install run_to_log.sh - 新增 test_aicore_compiler.cpp UT **Commit 2** fix(machine): Add ut - 移除 RunBishengViaTempScript 临时脚本兜底,统一走固定 run_to_log.sh - func.cmake UT scripts 软链列表补充 run_to_log.sh,修复 UT 构建时 lib/scripts/ 被清空导致脚本缺失 - 补充 / 调整 RunBishengQuiet` 相关 UT 用例 See merge request: cann/pypto!5391 | 2 months ago | |
feat(machine): Support BN parallel for DRCO Co-authored-by: gaoxingwang<camuel.gao@huawei.com> # message auto-generated for no-merge-commit merge: !7246 merge drco-bn-parallel-final into master feat(machine): Support BN parallel for DRCO Created-by: gaoxingwang Commit-by: gaoxingwang Merged-by: cann-robot Description: feat(machine): Support BN parallel for DRCO Add a device-side parallel window for DRCO devTask execution under BN parallel mode (device_sched_parallelism > 1) on 2201: block0 acts as the single admission/handover/recycle/stop leader while all cores visit slots in try-mode rotation, replacing the legacy SyncAllMix barrier per devTask. Squashed from the window feature, its cross-core visibility fixes, the minimal atomic protocol reduction, and two late hardening changes (per-slot activation now issues the ENTIRE_DATA_CACHE invalidation before loading queue/matrix read sets; ready-queue entries are published via atomic release stores ahead of the tail gateway). BN parallel mode and DRCO L2-affinity scheduling are temporarily made mutually exclusive (BN wins): enabling both together exposes a stale-data window between the L2 affinity dispatch order and the BN window admit/handover protocol. Proper fusion is left for a follow-up. Changes: - Add DrcoParallelWindow slot ring, per-slot activation/visit/exit protocol and leader poll loop - Encode stop as cross-launch epoch with entry barrier clear for non-block0 cores - Guard stale slot activation with posId validation and invalidate freed slots on idle - Reset window cursors and BN link fields deterministically across launches and replays - Publish ready-queue entries (func/root/forId/wsId) with atomic release stores - Move UpdateCacheDevTask entire-cache dcci ahead of activation read-set loads - Force DRCO_FLAG_L2_CLOSE=0 when ENABLE_AICORE_BN_PARALLEL=1 (temporary mutex) Related Issues: #7147 See merge request: cann/pypto!7246 | 30 days ago | |
feat(machine): Support L2-friendly scheduling in DRCO via device_sched_mode=1 Co-authored-by: LordOfMysteries<duhongxiang@huawei.com> # message auto-generated for no-merge-commit merge: !7058 merge master into master feat(machine): Support L2-friendly scheduling in DRCO via device_sched_mode=1 Created-by: lululu40888 Commit-by: LordOfMysteries Merged-by: cann-robot Description: feat(machine): Support L2-friendly scheduling in DRCO via device_sched_mode=1 See merge request: cann/pypto!7058 | 1 month ago | |
fix(machine): Add aicore-resolve macro Co-authored-by: huanglu<huanglu22@hisilicon.com> # message auto-generated for no-merge-commit merge: !5549 merge master into master fix(machine): Add aicore-resolve macro Created-by: lululu40888 Commit-by: huanglu Merged-by: cann-robot Description: fix(machine): Add aicore-resolve macro See merge request: cann/pypto!5549 | 3 months ago | |
refactor(all): Remove trailing whitespace Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !2188 merge pre-commit into master refactor(all): Remove trailing whitespace Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Introduce pre-commit tools, and remove trailing white space with default plugin Related Issue: #1017 See merge request: cann/pypto!2188 | 7 months ago | |
feat(indexing): Support A5 SIMT gather and index put Co-authored-by: bynshard<zhangbingshuai@huawei.com> # message auto-generated for no-merge-commit merge: !5404 merge feat/a5-simt-mixed into master feat(indexing): Support A5 SIMT gather and index put Created-by: bynshard Commit-by: bynshard Merged-by: cann-robot Description: gather indexput 支持的simt 实现,在离散场景下提升性能 当 Gather 的 source 位于 GM、indices 位于 UB 时,A5 Codegen 会选择 SIMT MGATHER 实现: 1. 使用 SIMD 批量计算 Gather 的元素偏移。 2. 使用 SIMT MGATHER 根据偏移直接从 GM source 读取数据。 3. source 位于 UB 时继续使用原有实现。 4. int64 indices 暂不使用 SIMT,回退到原有 Scalar 实现。 同时补充了 SIMT Kernel 的端到端识别与下发机制: 1. Pass 识别需要 SIMT 的 Gather,并设置 requiresSimt 属性。 2. 将 requiresSimt 信息传递到 Device Program 和编译流程。 3. 为包含 SIMT 的 A5 Kernel 生成相应的 ELF metadata。 4. Runtime 根据 Kernel 是否包含 SIMT,选择对应的 UB 配置。 5. SIMT Kernel 配置 216 KB 动态 UB,并为 DCache 预留 32 KB。 6. 纯 SIMD Kernel 保持原有 Runtime 下发方式和 UB 配置。 此外,完善了 GM GatherElement 在内存类型推导、动态参数注册、动态 valid shape 处理和 OoO 调度中的支持。 Related Issue: #3162 ``` 更多描述信息见:[Commit Message 规范](../docs/zh/contribute/pull-request.md#commit-message) See merge request: cann/pypto!5404 | 2 months ago | |
feat(indexing): Support A5 SIMT gather and index put Co-authored-by: bynshard<zhangbingshuai@huawei.com> # message auto-generated for no-merge-commit merge: !5404 merge feat/a5-simt-mixed into master feat(indexing): Support A5 SIMT gather and index put Created-by: bynshard Commit-by: bynshard Merged-by: cann-robot Description: gather indexput 支持的simt 实现,在离散场景下提升性能 当 Gather 的 source 位于 GM、indices 位于 UB 时,A5 Codegen 会选择 SIMT MGATHER 实现: 1. 使用 SIMD 批量计算 Gather 的元素偏移。 2. 使用 SIMT MGATHER 根据偏移直接从 GM source 读取数据。 3. source 位于 UB 时继续使用原有实现。 4. int64 indices 暂不使用 SIMT,回退到原有 Scalar 实现。 同时补充了 SIMT Kernel 的端到端识别与下发机制: 1. Pass 识别需要 SIMT 的 Gather,并设置 requiresSimt 属性。 2. 将 requiresSimt 信息传递到 Device Program 和编译流程。 3. 为包含 SIMT 的 A5 Kernel 生成相应的 ELF metadata。 4. Runtime 根据 Kernel 是否包含 SIMT,选择对应的 UB 配置。 5. SIMT Kernel 配置 216 KB 动态 UB,并为 DCache 预留 32 KB。 6. 纯 SIMD Kernel 保持原有 Runtime 下发方式和 UB 配置。 此外,完善了 GM GatherElement 在内存类型推导、动态参数注册、动态 valid shape 处理和 OoO 调度中的支持。 Related Issue: #3162 ``` 更多描述信息见:[Commit Message 规范](../docs/zh/contribute/pull-request.md#commit-message) See merge request: cann/pypto!5404 | 2 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 2 months ago | ||
| 30 days ago | ||
| 1 month ago | ||
| 3 months ago | ||
| 7 months ago | ||
| 2 months ago | ||
| 2 months ago |