From 98700c6105b0313d924126cba428219111ee8f6f Mon Sep 17 00:00:00 2001 From: Netanel Haber <58652339+netanel-haber@users.noreply.github.com> Date: Thu, 16 Apr 2026 12:06:51 +0300 Subject: [PATCH] Fix #33773: Replace unconditional pandas import with PlaceholderModule (#39990) Signed-off-by: Netanel Haber <58652339+netanel-haber@users.noreply.github.com> --- vllm/_aiter_ops.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vllm/_aiter_ops.py b/vllm/_aiter_ops.py index d71e210fb5..55d6d1297a 100644 --- a/vllm/_aiter_ops.py +++ b/vllm/_aiter_ops.py @@ -3,18 +3,23 @@ import functools from collections.abc import Callable -import pandas as pd import torch from torch._ops import OpOverload import vllm.envs as envs from vllm.platforms import current_platform +from vllm.utils.import_utils import PlaceholderModule from vllm.utils.torch_utils import direct_register_custom_op from vllm.v1.attention.ops.rocm_aiter_mla_sparse import ( rocm_aiter_sparse_attn_indexer, rocm_aiter_sparse_attn_indexer_fake, ) +try: + import pandas as pd +except ImportError: + pd = PlaceholderModule("pandas") + # fp8_dtype is not cached. # on ROCm the fp8_dtype always calls is_fp8_fnuz # which is a host op, so we cache it once here.