[AMD] Fix accuracy issue when running TP4 dsv3 model with mtp (#18607)
Co-authored-by: YC Tseng <yctseng@amd.com> Co-authored-by: kkHuang-amd <wunhuang@amd.com>
This commit is contained in:
co-authored by
YC Tseng
kkHuang-amd
parent
d6f0ef677b
commit
e20e6c28b9
@@ -21,7 +21,7 @@ ENV BUILD_TRITON="0"
|
|||||||
ENV BUILD_LLVM="0"
|
ENV BUILD_LLVM="0"
|
||||||
ENV BUILD_AITER_ALL="1"
|
ENV BUILD_AITER_ALL="1"
|
||||||
ENV BUILD_MOONCAKE="1"
|
ENV BUILD_MOONCAKE="1"
|
||||||
ENV AITER_COMMIT="v0.1.10.post2"
|
ENV AITER_COMMIT="v0.1.10.post3"
|
||||||
|
|
||||||
# ===============================
|
# ===============================
|
||||||
# Base image 950 and args
|
# Base image 950 and args
|
||||||
@@ -31,7 +31,7 @@ ENV BUILD_TRITON="0"
|
|||||||
ENV BUILD_LLVM="0"
|
ENV BUILD_LLVM="0"
|
||||||
ENV BUILD_AITER_ALL="1"
|
ENV BUILD_AITER_ALL="1"
|
||||||
ENV BUILD_MOONCAKE="1"
|
ENV BUILD_MOONCAKE="1"
|
||||||
ENV AITER_COMMIT="v0.1.10.post2"
|
ENV AITER_COMMIT="v0.1.10.post3"
|
||||||
# ===============================
|
# ===============================
|
||||||
# Chosen arch and args
|
# Chosen arch and args
|
||||||
FROM ${GPU_ARCH}
|
FROM ${GPU_ARCH}
|
||||||
|
|||||||
@@ -195,11 +195,15 @@ class AiterAttnBackend(AttentionBackend):
|
|||||||
)
|
)
|
||||||
global _use_mla_ps_kernel, fast_mode, intra_batch_mode
|
global _use_mla_ps_kernel, fast_mode, intra_batch_mode
|
||||||
|
|
||||||
|
if self.num_head == 32:
|
||||||
|
fast_mode = True
|
||||||
|
intra_batch_mode = False
|
||||||
|
|
||||||
# current persist a16w16 mla_decode kernel does not support head_num = 128
|
# current persist a16w16 mla_decode kernel does not support head_num = 128
|
||||||
# need to fall back to non-persist
|
# need to fall back to non-persist
|
||||||
# only use mla_ps_kernel when fp8 kv_cache
|
# only use mla_ps_kernel when fp8 kv_cache
|
||||||
# for non-fp8 kv_cache, use non-persist kernel to avoid performance degradation
|
# for non-fp8 kv_cache on tp8, use non-persist kernel to avoid performance degradation
|
||||||
if self.kv_cache_dtype is not fp8_dtype:
|
if self.num_head == 16 and self.kv_cache_dtype is not fp8_dtype:
|
||||||
_use_mla_ps_kernel = False
|
_use_mla_ps_kernel = False
|
||||||
fast_mode = False
|
fast_mode = False
|
||||||
intra_batch_mode = False
|
intra_batch_mode = False
|
||||||
@@ -301,7 +305,7 @@ class AiterAttnBackend(AttentionBackend):
|
|||||||
kv_last_page_len,
|
kv_last_page_len,
|
||||||
self.num_head // nhead_kv,
|
self.num_head // nhead_kv,
|
||||||
nhead_kv,
|
nhead_kv,
|
||||||
True,
|
False,
|
||||||
work_metadata,
|
work_metadata,
|
||||||
work_info_set,
|
work_info_set,
|
||||||
work_indptr,
|
work_indptr,
|
||||||
|
|||||||
Reference in New Issue
Block a user