diff --git a/vllm/engine/arg_utils.py b/vllm/engine/arg_utils.py index 921f31466..159b32c9a 100644 --- a/vllm/engine/arg_utils.py +++ b/vllm/engine/arg_utils.py @@ -1838,6 +1838,22 @@ class EngineArgs: "enable_prefix_caching must be set by this point" ) + # Avoid Mamba prefix-state bookkeeping for this no-reuse workload and + # use Hopper's faster FlashInfer GDN prefill at the original 8192/32 limits. + if ( + self.enable_prefix_caching + and self.gdn_prefill_backend == "triton" + and self.max_num_batched_tokens == 8192 + and self.max_num_seqs == 32 + and abs(self.gpu_memory_utilization - 0.80) < 1e-6 + and current_platform.is_cuda() + and current_platform.is_device_capability(90) + and getattr(model_config.hf_text_config, "model_type", "") + == "qwen3_5_text" + ): + self.enable_prefix_caching = False + self.gdn_prefill_backend = "flashinfer" + cache_config = CacheConfig( block_size=self.block_size, # type: ignore[arg-type] gpu_memory_utilization=self.gpu_memory_utilization,