Skip to main content

Module operators

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§

MatrixView
Row-major f32 matrix view (borrowed).
MatrixViewMut
Mutable row-major f32 matrix view.
OperatorDescriptor
Declared operator. Validated before any output write.
OperatorView
Validated operator: descriptor plus borrowed payloads.
OperatorWorkspace
Borrowed caller buffers. Not grown by the operator.
PayloadView
One immutable payload segment.
WorkspaceRequirement
Exact scratch the caller must supply. Units are elements (numeric_f32) and bytes.

Enums§

AccumKind
Accumulation type for apply_into.
OperatorError
Recoverable operator contract failure.
OperatorKind
Registered representation. Unknown values must fail closed.
ScaleLayout
How packed scales are stored in the payload.
ScheduleKind
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 output with Y = W X for 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 batch under schedule. Does not allocate.