liveBook · Manning

Memory layout

Also called data layout

Memory layout is the arrangement and mapping of data elements or regions to locations in memory.

How 5 Manning books explain it

GPU Programming with Triton

Memory layout is the mapping between logical data structures and their locations in memory.

How it is used
Uses memory layout to connect tensor indexing with correctness and GPU data movement.
How deep it goes
Explains stride-based address calculation, layout-dependent access patterns, and tiled kernel implications.
Examples
Works through row-major and column-major matrices, split-pair rotations, and a naive matrix multiplication kernel.
What you can do after
Apply stride-based indexing in Triton kernels and evaluate the access and reuse consequences of different layouts.

Read how GPU Programming with Triton explains memory layout →

Embedded Software with Rust

A memory layout specifies the placement of a program's code, data, stack, and other regions in memory.

How it is used
Defines bare-metal firmware placement within a microcontroller’s available memory.
How deep it goes
Works through region definitions, section mapping, startup initialization, and struct alignment, with advanced linker-script troubleshooting deferred.
Examples
Uses STM32 FLASH and RAM maps, a complete linker script, and a USART register struct.
What you can do after
Operate/configure a microcontroller’s memory layout and inspect the resulting firmware placement with cargo objdump.

Read how Embedded Software with Rust explains memory layout →

CUDA for LLMs

A memory layout is the arrangement of data elements in memory addresses.

How it is used
Uses layouts to map tensor coordinates to memory and match data staging to CUDA kernel requirements.
How deep it goes
Explains stride-based offsets, CuTe layout transformations, and WGMMA staging choices, while leaving custom layout construction beyond the basic example.
Examples
Traces a 128 × 64 row-major matrix, a 3 × 4 transpose, and layout conversion for a 4096 × 4096 GEMM.
What you can do after
Apply it via CuTe to define a row-major layout and evaluate staging or conversion choices for WGMMA operands.

Read how CUDA for LLMs explains memory layout →

The Coder Cafe

Memory layout is the spatial organization of data objects and their elements in computer memory.

How it is used
Compares data structures by how their memory arrangement affects access, growth, insertion, deletion, and update operations.
How deep it goes
Defines contiguous storage, nodes, pointers, and dynamic allocation, then compares operation complexities without detailing hardware-level memory behavior.
Examples
Uses fixed-size arrays, Java ArrayList, C++ std::vector, Go slices, singly linked lists, and doubly linked lists.
What you can do after
Evaluate array and linked-list choices using storage arrangement, pointer overhead, flexibility, and operation costs.

Read how The Coder Cafe explains memory layout →

Quantization and Fast Inference

Memory layout is the arrangement of data elements at addresses in memory.

How it is used
Aligns quantization granularity with memory access to support coalesced loads.
How deep it goes
Specifies grouping along the contiguous axis for coalesced loads, without detailing implementation.
Examples
Uses group-128 INT4 as a granularity choice and places groups along the contiguous axis.
What you can do after
Operate/configure quantized data layout by grouping along the contiguous axis for coalesced loads.

Read how Quantization and Fast Inference explains memory layout →

Also covered in

What to know first

Related concepts

Questions about memory layout

What is memory layout?

Memory layout is the arrangement and mapping of data elements or regions to locations in memory.

Which Manning books explain memory layout?

GPU Programming with Triton, Embedded Software with Rust, CUDA for LLMs, The Coder Cafe and Quantization and Fast Inference.

What should I know before learning memory layout?

Manning books that teach memory layout usually introduce cache line, C++, memory coalescing and tensor first.

What kinds of memory layout are there?

Kinds of memory layout include contiguous memory layout.

What is memory layout a kind of?

Memory layout is a kind of function. A function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.

What is memory layout part of?

Memory layout is part of application binary interface. An application binary interface is a specification of binary-level conventions, such as data representation and calling conventions, that govern interaction between compiled software components.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.