Fix #34: ASW_Basic 兜底恒出方案; 搬移效率下限不满足降级为 warning (不判违规)

- constraints.py: ASW_Basic/ASW_Basic_降核 的 dValue 效率下限不再计违规
  (DMA 仍能工作只是效率低; 真正不可行的只有容量/核数硬约束);
  IterBatch/MergeBatch/StreamK 等有替代分支的分支仍按违规处理 (不满足条件不该进)
- asw_basic 枚举尾部: 严格 256B 偏好无解 -> 放开约束4 按 128B 硬下限给最优可行 tile,
  note 标注"效率降级"; 128B 硬下限也不满足的极端形状 (如 N=8 int8, B 侧 dValue=8B
  物理不可满足) 仍给 Base tile 方案 + 标注效率降级 (搬移效率崩塌)
- evaluator advice / router 仲裁文案含"效率降级"提示 (plan.note 同步)
- docs/06 Step1 增加"兜底分支恒出方案"段落 (效率降级 vs 违规的语义分层)
- 回归: b32_m16_n8192_k7168 分解 = Base 16x1024 + tile 16x1024 + k_l1=112
  (L1 双缓冲 ⌊L1/(2·(16+1024)·2)⌋16=112 反推) 入测试; 极端形状 feasible=True +
  效率降级标注; 压力 10000 例 0 崩溃/0 NaN/0 硬违规/0 GM<V_in; examples 重生成 0 diff
This commit is contained in:
2026-09-07 16:24:46 +08:00
parent 05ca91e291
commit 0cd47f93cb
9 changed files with 101 additions and 48 deletions

View File

@@ -85,7 +85,12 @@ def check_plan_constraints(case: BmmCase, plan: ImplPlan,
# --- dValue --- (issue#6 口径裁定: 只对"以 K 段为连续维"的方案生效)
if _k_segment_is_contiguous(plan, case) and plan.k_l1 > 0:
if plan.branch == "IterBatch" and plan.l1_form.startswith(("c_", "d_")):
if plan.branch in ("ASW_Basic", "ASW_Basic_降核"):
# issue#34: ASW 是兜底分支, 恒出方案; dValue 效率下限不满足只算**效率降级**
# (plan.note 含"效率降级"标注, DMA 仍能工作只是效率低), 不判违规.
# 真正不可行的只有容量/核数硬约束 (L0C/L0A/L0B/L1 超容, 核数超限).
pass
elif plan.branch == "IterBatch" and plan.l1_form.startswith(("c_", "d_")):
# 转置感知判据与生成守卫/条件 4 同源 (issue#19):
# dv_a = M*dt (A 转置) 或 k_l1*dt; dv_b = N*dt (B 不转置) 或 k_l1*dt;
# 两侧连续维 dValue 均低于下限才算违规.