File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 22
22
from vllm .model_executor .layers .quantization import (QUANTIZATION_METHODS ,
23
23
get_quantization_config )
24
24
from vllm .model_executor .models import ModelRegistry
25
- from vllm .platforms import current_platform
25
+ from vllm .platforms import current_platform , interface
26
26
from vllm .tracing import is_otel_available , otel_import_error_traceback
27
27
from vllm .transformers_utils .config import (
28
28
ConfigFormat , get_config , get_hf_image_processor_config ,
@@ -2199,6 +2199,17 @@ def _get_and_verify_dtype(
2199
2199
else :
2200
2200
torch_dtype = config_dtype
2201
2201
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
+
2202
2213
if current_platform .is_hpu () and config_dtype == torch .float16 :
2203
2214
logger .info (
2204
2215
"For HPU, we cast models to bfloat16 instead of"
You can’t perform that action at this time.
0 commit comments