The resource that bound a run’s duration, the slowest of the declared
resources even running flat out at its own peak, alongside how fast the
run actually achieved it. Mirrors the selection rule in
throughput::binding_achieved.
A catalogued problem or strategy: stable id, human label, and the typed
payload the category needs to actually run with. Categories build vectors
of these and the registry erases them to ItemDescriptor for callers
that only care about the id/label pair.
Information about a quantized tensor in tests.
This allows marking a tensor as quantized for the kernel dispatcher
while keeping the original unquantized data on the host for reference.
A packed-quantized input born whole: a quantized tensor is one thing (data, scales,
scheme), so the quantized builder mints the pair together,
plus the exact numbers behind both for host references.
The quantized continuation of a TileInputBuilder: the container is fixed
(packed-u32, values-unit declaration, the scheme’s block grid for scales); a content
finalizer fills it and mints the values tile and its scales together: a quantized
tensor is one thing (data, scales, scheme).
A tile-shaped test input: the device buffer plus the logical Space it’s
viewed in. The sub-tile sizes live in the buffer’s trailing dims, so the view
reads them from there.
Fluent builder for a TileInput: a Space, a coarse→fine stack of tiling
levels (each a split or tile), and a data
finalizer that fills the [grid…, level…, finest…] buffer.
Public, string-keyed registry surface. Implemented automatically for any
type that implements Category; categories should implement Category
rather than this trait directly.
Typed per-category definition. Implementors expose their problem and
strategy catalogues with the actual payloads attached, plus a typed
bench closure. The blanket impl below adapts to the string-keyed
BenchmarkCategory consumed by the public registry, so categories no
longer have to write the lookup boilerplate.
Optional correctness surface for a category. Both methods take a seeds
slice instead of fixed seed_lhs/seed_rhs so unary ops use just
seeds[0] and future ops with more inputs can take more seeds without
churning the trait.
The client every category scores against: measure_peak_throughput is
always run on cubecl::test_device(), so the
process-wide peak memo below can key on ThroughputKey alone.
Run launch against client, returning its ExecutionOutcome. A
failure that surfaces only asynchronously is caught by checking outputs —
the buffers the launch was going to write, which carry the failure when it
never ran.
CPU-only routines (e.g. cpu_gemm, where a plane is a thread) compute the wrong result
on a GPU backend. Records a Skipped outcome and returns true when client is not a
CPU backend (num_cpu_cores is None), so the caller can bail out of the test.
A kernel whose levels cut down to units needs a plane wide enough to hold them: a unit level
must partition the plane exactly, so a plane of one unit (what the CPU runtime always reports)
leaves such a partitioning with nothing to cut. Records a Skipped outcome and returns true
when client’s plane is narrower than units, so the caller can bail out of the test.
The timing method a category measures with, overridden for a whole run by
CUBEK_BENCH_TIMING. Device timestamps leave the launch out, so a row that
beats its ceiling is checked by measuring it again on the wall clock.