Parent: trueno-spec.md Section 9
The Sovereign AI Stack uses row-major layout exclusively for APR/GGUF data. Trueno provides both row-major and column-major Q4K/Q6K kernels, but column-major is for internal BLAS-style operations only.
| Layout | Use Case | Consumers |
|---|---|---|
| Row-major | APR format, SafeTensors, PyTorch | aprender, realizar |
| Column-major | Internal BLAS ops, transposed matmul | Advanced/internal only |
For APR/GGUF data, ALWAYS use row-major kernels.
Trueno does NOT handle layout conversion. Aprender transposes during import:
GGUF (column-major) → aprender transpose → APR (row-major) → realizar → trueno row-major kernels
Aprender converter: src/format/converter/write.rs
If inference produces garbage output (e.g., "olumbia+lsi nunca/localENTS"):
- Check if column-major kernel was called with row-major data
- Verify APR file was created via
apr import(not raw GGUF passthrough) - Cross-reference:
aprender/CLAUDE.mdLAYOUT-002,realizar/CLAUDE.mdLAYOUT-002
See book/src/advanced/phase15-fused-q4k.md for the fused dequant+dot kernel specification targeting 2x Ollama throughput. The fused kernel eliminates intermediate materialization of dequantized weights.
Super-blocks are 256 elements (144 bytes). in_dim MUST be a multiple of 256 or matmul_q4k_f32_scalar panics. This is a hard constraint from the GGML quantization format.