[Performance, Triton] Optimize over mask compute to tl.load in fused_moe_kernel (#1980)

This commit is contained in:
HAI
2024-11-10 18:54:43 -08:00
committed by GitHub
parent 8169c6f4ef
commit 087ab83223
2 changed files with 30 additions and 7 deletions
@@ -507,6 +507,12 @@ def _decode_grouped_att_m_fwd(
num_warps = 4
extra_kargs = {}
if is_hip():
# https://rocm.docs.amd.com/en/docs-6.2.0/how-to/llm-fine-tuning-optimization/optimizing-triton-kernel.html
# https://github.com/triton-lang/triton/blob/main/third_party/amd/backend/compiler.py
extra_kargs = {"waves_per_eu": 4, "matrix_instr_nonkdim": 16, "kpack": 2}
_fwd_grouped_kernel_stage1[grid](
q,
k_buffer,
@@ -532,6 +538,7 @@ def _decode_grouped_att_m_fwd(
num_warps=num_warps,
num_stages=1,
Lk=Lk,
**extra_kargs,
)