"refactor: refactor_repeated_interfaces" (#32486)

Signed-off-by: tom-zju <tanjianpingzju1990@gmail.com>
Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
This commit is contained in:
tjp_zju
2026-01-18 22:07:01 +08:00
committed by GitHub
co-authored by Wentao Ye
parent 38bf2ffb21
commit 2f03035a61
11 changed files with 43 additions and 77 deletions
+5 -8
View File
@@ -12,6 +12,7 @@ from vllm.scalar_type import ScalarType
from vllm.utils.flashinfer import (
flashinfer_quant_nvfp4_8x4_sf_layout,
)
from vllm.utils.math_utils import cdiv
logger = init_logger(__name__)
@@ -3111,10 +3112,6 @@ def matmul_ada_mxf4_bf16_tn(
return torch.ops._qutlass_C.matmul_ada_mxf4_bf16_tn(a, b, a_sf, b_sf, alpha)
def ceil_div(a, b):
return (a + b - 1) // b
if hasattr(torch.ops._qutlass_C, "fusedQuantizeMxQuest"):
@register_fake("_qutlass_C::fusedQuantizeMxQuest")
@@ -3148,8 +3145,8 @@ def fusedQuantizeMx(
)
rows, cols = a.numel() // a.size(-1), a.size(-1) // 32
n_row_blocks = ceil_div(rows, 128)
n_col_blocks = ceil_div(cols, 4)
n_row_blocks = cdiv(rows, 128)
n_col_blocks = cdiv(cols, 4)
padded_rows = n_row_blocks * 128
padded_cols = n_col_blocks * 4
@@ -3192,8 +3189,8 @@ def fusedQuantizeNv(
)
rows, cols = a.numel() // a.size(-1), a.size(-1) // 16
n_row_blocks = ceil_div(rows, 128)
n_col_blocks = ceil_div(cols, 4)
n_row_blocks = cdiv(rows, 128)
n_col_blocks = cdiv(cols, 4)
padded_rows = n_row_blocks * 128
padded_cols = n_col_blocks * 4
xh_e4m3 = torch.empty(