diff --git a/Source/Cmlx/include-framework/Metal.hpp b/Source/Cmlx/include-framework/Metal.hpp index 944c1ca1b..02c3b255b 100644 --- a/Source/Cmlx/include-framework/Metal.hpp +++ b/Source/Cmlx/include-framework/Metal.hpp @@ -2,7 +2,7 @@ // // Metal.hpp.in // -// Autogenerated from commit 50f13c0834b2edb4aa4bc02d63b98408268f2ace. +// Autogenerated from commit a16d2deb5318fd4f6c056ddc89f6e253196ff58d. // // Copyright 2020-2024 Apple Inc. // diff --git a/Source/Cmlx/mlx b/Source/Cmlx/mlx index c134ee26d..6779ccbae 160000 --- a/Source/Cmlx/mlx +++ b/Source/Cmlx/mlx @@ -1 +1 @@ -Subproject commit c134ee26d066da49c97d15787fb18bb024870411 +Subproject commit 6779ccbae54eddc5cf729f9cd39d57b64af79645 diff --git a/Source/Cmlx/mlx-generated/metal/quantized.h b/Source/Cmlx/mlx-generated/metal/quantized.h index 13ceab6a7..13197bcd8 100644 --- a/Source/Cmlx/mlx-generated/metal/quantized.h +++ b/Source/Cmlx/mlx-generated/metal/quantized.h @@ -874,9 +874,8 @@ METAL_FUNC void qmv_quad_impl( const device T* sl = scales + row * in_vec_size_g * quads_per_simd; const device T* bl = biases + row * in_vec_size_g * quads_per_simd; - // Rows past out_vec_size exist only on a ragged last tile (N % 64 != 0): - // read no scale or bias for them (gemma4-qat#302; the store below was - // already guarded). + // Rows past out_vec_size occur only on a ragged last tile: skip their + // scale and bias reads. if (row * quads_per_simd + out_row < out_vec_size) { U s = sl[0]; U b = affine_bias(s, f, sl[0], bl); diff --git a/Source/Cmlx/mlx-generated/metal/spec_decode.metal b/Source/Cmlx/mlx-generated/metal/spec_decode.metal index e87694570..284fafe73 100644 --- a/Source/Cmlx/mlx-generated/metal/spec_decode.metal +++ b/Source/Cmlx/mlx-generated/metal/spec_decode.metal @@ -6,12 +6,8 @@ using namespace metal; -// Greedy speculative-decoding verify, one thread per batch row. -// draft [B, K] int32 — drafted tokens -// target [B, K+1] int32 — target argmax tokens over [last] + draft -// Writes: -// n_accepted [B] — longest matching prefix length (0..K) -// committed [B, K+1] — draft prefix (< n) then the corrected token at n. +// Greedy speculative-decode verify, one thread per row: n_accepted is the +// matching draft prefix length, committed is that prefix then the target token. [[kernel]] void spec_decode_verify( const device int* draft [[buffer(0)]], const device int* target [[buffer(1)]], diff --git a/Source/Cmlx/mlx-generated/quantized.cpp b/Source/Cmlx/mlx-generated/quantized.cpp index f13d73693..d08a37dfe 100644 --- a/Source/Cmlx/mlx-generated/quantized.cpp +++ b/Source/Cmlx/mlx-generated/quantized.cpp @@ -887,9 +887,8 @@ METAL_FUNC void qmv_quad_impl( const device T* sl = scales + row * in_vec_size_g * quads_per_simd; const device T* bl = biases + row * in_vec_size_g * quads_per_simd; - // Rows past out_vec_size exist only on a ragged last tile (N % 64 != 0): - // read no scale or bias for them (gemma4-qat#302; the store below was - // already guarded). + // Rows past out_vec_size occur only on a ragged last tile: skip their + // scale and bias reads. if (row * quads_per_simd + out_row < out_vec_size) { U s = sl[0]; U b = affine_bias(s, f, sl[0], bl);