From f0fa0c73e482a956d01cc0ecfe05bb2c6d68bad6 Mon Sep 17 00:00:00 2001 From: Marcin Spoczynski Date: Sat, 24 Oct 2026 00:04:13 -0700 Subject: [PATCH] turbovla: f16 weights and flash attention by default on SYCL TurboVLA keeps F32 weights by default for fidelity (bf16 is ~4e-2 from fp32). On SYCL, F16 weights with flash attention stay within 3.4e-4 of the F32 graph, so that is the default there unless --weight-dtype / --flash-attn are given. Core Ultra 7 356H, 2 views at 256 px, vla-bench p50: 117-128 -> 66-74 ms. LIBERO-object x100: 100/100 in both (median 140 -> 89 ms per request). --- src/models/turbovla.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/models/turbovla.cpp b/src/models/turbovla.cpp index 9909cea..ea45d36 100644 --- a/src/models/turbovla.cpp +++ b/src/models/turbovla.cpp @@ -770,6 +770,20 @@ std::unique_ptr turbovla_create(const std::string& mmproj_path, if (!b.handle) return nullptr; m->backend = b.handle; + // On SYCL, F16-resident weights and flash attention (oneDNN's fused SDPA) + // unless --weight-dtype / --flash-attn say otherwise: 2 views at 256 px go + // from 128 to 74 ms on a Core Ultra 7 356H, with the actions within 3.4e-4 + // of the F32 graph (BF16 weights: 70 ms, but 2.9e-3). + if (b.is_sycl) { + if (!opts.weight_dtype) { + m->mt = GGML_TYPE_F16; + std::printf("vla(turbovla): weights = f16 (SYCL default; --weight-dtype f32 to keep them f32)\n"); + } + if (!opts.flash_attn.has_value() && fa_takes_views()) { + set_flash_attn(true); + std::printf("vla(turbovla): flash attention = on (SYCL default; --flash-attn 0 to disable)\n"); + } + } if (!load_weights(*m, g) || !m->upload_rope_tables()) return nullptr;