[Bugfix][ROCm] Dispatch the QuantFP8 CUDA fallback on the class (#58136)

Signed-off-by: Stefan Koncarevic <Stefan.Koncarevic@amd.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>

stefankoncarevic committed Sep 22, 2026 at 19:49 UTC 72675c4706e4c158a3e363b261370d06ad02c87f
1 file changed +7 -3
vllm/model_executor/layers/quantization/input_quant_fp8.py
+7 -3
@@ -155,8 +155,11 @@ class QuantFP8(CustomOp):
155 if use_aiter_per_token_quant:
156 return rocm_aiter_ops.per_token_quant(x, _FP8_DTYPE, scale)
157
158 - # Fallback to CUDA implementation
159 - return self.forward_cuda(x, scale, scale_ub)
158 + # Fall back to the CUDA implementation. Dispatch on the class, not
159 + # through self: a subclass may override forward_cuda with a different
160 + # signature (_DecodeConcatQuantFP8 does), and a virtual call would
161 + # re-enter it with mismatched arguments.
162 + return QuantFP8.forward_cuda(self, x, scale, scale_ub)
163
164 def forward_xpu(
165 self,
@@ -175,7 +178,8 @@ class QuantFP8(CustomOp):
178 dtype=_FP8_DTYPE,
179 use_ue8m0=self.use_ue8m0,
180 )
178 - return self.forward_cuda(x, scale, scale_ub, use_triton)
181 + # Dispatch on the class, for the same reason as in forward_hip.
182 + return QuantFP8.forward_cuda(self, x, scale, scale_ub, use_triton)
183
184 def forward_native(
185 self,