@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 0308901975
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 10, 09:00 UTC

[2/N][Attention] Fix pre-commit errors (#32052)

Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>

Matthew Bonanni committed Jan 9, 2026 at 19:27 UTC 03089019759b4e9af69c160ad0c516e3dcdb1420
3 files changed +6 -16
tools/pre_commit/mypy.py
-2
@@ -74,8 +74,6 @@ EXCLUDE = [
74 "vllm/model_executor/layers/fla/ops",
75 # Ignore triton kernels in ops.
76 "vllm/v1/attention/ops",
77 - # TODO(matt): remove.
78 - "vllm/v1/attention/backends/fa_utils.py",
77 ]
78
79
vllm/v1/attention/backends/fa_utils.py
+4 -8
@@ -7,10 +7,7 @@ from vllm.platforms import current_platform
7 logger = init_logger(__name__)
8
9 if current_platform.is_cuda():
10 - from vllm import _custom_ops
11 -
12 - ops = _custom_ops
13 - reshape_and_cache_flash = ops.reshape_and_cache_flash
10 + from vllm._custom_ops import reshape_and_cache_flash
11 from vllm.vllm_flash_attn import ( # type: ignore[attr-defined]
12 flash_attn_varlen_func,
13 get_scheduler_metadata,
@@ -19,10 +16,9 @@ if current_platform.is_cuda():
16 elif current_platform.is_xpu():
17 from vllm._ipex_ops import ipex_ops
18
22 - ops = ipex_ops
23 - reshape_and_cache_flash = ops.reshape_and_cache_flash
24 - flash_attn_varlen_func = ops.flash_attn_varlen_func
25 - get_scheduler_metadata = ops.get_scheduler_metadata
19 + reshape_and_cache_flash = ipex_ops.reshape_and_cache_flash
20 + flash_attn_varlen_func = ipex_ops.flash_attn_varlen_func
21 + get_scheduler_metadata = ipex_ops.get_scheduler_metadata
22
23 elif current_platform.is_rocm():
24 try:
vllm/v1/attention/ops/paged_attn.py
+2 -6
@@ -7,13 +7,9 @@ import torch
7 from vllm.platforms import current_platform
8
9 if current_platform.is_cuda_alike():
10 - from vllm import _custom_ops
11 -
12 - ops = _custom_ops
10 + from vllm import _custom_ops as ops
11 elif current_platform.is_xpu():
14 - from vllm._ipex_ops import ipex_ops
15 -
16 - ops = ipex_ops
12 + from vllm._ipex_ops import ipex_ops as ops # type: ignore[no-redef]
13
14
15 class PagedAttention: