Repository navigation
Conversation
This was referenced Nov 12, 2026
sufubao
force-pushed
the
refactor/attention-01-contracts
branch
3 times, most recently
from
November 13, 2026 03:43
f13045e to
e0b2617
Compare
sufubao
force-pushed
the
refactor/attention-01-contracts
branch
from
November 13, 2026 03:55
e0b2617 to
042280e
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.
公开 AttentionExecutionContext 和 AttentionWorkspace,约束 Context 泛型,并补齐 AttentionBackend 的 check_environment/check_support/create 接入契约。Base 在 provider 初始化前接收 LayerSpec,causal/page_size/dynamic_verify 由 spec 决定;ExecutionRequirements 保持纯数据,模型转换位于 basemodel 适配层。
LayerAttentionBinding.forward(execution, inputs, out=...) 每次通过 AttentionExecution 查找 Context,保留 .context() 给直接消费者,不缓存执行 Context。
LayerSpec 保存静态窗口及 MLA softmax_scale,Params 保存层资源;Varlen out 明确 shape/dtype/device、无重叠 stride 和禁止共享输入存储的约束。workspace 原实现移至公开 API,内部路径仅转发。DeviceCaps.device_name 与实际值一致。
本机 H200:本步21项 contract/device/workspace 检查通过。运行时接入在第5步,平台注册入口不代表 MUSA/ROCm/Ascend 已实测。
由已关闭的 #1700 拆分,本 PR 为第1/5步,依赖顺序 #1717 → #1718 → #1719 → #1720 → #1721。全部保持 Draft;按序合入,前序进入 main 后再 retarget 后续 PR。CI 仅监听 base=main,第2–5步本地检查不等于 GitHub CI。
本轮实验记录:
/data6/exp_logs/runs,最终组合261113-115108,模型261113-115240;源文件哈希、命令、结果和失败记录均保留。