Compiling Dynamic Programming for Processing-in-Memory — GenMLIR

ASP-DAC 2027

Dynamic-programming (DP) workloads such as all-pairs shortest path and sequence alignment are a natural fit for processing-in-memory (PIM) on monolithic 3D DRAM, but extracting that performance today means writing kernels by hand: picking tile sizes, placing data across non-uniform-latency memory tiers, partitioning work among heterogeneous processing units, and inserting the right broadcasts and queues manually. GenMLIR is an MLIR compiler that automates this mapping. It encodes the semi-ring generalized grid update — the algebraic form shared by all-pairs shortest path and sequence alignment — as a first-class IR abstraction, then lowers it through hardware-aware pass groups that derive blocked tiling, tier-aware placement, tile-to-PU assignment, and explicit communication. The generated code runs up to 5.8× (APSP) and 16.7× (alignment) faster than a lowering without compiler support and 1.2–1.4× faster than standard affine tiling, while expressing each workload in 4–9 lines instead of several hundred.

Approximation Tuning for Hyperdimensional Computing — ApproxHDC

ASPLOS 2027

Hyperdimensional computing (HDC) is intrinsically tolerant to noise and approximation, which makes it a strong match for heterogeneous hardware — CPUs, GPUs, and FPGAs, as well as in-memory technologies such as ReRAM and phase-change memory. Deciding which approximations to apply and how aggressively, however, is a search problem whose space grows exponentially with the number of operations. ApproxHDC extends the HPVM-HDC compiler infrastructure to automatically identify the approximation opportunities in an HDC application, construct the design space spanning both software and hardware levels, and search it efficiently under a user-specified quality-of-service constraint, retargeting the result across CPU, GPU, and simulated ReRAM/PCM backends. It reaches up to 17.25× speedup on CPUs, 15.02× on GPUs, and 4.69× on SpecPCM, outperforming the prior state-of-the-art MicroHD by 3.49× at the same accuracy bar.

Binary Code Size Reduction — DeduBB

LCTES 2026

Modern software binaries keep growing due to feature expansion, which slows upgrades, raises maintenance costs, and degrades performance once code size outgrows the smaller, more efficient code models. DeduBB is a post-link optimizer that de-duplicates identical basic blocks across procedure and module boundaries. Where earlier techniques relied on function outlining and therefore missed many duplicates — including code patterns that manipulate the program stack — DeduBB replaces redundant blocks with a lightweight save-and-jump sequence that covers far more cases. Built for the scalable post-link optimizers BOLT and Propeller, and guided by profiles so that only cold blocks are touched, it shrinks benchmark binaries by 1.55%–18.63% on Arm and x86 and warehouse-scale binaries by up to 25.8%, retaining over 82% of the maximal savings without hurting performance. The work was done during my student researcher position on the Compiler Optimization team at Google.

A Unified Compiler for Dynamic Programming Accelerators — DP-MLIR

Under Submission

Dynamic-programming kernels sit at the heart of graph analytics and bioinformatics — Floyd–Warshall for all-pairs shortest path, Smith–Waterman and Needleman–Wunsch for sequence alignment — and custom accelerators run them far faster than CPUs or GPUs can. The catch is that each new accelerator means re-implementing the algorithm by hand in hardware-specific form, with loop transformations, tiling strategy, and memory management tuned to one architecture and one algorithm variant, so design cycles stretch into months and nothing is reusable. DP-MLIR removes that per-target rewrite. A hardware-agnostic front-end language, DP++, states what to compute, over which domain, and which approximations are permitted; a shared mid-end performs DP-aware dependence analysis and wavefront scheduling, selects band widths and tile sizes that respect accuracy and capacity limits, resolves precision, and plans memory layouts that match each device's dataflow; and target-specific back-ends lower the result into compact runtime command streams. The same program therefore retargets across accelerators as different as a ReRAM-based sequence-alignment engine, a PCM-based APSP engine, and an HBM-based blocked Floyd–Warshall engine, without a line of source changing.

Compiling Graph Dynamic Programming for Heterogeneous PIM — Forge

Under Submission

Graph-based dynamic programming splits into regimes that pull hardware in opposite directions: matrix-centric kernels such as all-pairs shortest path are dense and regular and bound by arithmetic throughput, while topology-centric kernels such as sequence-to-graph alignment are sparse and irregular and bound by memory latency. Heterogeneous processing-in-memory accelerators answer this by pairing a PCM matrix substrate with an HBM traversal substrate inside one package, but programming such a machine by hand means reasoning simultaneously about recursive graph partitioning, bit-serial in-situ arithmetic, windowed bit-parallel alignment, a tiered memory hierarchy, and instruction sets that have nothing in common. Forge is an MLIR compiler that hides all of it. A Python-embedded DSL asks the programmer for the recurrence and its parallel structure and for nothing about the silicon; a progressively lowering pipeline then classifies the workload archetype, derives the recursive partitioning and windowed segmentation, assigns every buffer to a memory tier, lowers abstract bitwise recurrences into per-cycle micro-operations, and emits the host driver together with microcode for both compute tiles. The generated code reaches the quality of expert hand-tuned mappings from a compact, hardware-agnostic program, and because the language names no hardware construct, the same source retargets to other accelerators whose runtime implements the interface — as demonstrated by a second back-end for an independently designed alignment accelerator.

Compiling LLM Training for a Reconfigurable Optical Fabric — GlassMLIR

Design Document

GlassML is a panel-level glass interposer whose reconfigurable multi-plane optical fabric carries the collectives of a large language model training job. The fabric exposes a single communication primitive: a plane holds a permutation for some duration after paying a reconfiguration delay. Everything else — which permutations are held, on which planes, for how long, and in what order across a training iteration — is a compiler problem. GlassMLIR lowers a model and its parallelism plan through sharded tensors, demand matrices, and plane-time slots, and ends at the slot contract the hardware already exposes. Demand that follows from the parallelism plan is decomposed offline and preloaded, while the data-dependent demand of mixture-of-experts routing is shaped by the compiler and solved by the on-package controller at run time. Along the way the compiler plans parallelism degrees, places and replicates experts, pins persistent circuits, allocates planes across the iteration timeline much as a register allocator allocates registers, hides transfers behind compute, and emits the coordinated compute, fabric, DMA, and control-domain programs that each tile executes.

Mahbod Afarin
Mahbod Afarin
Postdoctoral Scholar