From ae66f9a97c6db39bb7225d7b0569acf6d2fdc300 Mon Sep 17 00:00:00 2001 From: Akash kaothalkar <61960177+Akashcodes732@users.noreply.github.com> Date: Wed, 30 Sep 2026 14:44:17 +0530 Subject: [PATCH] [Hardware][PowerPC] Prioritize bfloat16 for auto dtype on PowerPC (#58528) Signed-off-by: Akash kaothalkar Co-authored-by: Akash kaothalkar Co-authored-by: Antigravity Co-authored-by: Li, Jiang --- vllm/config/model.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vllm/config/model.py b/vllm/config/model.py index 15d046de76..4c9ed9e13f 100644 --- a/vllm/config/model.py +++ b/vllm/config/model.py @@ -26,7 +26,7 @@ from vllm.config.quantization import QuantizationConfigArgs from vllm.config.scheduler import RunnerType from vllm.config.utils import config, getattr_iter from vllm.logger import init_logger -from vllm.platforms import current_platform +from vllm.platforms import CpuArchEnum, current_platform from vllm.tasks import PoolingTask, ScoreType, SupportedTask from vllm.transformers_utils.config import ( ConfigFormat, @@ -2419,6 +2419,12 @@ def _get_and_verify_dtype( config_dtype, is_pooling_model=is_pooling_model, ) + if ( + current_platform.is_cpu() + and current_platform.get_cpu_architecture() == CpuArchEnum.POWERPC + and torch_dtype in (torch.float16, torch.float32) + ): + torch_dtype = torch.bfloat16 else: if dtype not in _STR_DTYPE_TO_TORCH_DTYPE: raise ValueError(f"Unknown dtype: {dtype!r}")