You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(xla): fail fast when MLXCEL_XLA_PRECISION=bf16 targets a Metal device #612
On the OpenXLA/IREE Metal target, MLXCEL_XLA_PRECISION=bf16 cannot lower: the metal-spirv GPU target advertises no bf16 compute (compute = fp32|fp16|int64|int32|int16|int8), so the emitter's f32 to bf16vector.bitcast fails to legalize inside iree-compile. Today this surfaces mid-run as a raw multi-line iree-compile legalization dump (failed to legalize operation 'vector.bitcast'), after model load, which is a confusing failure for an operator who just set the env var. Discovered in #575.
Ask
Detect the bf16 + Metal combination up front (at emit/load time, before iree-compile) and fail fast with a single clear, actionable error that points the operator at f16 (the portable low-precision entry on Metal). f16 and f32 on Metal, and bf16 on CUDA/CPU, must be unaffected.
Acceptance
Setting MLXCEL_XLA_PRECISION=bf16 with MLXCEL_XLA_DEVICE=metal errors early with a clear message naming the cause (no bf16 compute on the Metal target) and the fix (use f16), not the raw iree-compile legalization dump.
f16 (the metal default) and explicit f32 on Metal still work and stay token-exact; bf16 still works on CUDA and the CPU (local-task) targets.
Unit test for the guard (device + precision resolution), wired into the normal load/serve path, not a standalone helper.
Activity
feat(xla): fail fast on MLXCEL_XLA_PRECISION=bf16 for Metal targets (#…
feat(xla): fail fast on MLXCEL_XLA_PRECISION=bf16 for Metal targets (l…