From c9a9db0e023a03f7e2c40e43be302fb07512946a Mon Sep 17 00:00:00 2001 From: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Date: Wed, 1 Apr 2026 14:28:57 -0400 Subject: [PATCH] [Compile] Fix nvfp4 compile warning (#38573) Signed-off-by: yewentao256 --- .../quantization/fp4/nvfp4_quant_entry.cu | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/csrc/libtorch_stable/quantization/fp4/nvfp4_quant_entry.cu b/csrc/libtorch_stable/quantization/fp4/nvfp4_quant_entry.cu index 4adc624376..8d4ba1accc 100644 --- a/csrc/libtorch_stable/quantization/fp4/nvfp4_quant_entry.cu +++ b/csrc/libtorch_stable/quantization/fp4/nvfp4_quant_entry.cu @@ -58,16 +58,19 @@ void silu_and_mul_scaled_fp4_experts_quant_sm1xxa( torch::stable::Tensor const& output_scale_offset_by_experts); #endif +#if (defined(ENABLE_NVFP4_SM100) && ENABLE_NVFP4_SM100) || \ + (defined(ENABLE_NVFP4_SM120) && ENABLE_NVFP4_SM120) static bool nvfp4_quant_sm_supported() { const int32_t sm = get_sm_version_num(); -#if defined(ENABLE_NVFP4_SM100) && ENABLE_NVFP4_SM100 + #if defined(ENABLE_NVFP4_SM100) && ENABLE_NVFP4_SM100 if (sm >= 100 && sm < 120) return true; -#endif -#if defined(ENABLE_NVFP4_SM120) && ENABLE_NVFP4_SM120 + #endif + #if defined(ENABLE_NVFP4_SM120) && ENABLE_NVFP4_SM120 if (sm >= 120 && sm < 130) return true; -#endif + #endif return false; } +#endif void scaled_fp4_quant_out(torch::stable::Tensor const& input, torch::stable::Tensor const& input_sf,