[Hardware][PowerPC] Prioritize bfloat16 for auto dtype on PowerPC (#58528)
Signed-off-by: Akash kaothalkar <akash.kaothalkar@ibm.com> Co-authored-by: Akash kaothalkar <akash.kaothalkar@ibm.com> Co-authored-by: Antigravity <antigravity@google.com> Co-authored-by: Li, Jiang <jiang1.li@intel.com>
Akash kaothalkar committed
Sep 30, 2026 at 14:44 UTC
ae66f9a97c6db39bb7225d7b0569acf6d2fdc300
1 file changed
+7
-1
vllm/config/model.py
+7
-1
@@ -26,7 +26,7 @@ from vllm.config.quantization import QuantizationConfigArgs
26
from vllm.config.scheduler import RunnerType
27
from vllm.config.utils import config, getattr_iter
28
from vllm.logger import init_logger
29
-from vllm.platforms import current_platform
29
+from vllm.platforms import CpuArchEnum, current_platform
30
from vllm.tasks import PoolingTask, ScoreType, SupportedTask
31
from vllm.transformers_utils.config import (
32
ConfigFormat,
@@ -2419,6 +2419,12 @@ def _get_and_verify_dtype(
2419
config_dtype,
2420
is_pooling_model=is_pooling_model,
2421
)
2422
+ if (
2423
+ current_platform.is_cpu()
2424
+ and current_platform.get_cpu_architecture() == CpuArchEnum.POWERPC
2425
+ and torch_dtype in (torch.float16, torch.float32)
2426
+ ):
2427
+ torch_dtype = torch.bfloat16
2428
else:
2429
if dtype not in _STR_DTYPE_TO_TORCH_DTYPE:
2430
raise ValueError(f"Unknown dtype: {dtype!r}")