Buy memory capacity with an explicit access policy
Model local-cache hits, remote-fetch cost, migration amortization, and phase changes in a disaggregated memory tier.
On this page
The question for today
What you’ll understand
- Compute latency with an explicitly additive remote-miss penalty.
- Derive a reuse threshold for a fictional migration.
- Distinguish remote-memory mechanisms, capacity value, and access amplification.
Separating memory capacity from compute can reduce stranded capacity or let a job exceed its local-memory limit. The tradeoff is that some references cross a slower or more contended path. Whether this helps depends on which data stays local, how remote data is fetched, and how access patterns change over time. A remote tier is not one universal mechanism: RDMA paging, application-managed far-memory objects, and CXL-attached memory differ in granularity, coherence, software control, and failure handling. Compare them through explicit contracts before applying a latency model.
Choose the access and caching granularity
A remote-memory system may fetch pages, objects, or smaller transactions. A large fetch can amortize fixed latency and support sequential reuse, but it can waste bandwidth for isolated small accesses. Track useful application bytes separately from fetched bytes, including metadata and writeback. An embedding workload that reads one small vector per remote page can have substantial amplification even if the advertised network bandwidth is high. A cache hit ratio alone does not describe that amplification.
Specify whether a cache probe is paid on both hits and misses. In the simple blocking model below, every access pays a local probe and a miss adds a remote fetch penalty. That is different from a weighted average where the quoted miss latency already includes the probe. State the convention to avoid counting or omitting the local path twice. Real systems with prefetching, asynchronous object access, or multiple outstanding misses need a richer concurrency model than one serialized mean.
Migrate only when reuse pays for it
Moving data to local memory incurs copy, metadata, eviction, and possibly writeback costs. An estimated latency saving per future reference must repay those costs before the object becomes cold or disappears. This is a prediction about future reuse, not a property of the memory technology. Include the opportunity cost of evicting another useful object: a migration that helps one tensor can hurt another more. Preserve the capacity constraint rather than calculating every object’s benefit as though local memory were unlimited.
Access phases can change faster than a tiering controller reacts. Newly hot data may suffer repeated remote misses before promotion, while recently cold data occupies local capacity. Rate-limit migration so a burst of misplaced pages cannot monopolize the same bandwidth needed for demand reads. Measure adaptation time, queueing, and tail latency during workload transitions. A steady-state hit rate from a warmed benchmark can conceal the exact cold-start and phase-change behavior a production service must tolerate.
Keep mechanisms and failure semantics distinct
Infiniswap studies remote memory through an RDMA-based swapping design, while AIFM integrates far-memory management with application objects. Their mechanisms illustrate different points in the design space rather than interchangeable performance numbers. A CPU load to CXL memory has another path and coherence contract. Reusing a remote-paging result as a CXL latency claim, or assuming an object cache inherits transparent shared-memory semantics, would change the system being analyzed.
Evaluate complete job or service behavior at a fixed working set and quality target. Capacity expansion may prevent out-of-memory failure or slower storage spill even when every remote access is slower than a local hit. Include remote-memory server resources, network contention, replication or recovery requirements, and memory reclamation in cost. Report failure behavior when the remote tier is unavailable. A large capacity pool is valuable only if the application can use it within its correctness, latency, and recovery constraints.
Work it through
A migration must amortize its exposed cost
A fictional blocking cache always pays a 100 ns probe and adds 500 ns on a miss. Compare hit probabilities 0.6 and 0.9. Suppose a migration raises the hit probability from 0.6 to 0.9 for one reference stream and has exposed one-time cost 100 microseconds, with no displacement harm.
At hit probability 0.6, mean access latency is 100+(1−0.6)×500=300 ns. At 0.9 it is 100+0.1×500=150 ns. The remote penalty is additional in both calculations.
Expected saving is 300−150=150 ns per future reference under the unchanged blocking model. A 100-microsecond migration costs 100,000 ns.
Strict positive net benefit requires R×150>100,000, or R>666⅔. The smallest integer satisfying this condition is 667 future references, assuming the predicted hit improvement actually persists.
The migration is worthwhile only beyond the stated reuse threshold in this fictional model. Capacity pressure, concurrency, and phase changes can invalidate that prediction and must be measured separately.
The living notebook
Explore the model
Interactive lab · cache
Capacity changes reuse without removing compulsory misses
Reset, set Cache capacity C to 8 and Request stride s to 2. Predict an eight-address period, 8 misses and 8 hits among the initial 16 requests; one Step adds a hit. Reset, explicitly set C=4 and s=2, then Step: predict 17 misses and zero hits. This fully associative LRU toy caps its trace at 4096 requests and contains no remote latency, migration traffic, or tiering controller.
- Hits / requests
- 0 / 16
- Hit rate
- 0%
- Address-stream period
- 16 addresses
A fully associative LRU cache starts empty and requests address (i·s) mod 16. Hits move an address to the newest position; misses evict the oldest when full. Playback starts with 16 requests and adds two per second, capped at 4096 explicitly simulated requests. This toy stream is not a processor-cache benchmark. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA working set that fits can still pay cold misses; a smaller cache may lose every reuse.
Pause & reason
Check your understanding
Your turn
Try it yourself
A blocking local cache has probe latency 80 ns and additional remote-fetch penalty 600 ns. Compute mean latency at h=0.75. A 120-microsecond migration saves 200 ns per future reference; how many references are needed for strictly positive net benefit?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Keep nanoseconds and microseconds consistent, and distinguish equality from positive benefit.
Compare with the solution
Mean latency is 80+0.25×600=230 ns. Migration cost is 120,000 ns, so R×200>120,000 requires R>600. The smallest integer is 601. At exactly 600, the simple model only breaks even and has no allowance for other costs or prediction error.
Keep the idea
Take it with you
- Define granularity, cache semantics, and useful-byte amplification.
- Amortize migration against future reuse and displaced data.
- Measure capacity benefits together with transition, contention, and failure costs.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.