From 169cd99e3689f44cef7f334004eeb737a02b233b Mon Sep 17 00:00:00 2001 From: suharvest Date: Sat, 25 Jul 2026 19:52:46 +0800 Subject: [PATCH] fix: guard FP4 data type for TensorRT before 10.8 Signed-off-by: suharvest --- .../fusedNvfp4GemmAllReducePlugin.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpp/plugins/fusedNvfp4GemmAllReducePlugin/fusedNvfp4GemmAllReducePlugin.cpp b/cpp/plugins/fusedNvfp4GemmAllReducePlugin/fusedNvfp4GemmAllReducePlugin.cpp index 6e9866ec..279b2bfb 100644 --- a/cpp/plugins/fusedNvfp4GemmAllReducePlugin/fusedNvfp4GemmAllReducePlugin.cpp +++ b/cpp/plugins/fusedNvfp4GemmAllReducePlugin/fusedNvfp4GemmAllReducePlugin.cpp @@ -215,11 +215,19 @@ bool FusedNvfp4GemmAllReducePlugin::supportsFormatCombination( } if (pos == kFP4_ACT_IDX) { +#if NV_TENSORRT_MAJOR >= 11 || (NV_TENSORRT_MAJOR == 10 && NV_TENSORRT_MINOR >= 8) return desc.type == DataType::kFP4 || desc.type == DataType::kINT8 || desc.type == DataType::kFP8; +#else + return desc.type == DataType::kINT8 || desc.type == DataType::kFP8; +#endif } if (pos == kFP4_WEIGHT_IDX) { +#if NV_TENSORRT_MAJOR >= 11 || (NV_TENSORRT_MAJOR == 10 && NV_TENSORRT_MINOR >= 8) return desc.type == DataType::kFP4 || desc.type == DataType::kINT8 || desc.type == DataType::kFP8; +#else + return desc.type == DataType::kINT8 || desc.type == DataType::kFP8; +#endif } if (pos == kFP4_ACT_SCALE_IDX) {