Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Cmlx/include-framework/Metal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Metal.hpp.in
//
// Autogenerated from commit 50f13c0834b2edb4aa4bc02d63b98408268f2ace.
// Autogenerated from commit a16d2deb5318fd4f6c056ddc89f6e253196ff58d.
//
// Copyright 2020-2024 Apple Inc.
//
Expand Down
5 changes: 2 additions & 3 deletions Source/Cmlx/mlx-generated/metal/quantized.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<U, T, bits, false, implied_bias>(s, f, sl[0], bl);
Expand Down
8 changes: 2 additions & 6 deletions Source/Cmlx/mlx-generated/metal/spec_decode.metal
Original file line number Diff line number Diff line change
Expand Up @@ -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)]],
Expand Down
5 changes: 2 additions & 3 deletions Source/Cmlx/mlx-generated/quantized.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<U, T, bits, false, implied_bias>(s, f, sl[0], bl);
Expand Down