@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 43c146ca42
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[Misc] Clean up unnecessary E501 ignore (#26274)

Signed-off-by: Roger Wang <hey@rogerw.io>

Roger Wang committed Oct 6, 2025 at 00:29 UTC 43c146ca4286efb49f1f15dc46b136b69ee7e684
8 files changed +38 -38
vllm/benchmarks/datasets.py
+2 -2
@@ -626,7 +626,7 @@ class RandomDataset(BenchmarkDataset):
626 # Decode, then re-encode and truncate to preserve token count invariants
627 total_input_len = prefix_len + int(input_len)
628 prompt, adjusted_token_sequence, token_mismatch = (
629 - gen_prompt_decode_to_target_len( # noqa: E501
629 + gen_prompt_decode_to_target_len(
630 tokenizer=tokenizer,
631 token_sequence=token_sequence,
632 target_token_len=total_input_len,
@@ -2855,7 +2855,7 @@ class PrefixRepetitionRandomDataset(BenchmarkDataset):
2855 for _ in range(prompts_per_prefix):
2856 suffix_tokens, token_mistmatch = _generate_exact_length_tokens(
2857 suffix_len
2858 - ) # noqa: E501
2858 + )
2859 token_mismatch_total += token_mistmatch
2860 combined_tokens = prefix_tokens + suffix_tokens
2861 prompt = tokenizer.decode(combined_tokens)
vllm/benchmarks/throughput.py
+2 -2
@@ -459,14 +459,14 @@ def validate_args(args):
459 ):
460 assert args.backend == "vllm-chat", (
461 f"{args.dataset_path} needs to use vllm-chat as the backend."
462 - ) # noqa: E501
462 + )
463 elif args.dataset_path in (
464 InstructCoderDataset.SUPPORTED_DATASET_PATHS
465 | AIMODataset.SUPPORTED_DATASET_PATHS
466 ):
467 assert args.backend == "vllm", (
468 f"{args.dataset_path} needs to use vllm as the backend."
469 - ) # noqa: E501
469 + )
470 else:
471 raise ValueError(f"{args.dataset_path} is not supported by hf dataset.")
472
vllm/compilation/inductor_pass.py
+1 -1
@@ -19,7 +19,7 @@ if is_torch_equal_or_newer("2.6"):
19 from torch._inductor.custom_graph_pass import CustomGraphPass
20 else:
21 # CustomGraphPass is not present in 2.5 or lower, import our version
22 - from .torch25_custom_graph_pass import ( # noqa: E501
22 + from .torch25_custom_graph_pass import (
23 Torch25CustomGraphPass as CustomGraphPass,
24 )
25
vllm/model_executor/layers/quantization/__init__.py
+1 -1
@@ -95,7 +95,7 @@ def get_quantization_config(quantization: str) -> type[QuantizationConfig]:
95 from .awq_marlin import AWQMarlinConfig
96 from .bitblas import BitBLASConfig
97 from .bitsandbytes import BitsAndBytesConfig
98 - from .compressed_tensors.compressed_tensors import ( # noqa: E501
98 + from .compressed_tensors.compressed_tensors import (
99 CompressedTensorsConfig,
100 )
101 from .deepspeedfp import DeepSpeedFPConfig
vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py
+2 -2
@@ -26,7 +26,7 @@ from vllm.model_executor.layers.linear import (
26 UnquantizedLinearMethod,
27 )
28 from vllm.model_executor.layers.quantization import QuantizationMethods
29 -from vllm.model_executor.layers.quantization.base_config import ( # noqa: E501
29 +from vllm.model_executor.layers.quantization.base_config import (
30 QuantizationConfig,
31 QuantizeMethodBase,
32 )
@@ -256,7 +256,7 @@ class CompressedTensorsConfig(QuantizationConfig):
256 )
257 else:
258 target_scheme_map[target]["input_activations"] = (
259 - QuantizationArgs.model_validate( # noqa: E501
259 + QuantizationArgs.model_validate(
260 quant_config.get("input_activations")
261 )
262 )
vllm/model_executor/models/gemma3n_mm.py
+1 -1
@@ -176,7 +176,7 @@ class Gemma3nDummyInputsBuilder(BaseDummyInputsBuilder[Gemma3nProcessingInfo]):
176 processor = self.info.get_hf_processor()
177 audio_feature_extractor: Gemma3nAudioFeatureExtractor = (
178 processor.feature_extractor
179 - ) # noqa: E501
179 + )
180 audio_len = audio_feature_extractor.fft_length
181 image_processor: SiglipImageProcessorFast = processor.image_processor
182 img_width = image_processor.size.get("width", 224)
vllm/model_executor/models/registry.py
+28 -28
@@ -120,7 +120,7 @@ _TEXT_GENERATION_MODELS = {
120 "JambaForCausalLM": ("jamba", "JambaForCausalLM"),
121 "Lfm2ForCausalLM": ("lfm2", "Lfm2ForCausalLM"),
122 "LlamaForCausalLM": ("llama", "LlamaForCausalLM"),
123 - "Llama4ForCausalLM": ("llama4", "Llama4ForCausalLM"), # noqa: E501
123 + "Llama4ForCausalLM": ("llama4", "Llama4ForCausalLM"),
124 # For decapoda-research/llama-*
125 "LLaMAForCausalLM": ("llama", "LlamaForCausalLM"),
126 "LongcatFlashForCausalLM": ("longcat_flash", "LongcatFlashForCausalLM"),
@@ -204,7 +204,7 @@ _EMBEDDING_MODELS = {
204 "LlavaNextForConditionalGeneration": (
205 "llava_next",
206 "LlavaNextForConditionalGeneration",
207 - ), # noqa: E501
207 + ),
208 "Phi3VForCausalLM": ("phi3v", "Phi3VForCausalLM"),
209 "Qwen2VLForConditionalGeneration": ("qwen2_vl", "Qwen2VLForConditionalGeneration"), # noqa: E501
210 # Technically Terratorch models work on images, both in
@@ -240,46 +240,46 @@ _MULTIMODAL_MODELS = {
240 "AyaVisionForConditionalGeneration": (
241 "aya_vision",
242 "AyaVisionForConditionalGeneration",
243 - ), # noqa: E501
243 + ),
244 "Blip2ForConditionalGeneration": ("blip2", "Blip2ForConditionalGeneration"),
245 "ChameleonForConditionalGeneration": (
246 "chameleon",
247 "ChameleonForConditionalGeneration",
248 - ), # noqa: E501
248 + ),
249 "Cohere2VisionForConditionalGeneration": (
250 "cohere2_vision",
251 "Cohere2VisionForConditionalGeneration",
252 - ), # noqa: E501
252 + ),
253 "DeepseekVLV2ForCausalLM": ("deepseek_vl2", "DeepseekVLV2ForCausalLM"),
254 "DotsOCRForCausalLM": ("dots_ocr", "DotsOCRForCausalLM"),
255 "Ernie4_5_VLMoeForConditionalGeneration": (
256 "ernie45_vl",
257 "Ernie4_5_VLMoeForConditionalGeneration",
258 - ), # noqa: E501
258 + ),
259 "FuyuForCausalLM": ("fuyu", "FuyuForCausalLM"),
260 "Gemma3ForConditionalGeneration": ("gemma3_mm", "Gemma3ForConditionalGeneration"), # noqa: E501
261 "Gemma3nForConditionalGeneration": (
262 "gemma3n_mm",
263 "Gemma3nForConditionalGeneration",
264 - ), # noqa: E501
264 + ),
265 "GLM4VForCausalLM": ("glm4v", "GLM4VForCausalLM"),
266 "Glm4vForConditionalGeneration": ("glm4_1v", "Glm4vForConditionalGeneration"), # noqa: E501
267 "Glm4vMoeForConditionalGeneration": ("glm4_1v", "Glm4vMoeForConditionalGeneration"), # noqa: E501
268 "GraniteSpeechForConditionalGeneration": (
269 "granite_speech",
270 "GraniteSpeechForConditionalGeneration",
271 - ), # noqa: E501
271 + ),
272 "H2OVLChatModel": ("h2ovl", "H2OVLChatModel"),
273 "InternVLChatModel": ("internvl", "InternVLChatModel"),
274 "NemotronH_Nano_VL_V2": ("nano_nemotron_vl", "NemotronH_Nano_VL_V2"),
275 "InternS1ForConditionalGeneration": (
276 "interns1",
277 "InternS1ForConditionalGeneration",
278 - ), # noqa: E501
278 + ),
279 "InternVLForConditionalGeneration": (
280 "interns1",
281 "InternS1ForConditionalGeneration",
282 - ), # noqa: E501
282 + ),
283 "Idefics3ForConditionalGeneration": (
284 "idefics3",
285 "Idefics3ForConditionalGeneration",
@@ -289,7 +289,7 @@ _MULTIMODAL_MODELS = {
289 "KeyeVL1_5ForConditionalGeneration": (
290 "keye_vl1_5",
291 "KeyeVL1_5ForConditionalGeneration",
292 - ), # noqa: E501
292 + ),
293 "RForConditionalGeneration": ("rvl", "RForConditionalGeneration"),
294 "KimiVLForConditionalGeneration": ("kimi_vl", "KimiVLForConditionalGeneration"), # noqa: E501
295 "Llama_Nemotron_Nano_VL": ("nemotron_vl", "LlamaNemotronVLChatModel"),
@@ -298,27 +298,27 @@ _MULTIMODAL_MODELS = {
298 "LlavaNextForConditionalGeneration": (
299 "llava_next",
300 "LlavaNextForConditionalGeneration",
301 - ), # noqa: E501
301 + ),
302 "LlavaNextVideoForConditionalGeneration": (
303 "llava_next_video",
304 "LlavaNextVideoForConditionalGeneration",
305 - ), # noqa: E501
305 + ),
306 "LlavaOnevisionForConditionalGeneration": (
307 "llava_onevision",
308 "LlavaOnevisionForConditionalGeneration",
309 - ), # noqa: E501
309 + ),
310 "MantisForConditionalGeneration": ("llava", "MantisForConditionalGeneration"), # noqa: E501
311 "MiDashengLMModel": ("midashenglm", "MiDashengLMModel"),
312 "MiniMaxVL01ForConditionalGeneration": (
313 "minimax_vl_01",
314 "MiniMaxVL01ForConditionalGeneration",
315 - ), # noqa: E501
315 + ),
316 "MiniCPMO": ("minicpmo", "MiniCPMO"),
317 "MiniCPMV": ("minicpmv", "MiniCPMV"),
318 "Mistral3ForConditionalGeneration": (
319 "mistral3",
320 "Mistral3ForConditionalGeneration",
321 - ), # noqa: E501
321 + ),
322 "MolmoForCausalLM": ("molmo", "MolmoForCausalLM"),
323 "NVLM_D": ("nvlm_d", "NVLM_D_Model"),
324 "Ovis": ("ovis", "Ovis"),
@@ -326,7 +326,7 @@ _MULTIMODAL_MODELS = {
326 "PaliGemmaForConditionalGeneration": (
327 "paligemma",
328 "PaliGemmaForConditionalGeneration",
329 - ), # noqa: E501
329 + ),
330 "Phi3VForCausalLM": ("phi3v", "Phi3VForCausalLM"),
331 "Phi4MMForCausalLM": ("phi4mm", "Phi4MMForCausalLM"),
332 "Phi4MultimodalForCausalLM": ("phi4_multimodal", "Phi4MultimodalForCausalLM"), # noqa: E501
@@ -336,31 +336,31 @@ _MULTIMODAL_MODELS = {
336 "Qwen2_5_VLForConditionalGeneration": (
337 "qwen2_5_vl",
338 "Qwen2_5_VLForConditionalGeneration",
339 - ), # noqa: E501
339 + ),
340 "Qwen2AudioForConditionalGeneration": (
341 "qwen2_audio",
342 "Qwen2AudioForConditionalGeneration",
343 - ), # noqa: E501
343 + ),
344 "Qwen2_5OmniModel": (
345 "qwen2_5_omni_thinker",
346 "Qwen2_5OmniThinkerForConditionalGeneration",
347 - ), # noqa: E501
347 + ),
348 "Qwen2_5OmniForConditionalGeneration": (
349 "qwen2_5_omni_thinker",
350 "Qwen2_5OmniThinkerForConditionalGeneration",
351 - ), # noqa: E501
351 + ),
352 "Qwen3VLForConditionalGeneration": ("qwen3_vl", "Qwen3VLForConditionalGeneration"), # noqa: E501
353 "Qwen3VLMoeForConditionalGeneration": (
354 "qwen3_vl_moe",
355 "Qwen3VLMoeForConditionalGeneration",
356 - ), # noqa: E501
356 + ),
357 "SkyworkR1VChatModel": ("skyworkr1v", "SkyworkR1VChatModel"),
358 "Step3VLForConditionalGeneration": ("step3_vl", "Step3VLForConditionalGeneration"), # noqa: E501
359 "TarsierForConditionalGeneration": ("tarsier", "TarsierForConditionalGeneration"), # noqa: E501
360 "Tarsier2ForConditionalGeneration": (
361 "qwen2_vl",
362 "Tarsier2ForConditionalGeneration",
363 - ), # noqa: E501
363 + ),
364 "UltravoxModel": ("ultravox", "UltravoxModel"),
365 "VoxtralForConditionalGeneration": ("voxtral", "VoxtralForConditionalGeneration"), # noqa: E501
366 # [Encoder-decoder]
@@ -401,23 +401,23 @@ _TRANSFORMERS_BACKEND_MODELS = {
401 "TransformersMoEForMultimodalLM": (
402 "transformers_moe",
403 "TransformersMoEForMultimodalLM",
404 - ), # noqa: E501
404 + ),
405 "TransformersEmbeddingModel": (
406 "transformers_pooling",
407 "TransformersEmbeddingModel",
408 - ), # noqa: E501
408 + ),
409 "TransformersForSequenceClassification": (
410 "transformers_pooling",
411 "TransformersForSequenceClassification",
412 - ), # noqa: E501
412 + ),
413 "TransformersMoEForSequenceClassification": (
414 "transformers_pooling",
415 "TransformersMoEForSequenceClassification",
416 - ), # noqa: E501
416 + ),
417 "TransformersMoEEmbeddingModel": (
418 "transformers_pooling",
419 "TransformersMoEEmbeddingModel",
420 - ), # noqa: E501
420 + ),
421 }
422
423 _VLLM_MODELS = {
vllm/v1/attention/backends/gdn_attn.py
+1 -1
@@ -79,7 +79,7 @@ class GDNAttentionMetadataBuilder(AttentionMetadataBuilder[GDNAttentionMetadata]
79 self.speculative_config = vllm_config.speculative_config
80 self.kv_cache_spec = kv_cache_spec
81 if self.speculative_config:
82 - self.num_spec = self.speculative_config.num_speculative_tokens # noqa: E501
82 + self.num_spec = self.speculative_config.num_speculative_tokens
83 else:
84 self.num_spec = 0
85 self.use_spec_decode = self.num_spec > 0