Prefer E2B layouts for group broadcast loads - #1334
Draft
mouliangyu wants to merge 1 commit into
Draft
Conversation
mouliangyu
force-pushed
the
codex/e2b-broadcast-layout
branch
from
August 25, 2026 04:06
d1a9f13 to
71bf21c
Compare
mouliangyu
force-pushed
the
codex/e2b-broadcast-layout
branch
from
August 25, 2026 04:45
71bf21c to
00890b8
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.
背景
E2B-compatible 的
group_broadcast_load之前仍可在 support table 中选择 contiguous layout。这样 assignment 无法表达 E2B producer 的真实物理 layout,也会让 contiguous 决策继续影响下游 cast 链;部分形态会回退到vsldb + vselr,而 issue 原始整核则因此生成带vor合并的 FP8 carrier 路径。Closes #1320
修改
group_broadcast_load满足 E2B 条件时,从候选 layout 中移除 contiguous;只有无法使用 E2B 时才继续允许 contiguous fallback,并增加 b8 反向回归覆盖该条件。group_broadcast_load保持为低优先级 preferred producer:consumer 可先选择 contiguous,producer 随后选择 d4,并由 assignment 显式插入ensure_layout(d4 -> c)。d2 -> ls2冲突;普通 broadcast load 仍保持 consumer 优先。E2B_B16/E2B_B32且禁止 E2B case 回退到vselr。性能
使用 issue 原始完整
vmi_kernel.input.pto,在同一个origin/main@ca7ccb40上分别构建 baseline 和本 PR,使用相同 VPTO flags 与 A5 CA model harness 测试:[15, 8238],kernel 区间 8223 cycles[17, 7876],kernel 区间 7859 cycles两边整核都没有
vselr,因此这里的收益不能归因于vselr。完整 popped instruction 统计从 4107 条降到 4057 条;其中RV_VOR从 192 条降到 0。当前热点使用E2B_B32 + 3 x vintlv显式完成 d4 -> c,fp32 -> fp8 -> fp32 roundtrip 保持四条独立 P0 路径,不再通过 3 个vor合并共享 FP8 carrier。该整核使用 in-place scratch harness,模拟器执行通过,框架按既有设置跳过数值 compare。验证
ninja -C .work/issue_1320/build-llvm19 pto-test-opt PTOAS_Pythonninja -C .work/issue_1320/build-llvm19 check-pto:1830 passed,1 unsupported,0 failedpython3 .codex/skills/enforce-ptoas-code-compliance/scripts/check_changed_code.py --repo . --base origin/main:0 errors,0 warnings