• [RFC] [GSOC] Buffer Reuse Pass for Non-Overlapping Allocations After lower-deallocations Motivation & Background Many real-world workloads are expressed as structured, sequential computation graphs such as pipelines, processing chains, and iterative blocks. • In these patterns, intermediate buffers are allocated, used, and released in strict sequence, resulting in lifetimes that do not overlap. • After the bufferization and deallocation pipeline, the IR contains explicitmemref.alloc/memref.deallocpairs. • Buffers with non-overlapping lifetimes each receive their own heap allocation even when they could use shared memory. • As a result, peak memory usage scales with the total number of intermediate allocations rather than with the maximum number of simultaneously live buffers. • The bufferization documentation acknowledges this gap: “This implies reusing already allocated buffers when possible, turning bufferization into an algorithmically complex problem with similarities to register allocation."-mlir/docs/Bufferization.md Today, there’sno upstream buffer reuse pass in MLIR, which forces every major downstream stack - IREE, TVM , and XLA to build their own.

Article Summaries:

  • MLIR Buffer Reuse Pass Proposal

A new Google Summer of Code project proposes an MLIR pass to reduce peak memory usage by reusing non‑overlapping buffer allocations. The pass will first analyze allocation lifetimes, reporting peak live bytes and reuse opportunities without modifying the IR. An optional rewrite pass then merges eligible memref.alloc/memref.dealloc pairs into a shared pool, running after lower-deallocations and promote-buffers-to-stack. Eligibility requires static shape, contiguous layout, default memory space, non‑escaping usage, and proven non‑overlap. The goal is to eliminate duplicated effort across MLIR‑based ecosystems (IREE, TVM, XLA) and lower the barrier for new adopters.

Sources: