Fix issues #23-#25 (+#26 标注): GM读写共享总线累加计时 / ASW-切M/N 共享块 GM首读1次+L2重复读(n-1)次、场景按单batch判定、分组预算不再除B / StreamK 按plan实际tile芯片口径评估 / 降核线性带宽假设文档标注

This commit is contained in:
2026-09-04 11:43:23 +08:00
parent f4b23d9f05
commit 4843053ad3
10 changed files with 248 additions and 180 deletions

View File

@@ -39,11 +39,16 @@ class NpuSpec:
dvalue_hw_min: int = 256 # DMA 硬件突发下限 (Byte) —— 尾轮文档 §2.3
min_tile_size: int = 16 * 1024 # min_TileSize: 单块搬移最小量 16KB
min_datamount_per_core: int = 480 * 1024 # min_DatamountPerCore: 单核搬移总量下限 480KB
min_core_num_ratio: float = 0.8 # minCoreNum ≈ 0.8 * C
min_core_num_ratio: float = 0.8 # minCoreNum ≈ 0.8 * C (经验: 约 3/4 核并发才达 90%+ 带宽利用率)
# ---- DMA 固定开销 ----
t_cmd_ns: float = 50.0 # T_cmd: 单次 GM->L1 DMA 命令固定开销 (ns, 估计值, 需实测标定)
# ---- 带宽模型假设 (issue#26) ----
# GM 1.6TB/s 为读写共享总线 (读+写累加计时); L2 带宽读写各自独享 5.2TB/s;
# active_cores < C 时按"每核份额线性配平"为模型假设 (如 1 核也给 50GB/s),
# 真实低核数带宽利用率低于线性, 需 msProf 实测曲线标定后替换该假设.
# ---- Cube 计算粒度 ----
fractal: int = 16 # 16x16x16 基本块