feat: Triton BLOCK_M 可调(triton_block_m,默认64);bench --triton-bm 扫描

突破:triton评测39.92s/69.72(vs chunked 47.84/67.998)。继续调BLOCK_M榨。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
OwnerSunshine530
2026-06-17 13:01:50 +08:00
parent 6f7ff9fce8
commit 1083aca9fa
2 changed files with 7 additions and 3 deletions
+3
View File
@@ -318,6 +318,7 @@ def _parse_args():
ap.add_argument("--attn", choices=["sdpa", "chunked", "triton", "flex", "varlen"], default=None,
help="注意力:sdpa=稠密, chunked=分块SDPA, triton=varlen flash kernel, flex/varlen=对照")
ap.add_argument("--chunk-users", type=int, default=None, help="chunked 模式每块用户数")
ap.add_argument("--triton-bm", type=int, default=None, help="Triton query 块大小(32/64/128)")
ap.add_argument("--moe", choices=["dense", "loop"], default=None,
help="MoE实现:dense=向量化(新), loop=逐expert循环(原)")
ap.add_argument("--compile", action="store_true", help="开启 torch.compile")
@@ -361,6 +362,8 @@ if __name__ == "__main__":
cfg["attn"] = a.attn
if a.chunk_users is not None:
cfg["chunk_users"] = a.chunk_users
if a.triton_bm is not None:
cfg["triton_block_m"] = a.triton_bm
if a.moe is not None:
cfg["vectorize_moe"] = (a.moe == "dense")
if a.emb_fp16: