> For the complete documentation index, see [llms.txt](https://docs.algenta.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.algenta.ai/compute-and-kernel-primitives.md).

# Compute & kernel primitives

- [Data integrity and encoding](https://docs.algenta.ai/compute-and-kernel-primitives/data-integrity-and-encoding.md): Checksums, encoding, keyed hashing, key derivation, a stream cipher and a Merkle tree — compiled primitives, not a general-purpose library wrapper.
- [Config and data-parsing kernels](https://docs.algenta.ai/compute-and-kernel-primitives/config-and-data-parsing-kernels.md): TOML and YAML config parsing with dot-notation lookups, an RFC 4180 CSV reader, a columnar DataFrame factory, and the zero-Python JSON codec that the engine's own dispatch layer decodes every runtime.
- [Compression kernels](https://docs.algenta.ai/compute-and-kernel-primitives/compression-kernels.md): Delta, Huffman, LZ77 and run-length encoding as compiled kernels — four classic lossless algorithms, each matched to one specific shape of redundancy.
- [Tensor buffer primitives](https://docs.algenta.ai/compute-and-kernel-primitives/tensorx-kernels.md): Dtype-tagged byte buffers, elementwise ops, wide-accumulating reductions, N-D shape/broadcasting and low-bit quantization — the flat tensor substrate other kernel families decode through.
- [Normalization kernels](https://docs.algenta.ai/compute-and-kernel-primitives/normalization-kernels.md): LayerNorm and RMSNorm forward/backward kernels over flat row-major buffers, plus the shared contract that validates their row shapes and epsilon.
- [Attention kernels](https://docs.algenta.ai/compute-and-kernel-primitives/attention-kernels.md): Scaled dot-product attention, flash attention, causal/sliding-window masking, RoPE, and analytic backward gradients, in flat row-major layouts with grouped-query support.
- [MLP block kernels](https://docs.algenta.ai/compute-and-kernel-primitives/mlp-block-kernels.md): Gated feed-forward activations (SwiGLU and both GEGLU conventions), token embedding lookup, and the shared feed-forward/vocabulary shape contract, forward and backward, in flat row-major layouts.
- [GEMM kernels](https://docs.algenta.ai/compute-and-kernel-primitives/gemm-kernels.md): Cache-blocked SIMD dense GEMM/GEMV in Float64, NF4/int4/int8 quantized matmul with dequantization fused into the reduction loop, and the shared status/dimension/work-budget contract behind both.
- [GPU acceleration kernels](https://docs.algenta.ai/compute-and-kernel-primitives/gpu-acceleration-kernels.md): Backend selection contract, host device capability probing without compiling a shader, and a threadgroup-tiled GEMM kernel on the Metal GPU.
- [LLM inference kernels](https://docs.algenta.ai/compute-and-kernel-primitives/llm-inference-kernels.md): A parallel decode-shaped matrix-vector product, KV-cache growth, greedy argmax, whole-buffer residual add, and the shared status vocabulary that a real autoregressive decode loop composes them into.
- [Attention variant kernels](https://docs.algenta.ai/compute-and-kernel-primitives/transformer-attention-variant-kernels.md): Scalar reference formulas for scaled dot-product attention, ten named sparse/long-context attention techniques, flash attention's online-softmax building blocks, and five families of positional encodi
- [Transformer blocks and normalization](https://docs.algenta.ai/compute-and-kernel-primitives/transformer-blocks-and-normalization-reference-kernels.md): Scalar reference formulas for assembling a transformer block (residual, pre/post-norm, causal mask, FFN), a broad normalization catalog beyond LayerNorm/RMSNorm, general non-transformer NN primitives,
- [KV-cache and generation kernels](https://docs.algenta.ai/compute-and-kernel-primitives/kv-cache-and-autoregressive-generation-kernels.md): Scalar formulas for KV-cache memory and eviction (plain and paged), sampling and generation-loop decisions, speculative-decoding accept-rate math, and continuous-batching scheduling -- the arithmetic
- [Multimodal and inference operations](https://docs.algenta.ai/compute-and-kernel-primitives/multimodal-and-inference-operations-kernels.md): Scalar analytic formulas for multimodal fusion primitives, inference-serving capacity and latency estimates, per-request cost accounting, and prompt-injection/output-safety scoring.
- [Loss functions and resident-context kernels](https://docs.algenta.ai/compute-and-kernel-primitives/loss-functions-and-resident-context-kernels.md): Chunked cross-entropy that never materializes the full logit tensor, and the host-side capacity and dispatch-budget arithmetic for a resident GPU decode session, answered with no device required.
- [Neural network primitives and data-pipeline kernels](https://docs.algenta.ai/compute-and-kernel-primitives/neural-network-primitives-and-data-pipeline-kernels.md): Eleven unrelated small libraries closing out the kernel-documentation backlog -- scalar activation functions, cellular automata, a string-similarity column-name ranker, two distinct data-pipeline util


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.algenta.ai/compute-and-kernel-primitives.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
