Update: elide A5 terminal releases after orchestration - #13
Draft
yanghaoran29 wants to merge 1 commit into
Draft
Conversation
yanghaoran29
force-pushed
the
feat/a5-terminal-release-elision-20260829
branch
3 times, most recently
from
August 29, 2026 07:29
1cdfbc9 to
92b12d3
Compare
- Stop per-task deferred release after orchestration is sealed - Close live ring slots after every scheduler leaves dispatch - Preserve exact lifecycle handling for errors and non-terminal exits - Document the A5-only measurement scope and A2/A3 comparison
yanghaoran29
force-pushed
the
feat/a5-terminal-release-elision-20260829
branch
2 times, most recently
from
August 29, 2026 08:42
4dca8be to
34f7101
Compare
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.
目的
减少 A5 成功终态中逐 task deferred release 的集中开销,同时保留运行期和错误路径的精确生命周期维护。
本实验只针对 A5。A5 泳道图中能看到有效任务结束后仍有大量集中 release,包含 refcount 更新和 ring advance;本次检查的 A2/A3 泳道图没有出现同类的大段结尾 release 阻塞,因此没有修改 A2/A3 路径。
优化方式
orchestrator_done。AicpuExecutor::run()Scheduler 入口 gate,避免额外改变已验证敏感的 Scheduler 热函数布局。SchedulerContext的 8 B 尾部空洞,不扩大对象。terminal-closephase,并增加 terminal close 的 A5 SchedulerState 单元测试。为什么这样设计是安全的
orchestrator_done是任务图的 seal:Orchestrator 编排结束后不会再有新任务提交。逐 task release 在运行期的主要作用是归还 slot、heap 和依赖资源,供后续编排继续分配;seal 后不存在这种后续分配,因此停止增量回收不会阻塞新任务到来。已有任务仍然正常完成。只有确认全部 task complete、所有 Scheduler 已离开 dispatch、并且没有 Orchestrator/Scheduler 错误后,terminal leader 才统一关闭剩余 live slots。错误、超时和未 seal 的退出仍执行精确逐 task release,因此不会把这项放宽带到需要继续前进或需要诊断的路径。
为什么在 A5 上做
A5 默认是
1 Orchestrator + 4 Schedulers,线程跨 cluster、可能跨 die;其 Batch Paged Attention 泳道图显示结尾集中 release 会形成明显 Scheduler 尾部并增加与 Orchestrator 共享状态的竞争。对应 A2/A3 轨迹没有观察到结尾大量 release 阻塞,当前没有可证明的 A2/A3 优化目标,因此本 PR 保持 A2/A3 行为不变。平台差异和实验范围已经补充到
docs/tensormap-and-ringbuffer-a2a3-vs-a5.md。优化效果
实验设备为 A5 card 1。非 Qwen 样例各 100 轮,Qwen3 5 轮;精测回退按 Orchestrator 时间判断。
5918.916 us6947.106 us5819.991 us-1.67%-16.22%-9.994%(补充指标,不作为本轮回退判定条件)。+1.59%。验证
test_swimlane_converter.py:28/28 通过。