[Bugfix][CPU] Make the Apple Silicon BF16 probe fall back instead of raising (#51627)

Signed-off-by: Kush Zingade <kush.zingade@gmail.com>

Kush Zingade committed Aug 11, 2026 at 21:35 UTC 78e7fdd1ab81d4203a7522c2bf197b3a4b2b48cb
1 file changed +8 -5
vllm/platforms/cpu.py
+8 -5
@@ -54,12 +54,15 @@ class CpuPlatform(Platform):
54 elif self.get_cpu_architecture() == CpuArchEnum.ARM and sys.platform.startswith(
55 "darwin"
56 ):
57 - if (
58 - subprocess.check_output(
59 - ["sysctl -n hw.optional.arm.FEAT_BF16"], shell=True
60 - ).strip()
57 + # sysctl exits non-zero when the OID is absent, so check_output would
58 + # raise instead of letting the fp16/fp32 fallback below run.
59 + bf16 = (
60 + subprocess.run(
61 + ["sysctl", "-n", "hw.optional.arm.FEAT_BF16"], capture_output=True
62 + ).stdout.strip()
63 == b"1"
62 - ):
64 + )
65 + if bf16:
66 return [torch.bfloat16, torch.float16, torch.float32]
67 return [torch.float16, torch.float32]
68 elif self.get_cpu_architecture() == CpuArchEnum.RISCV: