File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 7
7
import inspect
8
8
import json
9
9
import re
10
+ import sys
10
11
import textwrap
11
12
import uuid
12
13
import warnings
@@ -3064,7 +3065,7 @@ def _get_and_verify_dtype(
3064
3065
torch_dtype = torch .bfloat16
3065
3066
3066
3067
# Deal with torch dtype fallback for device compatibility.
3067
- from vllm .platforms import current_platform
3068
+ from vllm .platforms import CpuArchEnum , current_platform
3068
3069
if torch_dtype not in current_platform .supported_dtypes :
3069
3070
device_name = current_platform .get_device_name ()
3070
3071
@@ -3088,6 +3089,15 @@ def _get_and_verify_dtype(
3088
3089
"using float16 by default. Please specify `dtype` if you "
3089
3090
"want to use float16." )
3090
3091
torch_dtype = torch .bfloat16
3092
+
3093
+ if (current_platform .is_cpu () and sys .platform .startswith ("darwin" )
3094
+ and current_platform .get_cpu_architecture ()
3095
+ == CpuArchEnum .ARM and config_dtype == torch .bfloat16 ):
3096
+ logger .info (
3097
+ "For macOS with Apple Silicon, currently using float16 "
3098
+ "by default. Please specify `dtype` if you "
3099
+ "want to use bfloat16." )
3100
+ torch_dtype = torch .float16
3091
3101
elif dtype == "float16" and config .model_type == "plamo2" :
3092
3102
logger .warning (
3093
3103
"For PLaMo2, using float16 is unstable and might cause "
You can’t perform that action at this time.
0 commit comments