[Bugfix][MiniMax-M3] Fix token-major top-k buffer handling in Triton … (#49149)
Signed-off-by: rongfu.leng <lenronfu@gmail.com>
This commit is contained in:
@@ -384,7 +384,14 @@ class MiniMaxM3SparseTritonImpl(MiniMaxM3SparseImpl):
|
||||
nd = main_md.num_decode_tokens
|
||||
num_tokens = main_md.num_actual_tokens
|
||||
# Indexer top-k from the shared buffer: decode [:, :nd], prefill [:, nd:].
|
||||
topk = layer.topk_indices_buffer # type: ignore[attr-defined]
|
||||
topk_buffer = layer.topk_indices_buffer # type: ignore[attr-defined]
|
||||
assert topk_buffer is not None
|
||||
|
||||
topk = (
|
||||
topk_buffer
|
||||
if current_platform.is_rocm()
|
||||
else topk_buffer[:num_tokens].transpose(0, 1)
|
||||
)
|
||||
assert topk is not None
|
||||
hd = self.head_size
|
||||
q = query[:num_tokens].view(-1, self.num_heads, hd)
|
||||
|
||||
Reference in New Issue
Block a user