合并受阻
Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/cannbot-dsl | ❌ (0/2)(You can also ask: liujun2025, 沈敏, 陆玲辉, 金炯, yang-jiwei) | ❌ (0/1)(You can also ask: 陈振宇, 刘佳玮, liujun2025, 沈敏, 陆玲辉) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
m0_63156502, thanks for your pull request. All authors of the commits have signed the CLA. 👍


这个 PR 修的是 flash_attn_fp8_fullquant 精度比较器 host 侧切分的一个崩溃:mask_mode="off" 是 README 写明支持的 cross-attention 形态(允许 KV 比 Q 短),但切分时仍套用因果 ramp 代价模型,KV 比 Q 短 384 行以上就对合法输入抛 "Causal_offset too negative",流程在进 NPU 前就断了。修法是 off 模式下把切分偏移改用 KV 长度本身,让代价模型按全注意力的平坦代价均衡切分,on 模式不变;顺带把一处超出 CodeCheck 深度上限的二分搜索提成了纯函数,逻辑逐行搬移。新增的 7 个回归用例纯 CPU 可跑,修复前 4 例失败、修复后全过。麻烦评审重点看两处:off 分支偏移替换那几行,以及 _bisect_boundary 提取的等价性。


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


当前PR是否有AI参与:
[ ] 否
[x] 是
__1. AI Agent 平台: ZCode
__2. AI 模型: GLM
__3. Prompt上下文 : 针对 flash_attn_fp8_fullquant 精度比较器在 mask_mode="off" 且 KV 短于 Q 时崩溃的问题做缺陷排查与修复;复现脚本、修复范围与验收由人工确认
PR功能描述 / 为什么需要这个合入**:
samples/flash_attn_fp8_fullquant/flash_attn_fp8_fullquant_checker.py的 host 侧切分路径对合法输入崩溃。mask_mode="off" 是全注意力,仓内 README 写明支持 cross-attention(即允许 KV 比 Q 短),
validate_and_resolve对这种形态不做 kv>=q 校验。但做 tile 切分时,它无条件把每个 batch 的因果偏移(kv-q)喂给balanced_split_analytic的因果 ramp 代价模型。当某个 batch 的 KV 比 Q 短 384 行及以上(例如 BNSD s1=1024、kv=8,偏移 -1016)时,_ramp_prefix的前置守卫直接抛错:崩溃发生在任何 NPU 计算开始之前的 host 校验/切分阶段,所以 README 支持的这种合法输入整个精度比较流程跑不起来。同输入在 mask_mode="on" 下走的是设计内的 kv>=q 校验报错,说明 off 路径不是有意为之。
修复(checker.py 改动约 10 行逻辑):
FlashAttnTilingInfo.causal_offsets之后仍会重新赋值为真实的 kv-q,kernel 侧语义不变;core_task_ranges只决定 tile 在核间的划分。balanced_split_analytic里核区间终点的二分搜索提为模块级纯函数_bisect_boundary,逻辑逐行原样搬移:这段 for→if/else→while→if 嵌套按 CodeCheck 函数深度口径(上限 4)在 origin/master 上本来就是 5 层,该文件进入变更集后被门禁拦下,提取后降为 4 层。该PR关联的issue
(格式为fixes #<issue号>, 或者resolves #<issue号>):
希望检视人员了解:
_bisect_boundary的提取只为过 CodeCheck 深度检查,无行为变化,diff 可逐行对照。改动类型 / Change Type
测试信息 / Testing
新增
test/flash_attn_fp8_fullquant/test_flash_attn_fp8_fullquant_host_tiling.py,7 个用例全部通过,无需 NPU:覆盖:BNSD s1=1024 kv=8/640/641(修复前崩溃的形态与边界)、BNSD B=2 kv=[2048,8]、TND q_len=1000 kv_len=8、off 模式长 KV 对照、on 模式设计内校验对照。
静态检查与仓内门禁同口径的本地检查:
检查清单 / Checklist