Perf: 优化 A5 双 Die 任务局部性与 Qwen 依赖链 - #11
Open
yanghaoran29 wants to merge 3 commits into
Open
Conversation
基于连续物理cluster分核,为每个任务引入GLOBAL、DIE0和DIE1 domain,并为AIC、AIV和MIX维护按domain直接索引的ready queue。completion、async-wait、deferred-release和Scheduler-local continuation传播任务domain,使固定Die的依赖链尽量在对应Die内完成。 按样例的自然依赖粒度分配任务:BGEMM按group,PA unroll和manual PA按batch链,Batch PA按chunk,Alternating根任务在两侧均分。Qwen3按MLP分片保持Gate/Up、SiLU和Down同Die,并将非sync-start多核SPMD拆成两个逻辑block区间;sync-start attention和高fanin dcr_xgamma保留为GLOBAL单任务。 分支已rebase到Main 80dd3cd,并适配最新Tensor及PTO2退役后的runtime接口。卡1同机重新测试Main和本提交:非Qwen每个case 100轮,Qwen 5轮取Device中间3轮。Alternating改善8.19%,Batch PA改善1.89%,Qwen改善5.63%,BGEMM回退0.65%;4个PA unroll/manual case回退14.89%至21.40%,8 case Device几何平均回退6.62%。最新数据、限制说明及当前代码生成的8张四级原始泳道随提交保存。
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.
背景
本 PR 直接面向
main,合并当前 A5 双 Die 调度局部性方案及后续 Qwen3 跨 Die 依赖链优化。80dd3cd96e568e6f3ded9c11b68e7c267a31343dcd5eefefc1b4994dd3d7670a120e6abed2559aeabe5ccb765a4ce5d14ca5da8b0e2f182d7f003369相对 Main 共 3 个提交:
629c7cde:A5 双 Die 任务局部性与 SPMD 派发;87c23c26:Qwen OutProj producer 与 residual/RMS consumer 同 Die;cd5eefef:Q/K/V seed 按 Die 拆分并独立解锁 projection half。Runtime 改动
GLOBAL、DIE0或DIE1,AIC/AIV/MIX 分别维护按 domain 索引的 ready queue。Workload 改动
residual_rms_castconsumer 固定在同一 Die。mlp_out_seed和 24-block CANN PA 保持GLOBAL,因为它们仍需等待完整 accumulator/seed 状态。Main / 当前版本性能
设备为 Ascend950PR_9579 卡 1,CANN 9.2.0,runtime 为
tensormap_and_ringbuffer。Main 数据复用干净构建历史结果;当前版本中非 Qwen 各运行 100 轮并取算术平均,Qwen 运行 5 轮,按 Device 删除最快和最慢轮后对对应中间 3 轮取平均。性能轮关闭泳道。负数表示当前版本更快。
当前版本相对 Main 的 8 个 case Device latency 全部改善。Qwen Orchestrator 仍比 Main 慢
1.97%,但 Device、Effective 和 Scheduler 分别改善4.26%、4.40%和4.57%。Qwen 当前版本 5 轮 Device 原始值为
34644.2, 34473.0, 34434.4, 34612.5, 34932.8 us;删除 r2 最快轮和 r4 最慢轮,保留 r0/r1/r3。后续 Qwen 提交的独立效果
相对
629c7cde:629c7cde87c23c26cd5eefef最终 Qwen 版本相对
629c7cde的 Device、Effective、Scheduler 分别改善2.11%、2.26%、2.43%;其余 7 个样例的 Device 变化位于-1.02%~+0.82%,没有发现跨 workload 回退。验证与泳道
限制