[ROCm] Fix AITER ops fake impl and minor bugs (#36092)

Signed-off-by: Li <chuali@amd.com>
This commit is contained in:
Chuan (Richard) Li
2026-04-09 17:56:17 -07:00
committed by GitHub
parent 9853a3c159
commit e0613702ad
+8 -4
View File
@@ -336,9 +336,13 @@ def _rocm_aiter_fused_topk_fake(
router_logits: torch.Tensor, router_logits: torch.Tensor,
top_k: int, top_k: int,
gate_up: bool, gate_up: bool,
) -> None: ) -> tuple[torch.Tensor, torch.Tensor]:
# tuple[torch.Tensor, torch.Tensor]: num_tokens = x.shape[0]
pass topk_weights = torch.empty(
(num_tokens, top_k), dtype=torch.float32, device=x.device
)
topk_indices = torch.empty((num_tokens, top_k), dtype=torch.int32, device=x.device)
return topk_weights, topk_indices
# Cache whether aiter supports FP8 MLA parameters # Cache whether aiter supports FP8 MLA parameters
@@ -1918,7 +1922,7 @@ class rocm_aiter_ops:
@staticmethod @staticmethod
def shuffle_weight( def shuffle_weight(
self, tensor: torch.Tensor, layout: tuple[int, int] = (16, 16) tensor: torch.Tensor, layout: tuple[int, int] = (16, 16)
) -> torch.Tensor: ) -> torch.Tensor:
from aiter.ops.shuffle import shuffle_weight from aiter.ops.shuffle import shuffle_weight