mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 15:04:53 +08:00
[Bug] Enforce contiguous input for dynamic_scaled_fp8_quant and static_scaled_fp8_quant (#21773)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
parent
b361f14e39
commit
e0e58f9729
@ -1282,10 +1282,11 @@ def scaled_fp8_quant(
|
|||||||
output, input.contiguous(), scale, scale_ub)
|
output, input.contiguous(), scale, scale_ub)
|
||||||
else:
|
else:
|
||||||
scale = torch.zeros(1, device=input.device, dtype=torch.float32)
|
scale = torch.zeros(1, device=input.device, dtype=torch.float32)
|
||||||
torch.ops._C.dynamic_scaled_fp8_quant(output, input, scale)
|
torch.ops._C.dynamic_scaled_fp8_quant(output, input.contiguous(),
|
||||||
|
scale)
|
||||||
else:
|
else:
|
||||||
assert scale.numel() == 1, f"{scale.shape}"
|
assert scale.numel() == 1, f"{scale.shape}"
|
||||||
torch.ops._C.static_scaled_fp8_quant(output, input, scale)
|
torch.ops._C.static_scaled_fp8_quant(output, input.contiguous(), scale)
|
||||||
|
|
||||||
return output, scale
|
return output, scale
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user