From fe32e7830b2f3e799a571373b25fc4563fb05d19 Mon Sep 17 00:00:00 2001 From: Kartavya sonar <117206024+Kartavyasonar@users.noreply.github.com> Date: Tue, 2 Jun 2026 23:20:00 +0530 Subject: [PATCH] [Bugfix] flashinfer: fail fast when --kv-cache-dtype nvfp4 used on unsupported arch (#43669) Signed-off-by: Kartavya Sonar --- vllm/v1/attention/backends/flashinfer.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vllm/v1/attention/backends/flashinfer.py b/vllm/v1/attention/backends/flashinfer.py index a81c5742c1..83e3072546 100755 --- a/vllm/v1/attention/backends/flashinfer.py +++ b/vllm/v1/attention/backends/flashinfer.py @@ -623,6 +623,13 @@ class FlashInferMetadataBuilder(AttentionMetadataBuilder[FlashInferMetadata]): # storage dtype may not be the same as the op dtype (uint8 vs fp8_e4m3) self.is_kvcache_nvfp4 = self.cache_dtype == "nvfp4" if self.is_kvcache_nvfp4: + # trtllm-gen FP4 FMHA kernels only exist for sm100f (sm_100/sm_103). + # Fail fast at init rather than crashing on the first request. + if not current_platform.is_device_capability_family(100): + raise ValueError( + "--kv-cache-dtype nvfp4 requires sm100f, " + "please try a different dtype or remove" + ) # For NVFP4, kv_cache_dtype stays as the string "nvfp4" # which is passed to FlashInferImpl self.kv_cache_dtype = self.cache_dtype