@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / e0e58f9729
Fork 0

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 14, 23:45 UTC

[Bug] Enforce contiguous input for `dynamic_scaled_fp8_quant` and `static_scaled_fp8_quant` (#21773)

Signed-off-by: yewentao256 <zhyanwentao@126.com>

Wentao Ye committed Jul 28, 2025 at 15:55 UTC e0e58f9729e739d857a5ed0d11fc80ea9aa21087
1 file changed +3 -2
vllm/_custom_ops.py
+3 -2
@@ -1282,10 +1282,11 @@ def scaled_fp8_quant(
1282 output, input.contiguous(), scale, scale_ub)
1283 else:
1284 scale = torch.zeros(1, device=input.device, dtype=torch.float32)
1285 - torch.ops._C.dynamic_scaled_fp8_quant(output, input, scale)
1285 + torch.ops._C.dynamic_scaled_fp8_quant(output, input.contiguous(),
1286 + scale)
1287 else:
1288 assert scale.numel() == 1, f"{scale.shape}"
1288 - torch.ops._C.static_scaled_fp8_quant(output, input, scale)
1289 + torch.ops._C.static_scaled_fp8_quant(output, input.contiguous(), scale)
1290
1291 return output, scale
1292