[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user