[TPU] Increase block size and reset block shapes (#16458)

This commit is contained in:
Jevin Jiang
2025-05-06 13:55:04 -04:00
committed by GitHub
parent 6115b11582
commit 621ca2c0ab
5 changed files with 35 additions and 11 deletions
+7
View File
@@ -707,6 +707,13 @@ def cdiv(a: int, b: int) -> int:
return -(a // -b)
def next_power_of_2(n) -> int:
"""The next power of 2 (inclusive)"""
if n < 1:
return 1
return 1 << (n - 1).bit_length()
def round_up(x: int, y: int) -> int:
return ((x + y - 1) // y) * y