> For the complete documentation index, see [llms.txt](https://docs.modular.com/llms.txt).
> Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

# kernels

High-performance compute kernels, operators, and tensor APIs for MAX graphs.

The MAX AI kernels library provides the building blocks for AI inference and
other compute-intensive workloads on CPU and GPU, including
[linear algebra](https://docs.modular.com/max/api/kernels/linalg.md) functions like matrix
multiplication, [neural network operators](https://docs.modular.com/max/api/kernels/nn.md) such as
attention and convolution, [quantization](https://docs.modular.com/max/api/kernels/quantization.md)
routines, [key-value caches](https://docs.modular.com/max/api/kernels/kv_cache.md) for transformer
models, and primitives for
[multi-GPU communication](https://docs.modular.com/max/api/kernels/comm.md) and
[extending a MAX graph](https://docs.modular.com/max/api/kernels/extensibility.md) with
custom operations.

## Packages

* [`builtin_kernels`](https://docs.modular.com/max/api/kernels/builtin_kernels.md): Mojo package builtin\_kernels.builtin\_kernels documentation
* [`comm`](https://docs.modular.com/max/api/kernels/comm.md): Provides communication primitives for GPUs.
* [`extensibility`](https://docs.modular.com/max/api/kernels/extensibility.md): Surface needed to write GraphCompiler kernel entry points.
* [`kv_cache`](https://docs.modular.com/max/api/kernels/kv_cache.md): Contains implementations for several types of key-value caches.
* [`linalg`](https://docs.modular.com/max/api/kernels/linalg.md): Provides CPU and GPU implementations of linear algebra functions.
* [`nn`](https://docs.modular.com/max/api/kernels/nn.md): Provides neural network operators for deep learning models.
* [`nvml`](https://docs.modular.com/max/api/kernels/nvml.md): Implements wrappers around the NVIDIA Management Library (nvml).
* [`pipeline`](https://docs.modular.com/max/api/kernels/pipeline.md): Generic compile-time software pipeline scheduling framework.
* [`quantization`](https://docs.modular.com/max/api/kernels/quantization.md): This package contains a set of APIs for quantizing tensor data.
* [`shmem`](https://docs.modular.com/max/api/kernels/shmem.md): Implements a subset of OpenSHMEM functionality.
* [`state_space`](https://docs.modular.com/max/api/kernels/state_space.md): State space model kernels for Mamba and related architectures.
* [`structured_kernels`](https://docs.modular.com/max/api/kernels/structured_kernels.md): Shared GPU kernel primitives for structured kernel architectures.

