Module operators
Expand description
Portable executable-operator contracts (W1 / W3).
No heap in apply_into / workspace_requirement. No unsafe.
W3 adds scalar Q4_K activation lookup apply (EOS-030).
Structs§
- Matrix
View - Row-major f32 matrix view (borrowed).
- Matrix
View Mut - Mutable row-major f32 matrix view.
- Operator
Descriptor - Declared operator. Validated before any output write.
- Operator
View - Validated operator: descriptor plus borrowed payloads.
- Operator
Workspace - Borrowed caller buffers. Not grown by the operator.
- Payload
View - One immutable payload segment.
- Workspace
Requirement - Exact scratch the caller must supply. Units are elements (
numeric_f32) and bytes.
Enums§
- Accum
Kind - Accumulation type for
apply_into. - Operator
Error - Recoverable operator contract failure.
- Operator
Kind - Registered representation. Unknown values must fail closed.
- Scale
Layout - How packed scales are stored in the payload.
- Schedule
Kind - Schedule bucket. W1 implements decode batch-1 only.
Constants§
- FLOATS_
PER_ SUBBLOCK_ LUT - Number of f32 elements needed in workspace per 32-element input chunk (1 sum + 32*16 LUT).
- Q4K_
SUPERBLOCK_ BYTES - GGML Q4_K superblock size in bytes.
- Q4K_
SUPERBLOCK_ ELEMS - GGML Q4_K superblock element count.
Functions§
- apply_
into - Overwrite
outputwithY = W Xfor the declared operator. - apply_
q4k_ lookup - Directly evaluate Q4_K matrix-vector multiplication using activation lookups.
- prepare_
q4k_ activation_ table - Precomputes the activation lookup table into
table_out. - q4k_
lookup_ workspace_ floats - Computes the number of workspace f32 floats required for Q4_K activation lookup.
- reconstruct_
q4k_ into - Reconstruct f32 weights from packed GGML Q4_K superblocks into
out. - validate_
operator - Validate shape and payload lengths. Does not write output.
- workspace_
requirement - Bytes required for
batchunderschedule. Does not allocate.