[ROCm][DSv4] AITER MegaMoE Fixed-Slot Dispatch For DeepSeek-V4 (#61262)

Signed-off-by: Micah Williamson <micah.williamson@amd.com>
This commit is contained in:
Micah Williamson
2026-10-15 19:10:59 +08:00
committed by GitHub
parent 8b27d27402
commit e8e1e96196
3 changed files with 84 additions and 8 deletions
+5
View File
@@ -19,6 +19,11 @@ def next_power_of_2(n: int) -> int:
return 1 if n < 1 else 1 << (n - 1).bit_length()
def prev_power_of_2(n: int) -> int:
"""The previous power of 2 (inclusive)."""
return 0 if n < 1 else 1 << (n.bit_length() - 1)
def round_up(x: int, y: int) -> int:
"""Round up x to the nearest multiple of y."""
return ((x + y - 1) // y) * y