Search

A technology, a device or an article

Neighboring GPU threads need a useful arrangement of addresses

Aligned, shifted and strided warp accesses touch different 32-byte segments. Address arithmetic explains the coverage without inventing a speedup.

Blue woven threads move from a tight pattern to separated bundles
AI-generated conceptual illustration. A metaphor for organizing neighboring GPU accesses.ITNWS · Original ITNWS AI-generated conceptual editorial illustration

A GPU can have many threads ready to execute and still move more memory data than their calculation actually needs. The missing condition is not necessarily another thread. It can be the arrangement of addresses presented by the threads that already exist. Coalescing describes how their accesses combine into memory transactions. A useful explanation begins with that address set, rather than with a slogan that consecutive data is always fast. The machine must service specific requests through specific transaction boundaries, and the relationship between the requests and those boundaries determines how much of each transaction the computation uses.

For the scope used here, NVIDIA’s CUDA Best Practices Guide describes devices of compute capability 6.0 or higher in terms of the 32-byte transactions needed to service a warp’s accesses. A warp contains 32 threads, but the count alone does not determine the number of transactions. The active threads’ addresses, access widths, and distribution across the relevant segments matter. This is an architecture-scoped rule from the documentation, not a statement that every GPU made by every vendor has an identical memory interface or that all traffic elsewhere in the hierarchy uses this unit.

A transaction has a boundary

Assume all 32 threads read one distinct four-byte value, with addresses packed consecutively into an aligned 128-byte region. The requested values occupy four 32-byte segments. Under the documented model, four such transactions cover the address set. The threads collectively request 128 bytes and use the bytes in those segments. This is a teaching layout, not a measured kernel. It establishes the arithmetic baseline against which a changed layout can be understood. The existence of four covered segments does not yet describe total application time, cache misses, or the rate at which the physical memory chips deliver data.

Shift the first address by four bytes while preserving the consecutive arrangement. The 128 requested bytes now extend across five segments instead of four. At this boundary, 160 bytes of segment coverage service 128 distinct requested bytes, a ratio of 80%. The result is about coverage in the stated layout. It is not a universal prediction that the application will become 20% slower. Neighboring work can reuse data brought into cache, and other limits can dominate execution. A count of covered segments is a precise local observation, whose performance consequence remains a question for the actual program.

A different layout can be more dramatic without changing the number of threads. Suppose each thread reads a four-byte field from a different record, and successive records begin 32 bytes apart on segment boundaries. The warp requests 128 useful bytes distributed across 32 segments, whose total coverage is 1024 bytes. Only 12.5% of that coverage corresponds to the selected fields. These assumed records are deliberately simple; the example does not assert the layout of a commercial application. It isolates the source of extra traffic at this boundary: the computation reaches one small part of each widely spaced record.

Teaching useful-byte coverage within 32-byte segments for CUDA CC 6+: 4, 5, and 32 segments.
Teaching useful-byte coverage within 32-byte segments for CUDA CC 6+: 4, 5, and 32 segments. — ITNWS · Original ITNWS educational diagram

The diagram for these examples is a map of addresses and covered segments. It is not a picture of physical NAND, VRAM chips, or a measured bus waveform. A colored field indicates bytes requested in the example, while a segment indicates a servicing unit under the stated rule. The diagram can therefore distinguish packed, shifted, and strided layouts without claiming a measured speedup. Its value is explanatory: a reader can count the units that cover each address set. The picture should not be used to infer a transaction count for an unshown instruction width or a different architecture.

The record belongs to more than one consumer

The strided example motivates the familiar distinction between an array of structures and a structure of arrays. If a kernel consumes only one field across many records, placing those fields together can create a more compact address set for the warp. But this is a statement about that consumer. Another kernel might consume several fields of each record, and a host-side operation may prefer the original representation. A layout change reorganizes work across the application. It should be evaluated against the actual set of consumers rather than awarded an unconditional performance certificate because one simplified access became easier to coalesce.

Moving between representations also performs work. A transposition or packing operation reads and writes data, needs storage, and occupies execution resources. If the reorganized data is reused extensively, that cost can be worthwhile. If it is consumed briefly and discarded, the transformation may dominate any savings in the later kernel. No particular break-even point is supplied here because it depends on amounts, reuse, and implementation. The architectural mechanism explains a possible saving. Application-level reasoning asks how often that saving is obtained and what must be paid to obtain the layout that enables it.

The warp’s logical order does not require the addresses to appear in the simplest source order. The covered set is the important object for the coalescing rule. A permutation of threads accessing the same supported set can have the same segment coverage under the relevant conditions. Conversely, code whose indices look orderly can generate a poor set if its stride separates the selected values widely. It is therefore better to inspect the actual address expression than to judge the kernel by whether nearby source lines use nearby thread identifiers. The interface services addresses, not the visual tidiness of the loop.

Broadcast-like access requires care with the definition of useful bytes. If many threads request the same four-byte value, summing four bytes per thread yields a different quantity from counting distinct bytes requested. Reuse of one value can be perfectly meaningful computation, but it must not be inserted blindly into the earlier distinct-byte ratio. The 128-byte examples explicitly used different values for each thread. Their efficiency calculation concerns occupied bytes within covered segments, not a universal measure of arithmetic usefulness. An application can obtain many useful operations from one fetched value without making every byte of a transaction newly distinct.

Inactive lanes also alter the address set. A warp instruction with fewer participating threads does not automatically request a full set of distinct values for every lane. Which lanes participate and where their addresses fall determines coverage. This creates an interaction with control flow, but it is not the same subject as divergence itself. Divergence concerns the paths and participation of threads; coalescing concerns the addresses serviced for an instruction. One can affect the other without reducing them to a single score. A kernel needs enough ready work and a suitable way to deliver its data, with each mechanism contributing different evidence.

Cache behavior is why transaction arithmetic should be kept close to its boundary. A segment touched by one warp can supply bytes useful to later work, depending on the implementation and execution pattern. A shifted layout can consequently have a smaller observed penalty than a naive ratio predicts. Conversely, a compact address set does not guarantee that every access hits in cache. Capacity, reuse distance, contention, and the rest of the workload still matter. The segment model tells us what coverage an instruction’s requests require, rather than promising an exact number of physical DRAM transfers across the entire application.

NVIDIA’s Nsight Compute profiling guide provides the context for studying memory behavior with metrics. A counter’s name and collection scope matter: requested work, transactions in a particular memory path, and delivered bandwidth are not interchangeable quantities. A derived percentage should state its numerator and denominator. Otherwise a report can compare a local coverage calculation with an aggregate throughput limit and attribute the difference to a mechanism it did not isolate. A profiler can make the hierarchy visible, but its metrics still need to be interpreted in relation to the question asked by the experiment.

For the same reason, maximum occupancy is not a substitute for coalescing. More resident work can help execution tolerate some waiting, but does not make widely separated addresses become packed. A change that reduces traffic can help even when residency remains unchanged. Another change may increase ready work while leaving the traffic pattern intact. These are distinct opportunities. The earlier ITNWS article on register pressure examined placement of work within an execution resource. This article examines how that work asks for data. Keeping the subjects separate lets a measurement explain which mechanism changed instead of crediting all progress to a familiar utilization number.

A comparison also needs the same useful result. A version that reads fewer fields may issue fewer transactions because it performs less of the original task. A packed version that changes precision or omits required data has changed more than layout. Correctness and workload definition therefore precede a performance interpretation. The useful experiment holds the required computation stable while explaining the changed representation and any conversion cost. This is not a demand for an exhaustive catalogue of every hardware property. It is the minimum causal distinction needed to say that the arrangement of addresses, rather than a different problem, produced the observed change.

There is a constructive way to describe the result before any stopwatch is used. State which values a warp needs, express their addresses, identify the relevant servicing unit, and calculate the coverage. This produces a testable expectation about traffic under the documented model. It does not announce a speedup. A later measurement can then reveal how cache reuse, overlap, and other work affect the consequence. The expectation is valuable because it is specific enough to be challenged. “Memory is coalesced” becomes an explanation of a particular address set rather than a badge attached to the kernel as a whole.

The neighboring threads were never the complete resource. Their opportunity to compute depends on what they ask the memory system to do together. In the aligned example, their distinct requests fill four segments; in the shifted example, five; in the strided example, many more segments contain only a little immediately requested data. Those are different engineering situations despite identical thread counts and arithmetic widths. Coalescing gives the situations a language precise enough to reason about. The application’s eventual time remains a measured outcome, while the address map explains a mechanism that can contribute to it.

Sources checked on October 22, 2026. All layouts and ratios are educational calculations under the explicitly scoped CUDA model, not measured GPU results.

Sources & documentation

  1. CUDA C++ Best Practices Guide ↗
  2. NVIDIA Nsight Compute Profiling Guide ↗