Repository navigation
fix(sync): balance multi-tile prefetch event boundaries - #1524
Open
zhangstevenunity wants to merge 1 commit into
Open
zhangstevenunity wants to merge 1 commit into
zhangstevenunity wants to merge 1 commit into
Conversation
zhangstevenunity
marked this pull request as ready for review
September 12, 2026 11:09
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Zhendong404
pushed a commit
that referenced
this pull request
Sep 16, 2026
Co-authored-by: HecreReed<zhangstevenunity@sina.com> Co-authored-by: zhangstevenunity<128771452+zhangstevenunity@users.noreply.github.com> # message auto-generated for no-merge-commit merge: !135 merge codex/fix-multi-tile-prefetch-sync into master fix(sync): balance multi-tile prefetch event boundaries Created-by: zhongxuan1 Commit-by: HecreReed;zhangstevenunity Merged-by: cann-robot Description: ### 当前 PR 是否有 AI 参与 - [x] 是 1. AI Agent 平台:OpenAI Codex 2. AI 模型:GPT-6 3. Prompt 上下文:用户要求 review GitHub PR #1524,修复 review 发现的问题,并在 GitCode 提交关联 issue 的 PR。 ### PR 功能描述 / 为什么需要这个合入 预加载槽位 0、循环中先预取下一槽位再消费当前槽位时,多缓冲同步事件的入口和出口必须与实际迭代及槽位使用匹配,否则零次、奇数次等循环可能出现重复事件、漏等待或读写顺序错误。 移植 GitHub PR #1524 的槽位分析和循环边界修复,并修复 review 中发现的事件 ID 重分配问题:事件池不足时,先移除相关管线作用域内所有由分配器生成的入口/出口事件,再从原始依赖重新分配,避免把残留在循环边界的旧事件当作新依赖重复分配。 ### 该 PR 关联的 issue Fixes #1519 来源:#1524 ,原始提交 `46546e605b97bbabf6f472c45f60666029089be9`。保留原作者信息。 ### 希望检视人员了解 新增连续 2/4/5 个预取循环和嵌套连续循环的回归,复用缓冲区以检查跨循环读写顺序;覆盖 level2/level3、零次/奇数/偶数迭代及不同槽位表达式。协议检查验证事件配对和 RAW/WAR/WAW 顺序,不依赖固定事件编号。 旧分配器在 `sequential_4-level2, upper=-1` 上复现 `duplicate set without wait: ('PIPE_MTE2', 'PIPE_V', 1)`;修复版同一测试通过。 ## 改动类型 / Change Type - [x] Bug 修复 / Bug Fix - [x] 文档更新 / Documentation - [x] 测试相关 / Test ## 测试信息 / Testing - 完整 Release 构建及隔离环境 editable 安装通过。 - 预取同步协议回归通过:39 个编译配置、546 次协议执行;已安装的 PTOAS CLI 路径也通过。 - 恢复修复版后,24 项 multi-tile lit 回归全部通过。 - 分配器原生压力检查通过,覆盖 2/4/5/20 个连续双缓冲循环。 - 完整 lit:1841 通过、1 不支持、48 失败。 - 完整 CTest:73/75 通过。 - 上述 48 项 lit 和 2 项 CTest 失败均使用未修改的主干 `4f849408b` 编译器重新验证,失败集合和 CANN 版本诊断一致。当前环境为 CANN 9.0.0-beta.1,相关测试要求 9.0.0-beta.2 或更新版本;没有本次修复特有的失败。 - 变更代码规范检查:8 个文件,0 错误、0 警告;差异检查通过。 未进行 NPU 或硬件模拟器运行验证。 ## 检查清单 / Checklist - [x] 代码符合规范 / Code follows style guide - [x] 已添加回归测试,且相关回归全部通过 - [x] 设计文档已更新 - [x] 无硬编码敏感信息 / No secrets hardcoded - [x] 提交信息符合规范 / Commit message follows convention See merge request: cann/pto-as!135
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A preload followed by a multi-tile prefetch loop initialized and drained every slot event, allowing reads or overwrites before their dependencies completed and leaving unmatched waits for odd trip counts. Compute entry and exit events from each slot's first set/wait order and the loop's final rotation position, including loops with zero iterations.
Keep boundary events scoped to their owning loop and avoid duplicate enclosing-loop events. Preserve static synchronization for unproven distinct slot expressions, and use the existing PIPE_ALL fallback when a proven rotation cannot obtain enough event IDs. Update the design documentation and strengthen the existing boundary checks.
Validation:
Fixes #1519.