Skip to content

armgit / uzu

Public Imported from GitHub
0

A high-performance inference engine for AI models

Support draft vocabulary prefixes (#1008)

CCYeh0f6405cc3b50
diff --git a/crates/uzu-engine/src/backends/metal/kernel/matmul/gemv/gemv.metal b/crates/uzu-engine/src/backends/metal/kernel/matmul/gemv/gemv.metal
index 65050b21f..6be69842c 100644
--- a/crates/uzu-engine/src/backends/metal/kernel/matmul/gemv/gemv.metal
+++ b/crates/uzu-engine/src/backends/metal/kernel/matmul/gemv/gemv.metal
@@ -134,8 +134,10 @@ KERNEL(Gemv)(
dispatch_bool(full_tile, [&](auto full_tile_constant) {
constexpr bool FullTile = decltype(full_tile_constant)::value;
using Tile = GemvTile<INPUT_ROW_TILE, OUTPUT_ROW_TILE, REDUCTION_LANES, GROUP_LANES, NUM_SIMDGROUPS, K_SPLIT>;
+ const uint traversed_rows =
+ gemm_b_layout == GemmBLayout::MxuTiled && !gathered ? ((out_vec_size + 31) / 32) * 32 : out_vec_size;
const OutputTile<Tile, FullTile> tile =
- OutputTile<Tile, FullTile>::make(output_tile_idx, input_tile_idx, simd_group, simd_lane, out_vec_size);
+ OutputTile<Tile, FullTile>::make(output_tile_idx, input_tile_idx, simd_group, simd_lane, traversed_rows);
thread float result[Tile::INPUT_ROWS][Tile::ROWS_PER_LANE] = {{0}};
if constexpr (BITS == 0) {
diff --git a/crates/uzu-engine/src/backends/metal/kernel/matmul/gemv/kernel.rs b/crates/uzu-engine/src/backends/metal/kernel/matmul/gemv/kernel.rs
index ede302e1b..096060e7f 100644
--- a/crates/uzu-engine/src/backends/metal/kernel/matmul/gemv/kernel.rs
+++ b/crates/uzu-engine/src/backends/metal/kernel/matmul/gemv/kernel.rs
@@ -65,6 +65,7 @@ impl GemvSpecialization {
&& shape.b_prologue == GemmBPrologueKind::ScaleSymmetricDequant
&& shape.m == 1
&& !shape.gathered
+ && shape.n.is_multiple_of(32)
&& bf16_io
&& weights_data_type == DataType::BF16
&& shape.k >= MXU_TILED_KERNEL_MIN_K
@@ -135,7 +136,8 @@ impl GemvSpecialization {
gathered: shape.gathered,
signed_codes: shape.signed_codes,
gemm_b_layout,
- full_tile: full_tile(shape, tile),
+ full_tile: full_tile(shape, tile)
+ && (gemm_b_layout != GemmBLayout::MxuTiled || shape.gathered || shape.n.is_multiple_of(32)),
mxu_tiled_kernel: false,
};
Some(specialization)
@@ -320,7 +322,13 @@ impl GemvKernel {
quantized.zero_point_strides(),
)
});
- let output_group_count = n.div_ceil(specialization.output_row_tile());
+ // Tiled weights permute rows within each physical group of 32.
+ let traversed_rows = if specialization.gemm_b_layout == GemmBLayout::MxuTiled && !specialization.gathered {
+ n.next_multiple_of(32)
+ } else {
+ n
+ };
+ let output_group_count = traversed_rows.div_ceil(specialization.output_row_tile());
let context = command_buffer.context();
if specialization.mxu_tiled_kernel {
let MatmulB::Quantized(quantized) = b else {
diff --git a/crates/uzu-engine/src/encodable_block/dflash.rs b/crates/uzu-engine/src/encodable_block/dflash.rs
index 09de58301..0bb5cbda1 100644
--- a/crates/uzu-engine/src/encodable_block/dflash.rs
+++ b/crates/uzu-engine/src/encodable_block/dflash.rs
@@ -54,6 +54,7 @@ pub struct DFlash<B: Backend> {
max_context_length: u32,
block_size: u32,
mask_token_id: u32,
+ vocab_size: u32,
target_feature_input_dim: u32,
data_type: DataType,
}
@@ -184,6 +185,7 @@ impl<B: Backend> DFlash<B> {
max_context_length: *config.rope_config.max_sequence_length(),
block_size: config.block_size,
mask_token_id,
+ vocab_size: config.vocab_size,
target_feature_input_dim: config.model_dim * config.target_layer_ids.len() as u32,
data_type,
})
@@ -348,7 +350,7 @@ impl<B: Backend> DFlash<B> {
let logits = target_embedding.encode_readout(
&lookahead_hidden,
batch_size - 1,
- target_embedding.vocab_size(),
+ self.vocab_size,
None::<&B::ScratchBuffer>,
false,
command_buffer,
diff --git a/crates/uzu-engine/src/encodable_block/embedding.rs b/crates/uzu-engine/src/encodable_block/embedding.rs
index 412c1fe32..fa42855c3 100644
--- a/crates/uzu-engine/src/encodable_block/embedding.rs
+++ b/crates/uzu-engine/src/encodable_block/embedding.rs
@@ -16,7 +16,7 @@ use crate::{
data_type::DataType,
encodable_block::{
embedding_table::{EmbeddingTable, EmbeddingTableError, read_output_signs},
- linear::{Gather, LinearEncodeError, LinearMatmulError, UntiedReadout},
+ linear::{LinearEncodeError, LinearMatmulError, UntiedReadout},
},
safetensors::{ParameterLoaderError, ParameterTree},
};
@@ -83,17 +83,15 @@ impl<B: Backend> Embedding<B> {
vocab_size: u32,
model_dim: u32,
data_type: DataType,
- config: &AnyEmbeddingConfig,
+ embedding_config: &AnyEmbeddingConfig,
parameter_tree: &ParameterTree<'_, B>,
context: &B::Context,
) -> Result<(Self, Option<Arc<B::GlobalGpuBuffer>>), EmbeddingError<B>> {
- if *config.permute_indices() {
- return Err(EmbeddingError::UnsupportedConfiguration(
- "embeddings with permuted vocabulary indices are not supported".into(),
- ));
+ if *embedding_config.permute_indices() {
+ parameter_tree.ignore("index_permutation", &[vocab_size], DataType::I32)?;
}
- let (tying, readout_input_hadamard_factors) = match config {
+ let (tying, readout_input_hadamard_factors) = match embedding_config {
AnyEmbeddingConfig::TiedEmbeddingConfig(_) => {
let embedding_tree = parameter_tree.subtree("embedding");
let table = EmbeddingTable::load(vocab_size, model_dim, data_type, &embedding_tree, context).await?;
@@ -139,9 +137,9 @@ impl<B: Backend> Embedding<B> {
},
};
- let input_scale = config.input_scale().unwrap_or(1.0);
- let logit_scale = config.logit_scale().unwrap_or(1.0);
- let logit_soft_cap = *config.logit_soft_cap();
+ let input_scale = embedding_config.input_scale().unwrap_or(1.0);
+ let logit_scale = embedding_config.logit_scale().unwrap_or(1.0);
+ let logit_soft_cap = *embedding_config.logit_soft_cap();
let logit_transform = if logit_scale != 1.0 || logit_soft_cap.is_some() {
let kernel =
<B::Kernels as Kernels>::LogitTransformKernel::new(context, data_type, logit_soft_cap.is_some())
@@ -205,18 +203,15 @@ impl<B: Backend> Embedding<B> {
) -> Result<B::ScratchBuffer, EmbeddingError<B>> {
let command_buffer = &mut *command_buffer.debug_group("embedding readout");
- assert!(batch_dim > 0 && output_dim > 0, "Embedding readout requires non-empty dimensions");
+ assert!(
+ batch_dim > 0 && output_dim > 0 && (gather_indices.is_some() || output_dim <= self.vocab_size),
+ "invalid embedding readout dimensions"
+ );
let mut output_buffer = match &self.tying {
EmbeddingTying::Untied {
output,
..
- } => {
- let gather = gather_indices.map(|indices| Gather {
- indices,
- output_dim,
- });
- output.encode(input_buffer, batch_dim, gather, command_buffer)?
- },
+ } => output.encode(input_buffer, batch_dim, output_dim, gather_indices, command_buffer)?,
EmbeddingTying::Tied {
table,
readout,
diff --git a/crates/uzu-engine/src/encodable_block/linear/matmul.rs b/crates/uzu-engine/src/encodable_block/linear/matmul.rs
index 9e2679be5..fee4187a9 100644
--- a/crates/uzu-engine/src/encodable_block/linear/matmul.rs
+++ b/crates/uzu-engine/src/encodable_block/linear/matmul.rs
@@ -16,7 +16,7 @@ use crate::{
config::weight_matrix::{AnyWeightMatrixSpec, Layout},
data_type::DataType,
encodable_block::{
- linear::{Gather, Linear, LinearEncodeError, LinearInput},
+ linear::{Linear, LinearEncodeError, LinearInput},
weight_matrix::{WeightMatrix, WeightMatrixError},
},
safetensors::{ParameterLoaderError, ParameterTree},
@@ -68,8 +68,6 @@ async fn load_biases<B: Backend>(
}
impl<B: Backend> LinearMatmul<B> {
- /// Loads a linear over any parsed spec — full precision, MLX or Int. Hybrid
- /// compositions live in the wrappers, not here.
pub async fn load(
input_dim: u32,
output_dim: u32,
@@ -134,11 +132,10 @@ impl<B: Backend> LinearMatmul<B> {
&self,
a: MatmulA<impl BufferRef<Backend = B>>,
batch_dim: u32,
- gather: Option<Gather<impl BufferRef<Backend = B>>>,
+ output_dim: u32,
+ gather_indices: Option<impl BufferRef<Backend = B>>,
command_buffer: &mut <B::CommandBuffer as CommandBuffer>::Encoding,
) -> Result<B::ScratchBuffer, LinearEncodeError<B>> {
- let (output_dim, gather_indices) =
- gather.map_or((self.output_dim, None), |gather| (gather.output_dim, Some(gather.indices)));
let mut output = command_buffer
.allocate_scratch_for_shape(&[batch_dim, output_dim], self.output_data_type)
.map_err(LinearEncodeError::Backend)?;
@@ -207,15 +204,17 @@ impl<B: Backend> Linear<B> for LinearMatmul<B> {
batch_dim: u32,
command_buffer: &mut <B::CommandBuffer as CommandBuffer>::Encoding,
) -> Result<B::ScratchBuffer, LinearEncodeError<B>> {
- self.encode_with_a(input.as_ref(), batch_dim, None::<Gather<&B::ScratchBuffer>>, command_buffer)
+ self.encode_with_a(input.as_ref(), batch_dim, self.output_dim, None::<&B::ScratchBuffer>, command_buffer)
}
fn select_activation_format(
&self,
batch_dim: u32,
+ output_dim: Option<u32>,
context: &B::Context,
) -> ActivationFormat {
- let shape = self.matmul_shape(batch_dim, ActivationFormat::Bf16);
+ let mut shape = self.matmul_shape(batch_dim, ActivationFormat::Bf16);
+ shape.n = output_dim.unwrap_or(self.output_dim);
self.kernel.lock().select_activation_format(
&shape,
self.matmul_b().weights_layout(),
diff --git a/crates/uzu-engine/src/encodable_block/linear/mod.rs b/crates/uzu-engine/src/encodable_block/linear/mod.rs
index c5afbe7e2..bfd717f50 100644
--- a/crates/uzu-engine/src/encodable_block/linear/mod.rs
+++ b/crates/uzu-engine/src/encodable_block/linear/mod.rs
@@ -12,7 +12,7 @@ pub use untied_readout::UntiedReadout;
use crate::{
backends::common::{
- Backend, BufferRef, CommandBuffer, Kernels,
+ Backend, CommandBuffer, Kernels,
gpu_types::hadamard_order::HADAMARD_TRANSFORM_BLOCK_SIZE,
kernel::matmul::{ActivationFormat, MatmulA, MatmulKernel},
},
@@ -52,6 +52,7 @@ pub trait Linear<B: Backend>: Send + Sync {
fn select_activation_format(
&self,
_batch_dim: u32,
+ _output_dim: Option<u32>,
_context: &B::Context,
) -> ActivationFormat {
ActivationFormat::Bf16
@@ -60,11 +61,6 @@ pub trait Linear<B: Backend>: Send + Sync {
pub type LinearInput<B> = MatmulA<<B as Backend>::ScratchBuffer>;
-pub struct Gather<T: BufferRef> {
- pub indices: T,
- pub output_dim: u32,
-}
-
pub struct LinearInputPreparation<B: Backend> {
pub rht_signs: B::GlobalGpuBuffer,
pub activation_format: ActivationFormat,
diff --git a/crates/uzu-engine/src/encodable_block/linear/rht_wrapper.rs b/crates/uzu-engine/src/encodable_block/linear/rht_wrapper.rs
index c17059acf..a3d5392a8 100644
--- a/crates/uzu-engine/src/encodable_block/linear/rht_wrapper.rs
+++ b/crates/uzu-engine/src/encodable_block/linear/rht_wrapper.rs
@@ -13,7 +13,7 @@ use crate::{
},
data_type::DataType,
encodable_block::linear::{
- Gather, Linear, LinearEncodeError, LinearInput, LinearInputPreparation, LinearMatmul, LinearMatmulError,
+ Linear, LinearEncodeError, LinearInput, LinearInputPreparation, LinearMatmul, LinearMatmulError,
input_rht::InputRht,
},
safetensors::{ParameterLoaderError, ParameterTree},
@@ -231,18 +231,11 @@ impl<B: Backend> Linear<B> for RHTLinearWrapper<B> {
};
let command_buffer = &mut *command_buffer.debug_group("linear (rht)");
- let format = self.inner_linear.select_activation_format(batch_dim, command_buffer.context());
+ let format = self.inner_linear.select_activation_format(batch_dim, None, command_buffer.context());
let input = self
.input_rht
.prepare_in_place(input, batch_dim, format, command_buffer)
.map_err(LinearEncodeError::Backend)?;
- let output = self.inner_linear.encode_with_a(
- input.as_ref(),
- batch_dim,
- None::<Gather<&B::ScratchBuffer>>,
- command_buffer,
- )?;
-
- Ok(output)
+ self.inner_linear.encode_input(input, batch_dim, command_buffer)
}
}
diff --git a/crates/uzu-engine/src/encodable_block/linear/untied_readout.rs b/crates/uzu-engine/src/encodable_block/linear/untied_readout.rs
index 28e2e4ac7..ff90d7cf7 100644
--- a/crates/uzu-engine/src/encodable_block/linear/untied_readout.rs
+++ b/crates/uzu-engine/src/encodable_block/linear/untied_readout.rs
@@ -10,7 +10,7 @@ use crate::{
},
data_type::DataType,
encodable_block::linear::{
- Gather, Linear, LinearEncodeError, LinearInputPreparation, LinearMatmul, LinearMatmulError, input_rht::InputRht,
+ Linear, LinearEncodeError, LinearInputPreparation, LinearMatmul, LinearMatmulError, input_rht::InputRht,
},
safetensors::ParameterTree,
};
@@ -82,20 +82,21 @@ impl<B: Backend> UntiedReadout<B> {
&self,
input: impl BufferRef<Backend = B>,
batch_dim: u32,
- gather: Option<Gather<impl BufferRef<Backend = B>>>,
+ output_dim: u32,
+ gather_indices: Option<impl BufferRef<Backend = B>>,
command_buffer: &mut <B::CommandBuffer as CommandBuffer>::Encoding,
) -> Result<B::ScratchBuffer, LinearEncodeError<B>> {
let Some(input_rht) = &self.input_rht else {
let a = MatmulA::full_precision(input);
- return self.linear.encode_with_a(a, batch_dim, gather, command_buffer);
+ return self.linear.encode_with_a(a, batch_dim, output_dim, gather_indices, command_buffer);
};
- let format = if gather.is_some() {
+ let format = if gather_indices.is_some() {
ActivationFormat::Bf16
} else {
- self.linear.select_activation_format(batch_dim, command_buffer.context())
+ self.linear.select_activation_format(batch_dim, Some(output_dim), command_buffer.context())
};
let input = input_rht.prepare(input, batch_dim, format, command_buffer).map_err(LinearEncodeError::Backend)?;
- self.linear.encode_with_a(input.as_ref(), batch_dim, gather, command_buffer)
+ self.linear.encode_with_a(input.as_ref(), batch_dim, output_dim, gather_indices, command_buffer)
}
}
diff --git a/crates/uzu-engine/src/encodable_block/mlp/dense.rs b/crates/uzu-engine/src/encodable_block/mlp/dense.rs
index 99f17292b..75f689e60 100644
--- a/crates/uzu-engine/src/encodable_block/mlp/dense.rs
+++ b/crates/uzu-engine/src/encodable_block/mlp/dense.rs
@@ -89,7 +89,7 @@ impl<B: Backend> Mlp<B> for DenseMlp<B> {
let command_buffer = &mut *command_buffer.debug_group("mlp (dense)");
let fused_up = self.up.encode(input, batch_dim, command_buffer)?;
- let act_format = self.down.select_activation_format(batch_dim, command_buffer.context());
+ let act_format = self.down.select_activation_format(batch_dim, None, command_buffer.context());
let down_input = self
.gate
.encode_for_linear(&fused_up, batch_dim, act_format, command_buffer)
diff --git a/crates/uzu-engine/src/encodable_block/weaver.rs b/crates/uzu-engine/src/encodable_block/weaver.rs
index 714f95595..8c3ad5391 100644
--- a/crates/uzu-engine/src/encodable_block/weaver.rs
+++ b/crates/uzu-engine/src/encodable_block/weaver.rs
@@ -140,6 +140,7 @@ pub struct Weaver<B: Backend> {
target_model_dim: u32,
max_depth: u32,
candidate_pool_size: u32,
+ vocab_size: u32,
}
struct PrefixUnrotation<B: Backend> {
@@ -163,7 +164,7 @@ pub enum WeaverNewError<B: Backend> {
InvalidLayerCount,
#[error("model_dim must be divisible by num_heads")]
InvalidHeadConfig,
- #[error("candidate_pool_size must be in 1..={max}, got {0}", max = CANDIDATES_MAX)]
+ #[error("candidate_pool_size must fit the vocabulary and be in 1..={max}, got {0}", max = CANDIDATES_MAX)]
InvalidCandidatePoolSize(u32),
#[error("rope head_dim {actual} does not match model_dim / num_heads = {expected}")]
InvalidRopeHeadDim {
@@ -197,6 +198,7 @@ pub enum WeaverEncodeError<B: Backend> {
impl<B: Backend> Weaver<B> {
pub async fn new(
+ vocab_size: u32,
config: &WeaverConfig,
readout_input_hadamard_factors: Option<Arc<B::GlobalGpuBuffer>>,
parameter_tree: &ParameterTree<'_, B>,
@@ -208,7 +210,10 @@ impl<B: Backend> Weaver<B> {
if config.num_heads == 0 || !config.model_dim.is_multiple_of(config.num_heads) {
return Err(WeaverNewError::InvalidHeadConfig);
}
- if config.candidate_pool_size == 0 || config.candidate_pool_size > CANDIDATES_MAX {
+ if config.candidate_pool_size == 0
+ || config.candidate_pool_size > CANDIDATES_MAX
+ || config.candidate_pool_size > vocab_size
+ {
return Err(WeaverNewError::InvalidCandidatePoolSize(config.candidate_pool_size));
}
let head_dim = config.model_dim / config.num_heads;
@@ -349,6 +354,7 @@ impl<B: Backend> Weaver<B> {
target_model_dim: config.target_model_dim,
max_depth: config.max_depth,
candidate_pool_size: config.candidate_pool_size,
+ vocab_size,
})
}
@@ -668,7 +674,7 @@ impl<B: Backend> Weaver<B> {
// Rank the draft logits: the top `candidate_pool_size` tokens per
// lookahead row form the candidate pool node expansions draw from.
- let vocab_size = target_embedding.vocab_size();
+ let vocab_size = self.vocab_size;
assert!(
logits.size() >= size_for_shape(&[pool_depth_count, vocab_size], DATA_TYPE),
"draft logits do not cover the lookahead rows"
diff --git a/crates/uzu-engine/src/speculators/dflash_tfm.rs b/crates/uzu-engine/src/speculators/dflash_tfm.rs
index fff097ae1..89f239509 100644
--- a/crates/uzu-engine/src/speculators/dflash_tfm.rs
+++ b/crates/uzu-engine/src/speculators/dflash_tfm.rs
@@ -117,6 +117,7 @@ impl<B: Backend> DFlashTfmSpeculator<B> {
let AnySpeculatorConfig::DFlashSpeculatorConfig(config) =
serde_json::from_slice(&file::read(model_path.join("config.json")).await?)?;
+ let draft_vocab_size = config.draft_config.vocab_size;
let weight_loader = ParameterLoader::new(model_path.join("model.safetensors"), &*context).await?;
let speculator_tree = weight_loader.tree();
@@ -132,6 +133,7 @@ impl<B: Backend> DFlashTfmSpeculator<B> {
let weaver = if let Some(weaver_config) = &config.weaver_config {
Some(
Weaver::new(
+ draft_vocab_size,
weaver_config,
target_embedding.readout_input_hadamard_factors(),
&speculator_tree.subtree("weaver"),
@@ -158,7 +160,7 @@ impl<B: Backend> DFlashTfmSpeculator<B> {
weight_loader.assert_all_tensors_read()?;
- let sampling = Sampling::new(config.draft_config.vocab_size, data_type);
+ let sampling = Sampling::new(draft_vocab_size, data_type);
Ok(Some(Self {
context,
diff --git a/crates/uzu-engine/unit/backends/metal/kernel/matmul/quant_dispatch_test.rs b/crates/uzu-engine/unit/backends/metal/kernel/matmul/quant_dispatch_test.rs
index fa64a3a9a..f56aae1f8 100644
--- a/crates/uzu-engine/unit/backends/metal/kernel/matmul/quant_dispatch_test.rs
+++ b/crates/uzu-engine/unit/backends/metal/kernel/matmul/quant_dispatch_test.rs
@@ -381,6 +381,8 @@ fn cpu_group_major_quantized_gemm_matches_row_major() {
#[case::group_output_padded_n(GroupOutput, 192, 66, 64, 4, ScaleZeroPoint, 66)]
#[case::output_group_bias_prefix(OutputGroup, 128, 12, 32, 4, ScaleBias, 4)]
#[case::group_output_bias_prefix(GroupOutput, 128, 12, 32, 4, ScaleBias, 4)]
+#[case::output_group_zero_point_odd_prefix(OutputGroup, 128, 64, 64, 4, ScaleZeroPoint, 19)]
+#[case::group_output_zero_point_odd_prefix(GroupOutput, 128, 64, 64, 4, ScaleZeroPoint, 19)]
fn quant_gemm_parameter_layout_prefix_matches_cpu(
#[case] params_layout: QuantParamsLayout,
#[case] k: u32,
@@ -650,6 +652,43 @@ fn a8w_mxu_output_bias_parity_bf16(
);
}
+#[uzu_test]
+fn gemv_mxu_tiled_prefix_preserves_output_bounds() {
+ let context = block_on(MetalContext::new()).expect("Metal context");
+ if !context.supports_mxu {
+ return;
+ }
+ let mut matmul = MatmulMetalKernel::new(&context, DataType::BF16, DataType::BF16, DataType::BF16).unwrap();
+ for m in [1, 4] {
+ let input = QuantInput::<bf16>::new(m, 2048, 2080, 64, 8, QuantizationMethod::ScaleSymmetric, 0)
+ .with_group_output()
+ .with_signed_weight_codes();
+ let expected_full = run_quant_cpu(&input);
+ let mut buffers = QuantBuffers::<Metal, bf16>::allocate(&context, &input);
+ tile_weights(&matmul, &mut buffers, &input, &context);
+ for width in [16, 19, 33, 2049] {
+ let sentinel = bf16::from_f32(-123.0);
+ let output_len = (m * width) as usize;
+ buffers.y = create_buffer_with_data::<Metal, bf16>(&context, &vec![sentinel; output_len + 32]);
+ let mut commands = context.create_command_buffer(None, None).unwrap();
+ let mut args = quant_arguments(&mut buffers, &input);
+ args.n = width;
+ matmul.encode(args, &mut commands).unwrap();
+ block_on(commands.end_encoding().submit().wait_until_completed()).unwrap();
+ let actual = buffer_to_vec::<Metal, bf16>(&context, &buffers.y);
+ let expected: Vec<_> = expected_full
+ .chunks_exact(input.n as usize)
+ .flat_map(|row| row[..width as usize].iter().copied())
+ .collect();
+ assert_parity(&format!("tiled prefix m={m} n={width}"), &expected, &actual[..output_len], 0.05, 0.5);
+ assert!(
+ actual[output_len..].iter().all(|value| *value == sentinel),
+ "prefix wrote past output m={m} n={width}"
+ );
+ }
+ }
+}
+
#[rstest]
#[test_attr(uzu_test)]
#[case::w4_zp_gs64(1024u32, 1024u32, 64u32, 4u32, ScaleZeroPoint)]