A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 5, 17:15 UTC
Fix NaN from stale FP4 scale padding in create_fp4_scale_tensor (#38148)
Signed-off-by: Elvir Crncevic <elvircrn@gmail.com> Co-authored-by: Tyler Michael Smith <tyler@neuralmagic.com>
Elvir Crnčević committed
Apr 1, 2026 at 04:14 UTC
0fab52f0aa0fa34d96f2aefe507283478caa66d4
1 file changed
+2
-2
vllm/_custom_ops.py
+2
-2
@@ -56,11 +56,11 @@ def create_fp4_scale_tensor(
56
rounded_m = round_up(m, 128)
57
scale_n = n // block_size
58
rounded_n = round_up(scale_n, 4)
59
- return torch.empty(
59
+ return torch.zeros(
60
(rounded_m, rounded_n // 4), device=device, dtype=torch.int32
61
)
62
else:
63
- return torch.empty((m, n // block_size), device=device, dtype=torch.uint8)
63
+ return torch.zeros((m, n // block_size), device=device, dtype=torch.uint8)
64
65
66
def create_fp4_output_tensors(