[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>
This commit is contained in:
stefankoncarevic
2026-09-22 17:49:11 +00:00
committed by GitHub
co-authored by Andreas Karatzas
parent 74370a0e30
commit 72675c4706
@@ -155,8 +155,11 @@ class QuantFP8(CustomOp):
if use_aiter_per_token_quant:
return rocm_aiter_ops.per_token_quant(x, _FP8_DTYPE, scale)
# Fallback to CUDA implementation
return self.forward_cuda(x, scale, scale_ub)
# Fall back to the CUDA implementation. Dispatch on the class, not
# through self: a subclass may override forward_cuda with a different
# signature (_DecodeConcatQuantFP8 does), and a virtual call would
# re-enter it with mismatched arguments.
return QuantFP8.forward_cuda(self, x, scale, scale_ub)
def forward_xpu(
self,
@@ -175,7 +178,8 @@ class QuantFP8(CustomOp):
dtype=_FP8_DTYPE,
use_ue8m0=self.use_ue8m0,
)
return self.forward_cuda(x, scale, scale_ub, use_triton)
# Dispatch on the class, for the same reason as in forward_hip.
return QuantFP8.forward_cuda(self, x, scale, scale_ub, use_triton)
def forward_native(
self,