Skip to content

Commit 48edab8

Browse files
[Bugfix][Hardware][POWERPC] Fix auto dtype failure in case of POWER10 (#11331)
Signed-off-by: Akash Kaothalkar <0052v2@linux.vnet.ibm.com>
1 parent a985f7a commit 48edab8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

vllm/config.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from vllm.model_executor.layers.quantization import (QUANTIZATION_METHODS,
2323
get_quantization_config)
2424
from vllm.model_executor.models import ModelRegistry
25-
from vllm.platforms import current_platform
25+
from vllm.platforms import current_platform, interface
2626
from vllm.tracing import is_otel_available, otel_import_error_traceback
2727
from vllm.transformers_utils.config import (
2828
ConfigFormat, get_config, get_hf_image_processor_config,
@@ -2199,6 +2199,17 @@ def _get_and_verify_dtype(
21992199
else:
22002200
torch_dtype = config_dtype
22012201

2202+
if (current_platform.is_cpu()
2203+
and current_platform.get_cpu_architecture()
2204+
== interface.CpuArchEnum.POWERPC
2205+
and (config_dtype == torch.float16
2206+
or config_dtype == torch.float32)):
2207+
logger.info(
2208+
"For POWERPC, we cast models to bfloat16 instead of "
2209+
"using float16 by default. Float16 is not currently "
2210+
"supported for POWERPC.")
2211+
torch_dtype = torch.bfloat16
2212+
22022213
if current_platform.is_hpu() and config_dtype == torch.float16:
22032214
logger.info(
22042215
"For HPU, we cast models to bfloat16 instead of"

0 commit comments

Comments
 (0)