Skip to content

Commit 67f076f

Browse files
TheTomclaude
andcommitted
fix(metal): disable TurboFlash by default — corrupt output on Apple10
The TurboFlash two-pass fused attention kernel produces garbage output on M5 Max (Apple10/Metal4) for all turbo3 V configs. Disabling by default routes turbo3 through the standard FA path which works correctly. Users can opt-in with TURBO_FLASH=1 for testing/debugging. No perf regression — standard FA path matches TurboFlash speed within noise (~55-57 t/s tg128 for q8_0/turbo3 on M5 Max). Co-Authored-By: tturney@psyguard.ai Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1565920 commit 67f076f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

ggml/src/ggml-metal/ggml-metal-ops.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2731,8 +2731,10 @@ static bool ggml_metal_op_flash_attn_ext_use_turbo_flash(const ggml_tensor * op)
27312731
// Check environment variable to force enable (bypasses other checks)
27322732
if (turbo_flash_env && turbo_flash_env[0] == '1') return true;
27332733

2734-
// Default: enabled for all qualifying configurations
2735-
return true;
2734+
// Default: disabled — TurboFlash two-pass kernel produces corrupt output
2735+
// on Apple10 (M5 Max) and possibly other Metal4 GPUs. Use TURBO_FLASH=1
2736+
// to opt-in for testing. See PR #91.
2737+
return false;
27362738
}
27372739

27382740
size_t ggml_metal_op_flash_attn_ext_extra_pad(const ggml_tensor * op) {

0 commit comments

Comments
 (0)