Bridging Python to Silicon: The SODA Toolchain
Paper · 2022 · Nícolas Bohm Agostini, Serena Curzel, Jeff Jun Zhang et al.
Summary
A scientist can revise a calculation in a Python framework without deciding how a circuit should run it. Building a dedicated accelerator requires those decisions. The design must specify which operations can run together, where to keep intermediate values, and how to fit the computation within limits on time, chip area, and power. The SODA paper asks whether a compiler can take on that work as the calculation changes. The authors build a toolchain that takes suitable computations from high-level frameworks to physical designs for application-specific integrated circuits, or ASICs. Developers can use the flow without writing the descriptions of registers and data movement that normally define the circuit.
SODA-OPT, the frontend, works in MLIR, a compiler framework that can express the same program at several levels of detail. It can recognize a linear algebra operation while the program still describes it as such, then reorganize the loops and storage that will implement it. SODA-OPT separates the work that goes into hardware from the program that will call it. It passes the selected work to PandA-Bambu in LLVM intermediate representation, with the computation already arranged for hardware synthesis. Bambu assigns operations to hardware resources and clock cycles, then emits a circuit description that downstream tools can turn into a chip layout.
For linear algebra kernels from PolyBench, the authors report an average speedup of 18x against direct lowering from MLIR, with a peak summarized as 86x. Bambu uses its usual -O2 optimizations in both conditions, so the comparison measures what the frontend adds to an already optimized synthesis flow. The gains depend on the kernel. In several weaker cases, an inner loop ends at a position determined by an outer loop, preventing a pass from replacing some aggregate storage with individual scalar values.
The neural-network experiments show how much depends on the boundaries of the circuit being generated. The authors synthesize individual layers and also make smaller convolution accelerators that can be called repeatedly. The paper reports up to 364 GFLOPS/W at 32-bit precision. Its detailed results put that efficiency peak on a LeNet tile compiled with frontend optimizations disabled. Enabling the pipeline gives the tile a shorter runtime and a lower figure for operations per watt. Execution times come from simulation, while area and power are assessed through physical design. The evidence concerns selected kernels and layouts, with full application performance and fabricated-chip behavior still unmeasured.
Deep dive: Bridging Python to Silicon: The SODA Toolchain
How SODA compiles high-level programs into custom accelerator layouts, and what its linear algebra and convolution experiments reveal. · about 34 minutes to read
The problem and its context
Why changing the calculation can mean changing the circuit
The authors motivate SODA with applications such as environmental monitoring, navigation and control, and scientific experiments. An application in this group may combine numerical calculation, data analysis, and machine learning. It may also have to react quickly while working within a budget for power or physical size. The paper argues that these combined demands create a place for accelerators designed around particular computations.
An accelerator can devote physical resources to work that a general-purpose processor handles through its ordinary instruction stream. Consider a calculation that repeatedly reads values, multiplies them, and adds the products into an accumulated result. Knowing the mathematical operation leaves important choices open. The circuit can use an arithmetic unit repeatedly or supply several units. It can retain a partial result locally or fetch and update it in memory. Reads that touch independent storage can potentially take place together. Each arrangement implements the calculation, but it creates a different demand for arithmetic hardware, registers, and access to data.
This is where the development cycles for algorithms and circuits diverge in the paper’s account. A domain specialist can express and test a computation in a framework that already supplies the operations of interest. Hardware development requires decisions that the framework lets the specialist leave implicit. When an algorithm is revised, those decisions may need to be revisited. A different loop structure can change which operations are independent. A different data shape can change whether a local buffer is practical. Even a familiar calculation may need a different implementation if the target has a tighter power or latency budget.
The manual flow described by the authors begins with finding the portions of an algorithm worth accelerating. A hardware designer looks for work that can proceed concurrently and values that can be reused. The designer then constructs functional units for the selected computation in a hardware description language, or HDL. At the register-transfer level, abbreviated RTL, the description specifies the state held in registers and the operations and transfers that take place as the circuit progresses. Logic synthesis and physical design follow verification of the hardware description. Logic synthesis expresses the circuit using resources available for the target. Physical design places those resources and routes the connections between them.
The paper also describes a partly automated alternative. With high-level synthesis, or HLS, a designer can specify a functional unit in C or C++ and use a tool to turn it into HDL. The authors name commercial tools that follow this pattern, including Vitis HLS, Catapult C, and Stratus HLS. HLS relieves the designer of some direct RTL work. In the workflows discussed in the paper, however, the designer often still rewrites the program to create local buffers or organize loops, or adds directives to tell the synthesis tool how to interpret the code. For example, a directive can request that a loop be expanded or tell the tool that different arguments refer to separate storage.
There is also work at the boundaries between tools. Different stages use descriptions with different levels of detail. A revision to the calculation may require someone to bring several descriptions and assumptions back into agreement, then repeat the relevant checks. From the authors’ perspective, the productivity problem lies as much in maintaining that sequence as in the work performed by any individual tool. A compiler connection between stages can carry forward decisions made earlier and can regenerate downstream artifacts after a change.
Two ways earlier systems reached hardware
One strategy in the paper’s related work is to provide hardware templates and map selected computations onto them. VeriGOOD-ML takes neural computations in ONNX form and uses the PolyMath compiler to map them to architecture templates for different categories of networks. The choice of target gives the compiler an existing hardware organization to work with. The operation being mapped needs to fit an organization that the system supplies.
A related example is Gemmini. It provides a configurable systolic array, an arrangement of processing elements that pass values through the array as they compute. Its generator is written in Chisel, and the array connects to a RISC-V core. The software flow can send supported operations from ONNX layers to the array. This is an example of designing the accelerator and the software that uses it together. Gemmini
The paper describes TVM’s VTA as another case in which software targets an existing accelerator architecture. VTA is a coprocessor specialized for matrix multiplication and generated by HLS for an FPGA, a device whose hardware can be configured after manufacture. TVM can produce instructions for that coprocessor. The authors also mention work in TVM on ASIC compilation for particular neural-network operators using parameterized RTL templates. Across these examples, the compiler has a defined set of hardware structures to target. The paper identifies that mapping requirement as a limit on which computations the flows can support.
The other strategy is to generate source code that an HLS tool accepts. PyLog starts with Python and emits C or C++ with annotations for Vivado HLS. HeteroCL divides computation between a general-purpose processor and an FPGA. It supplies library functions for expressing hardware-related information in the source and uses that information when producing annotated synthesis input. ScaleHLS performs optimizations in MLIR before writing out C with directives for Vivado HLS. These systems automate different parts of the translation, with the generated source serving as the connection to a hardware generator.
The authors identify an information problem at that connection. An optimizer may already have established facts about how a computation is organized, or transformed it into a useful hardware-oriented form. Writing the result back into a higher-level programming language can lose some of what the optimizer made explicit. SODA’s backend accepts LLVM intermediate representation directly, so the frontend can hand over a low-level description prepared for synthesis without taking that detour through generated C.
CIRCT represents a different use of the same compiler infrastructure. In the paper’s account, its focus is on representations and tools for circuit-level work. The authors discuss the possibility that those representations could become building blocks for hardware compilers. SODA’s starting point is farther from a circuit. It begins with descriptions arising from software frameworks and follows selected computations down to a representation from which a hardware generator can build a circuit.
What SODA sets out to automate
The paper’s alternative is to generate a circuit for a selected computation using compiler passes at several levels of abstraction. This places the emphasis on what structure the compiler can recover or preserve about the program. A known linear algebra operation gives the compiler a useful place to choose a hardware boundary. Structured loops give it a place to expose parallel work. Storage information can tell the hardware generator where it has freedom to reorder accesses. By the time the backend needs to decide which functional unit runs an operation, some of that work has already been done.
Generating an accelerator around one computation also has a cost in flexibility. The authors distinguish the specialization of the generated circuit from the applicability of the compiler. A compiler may accept a range of computations when there are suitable translations to its input representation. Each circuit it generates can still be narrowly tailored to its own calculation. The authors expect that tailoring to offer opportunities for performance and efficiency, while a parameterized architecture can retain support for a wider set of operations in the same design.
The intended reduction in design effort comes from keeping the source computation stable while changing the compilation choices. A researcher can enable a pass, change how it handles a loop, or select a different region to synthesize and then ask the toolchain to generate the corresponding design. In the paper’s design, the same flow can continue through implementation without requiring handwritten RTL for each of those alternatives. The decisions that govern exploration are therefore exposed as compiler choices, and their effects can be inspected in generated hardware.
The method, step by step
Import the computation into MLIR
SODA has a frontend, SODA-OPT, and a hardware generation backend, PandA-Bambu. Their interface is a program in a form intended for a compiler, known as an intermediate representation, or IR. The program enters SODA-OPT in MLIR and leaves it in LLVM IR. Bambu then uses that LLVM program to produce hardware.
MLIR lets compiler developers define dialects. Each dialect gives a set of operations and conventions for describing some part of a computation, while using the common MLIR infrastructure. A dialect can preserve the fact that a program is performing a structured linear algebra operation. Another can expose its loops and access patterns. The layout of the eventual circuit is still undecided at either stage. The representations give the compiler access to different information while it decides how to prepare the operation for synthesis.
SODA-OPT accepts built-in MLIR dialects as entry points. The paper discusses framework paths such as TensorFlow, ONNX-MLIR, and TORCH-MLIR, alongside routes from scientific and general-purpose programming environments. The translation into a supported dialect is the operative prerequisite. It connects the application framework to SODA even when the original application describes its work in the framework’s own terms.
For the neural-network study, the authors train the networks in TensorFlow at 32-bit floating-point precision. They convert them into protobuf files and translate the computation into the built-in tosa and linalg abstractions. The network descriptions require no source changes for this process. Training supplies the computations and parameters that enter the hardware flow. The compiler study then changes the implementation of those computations. It has no separate learning procedure for selecting hardware optimization passes. In the linear algebra study, the route into MLIR instead begins with C implementations of PolyBench kernels translated into the affine dialect.
How SODA turns a computation into an accelerator layout
The steps in order.
Decide which part of the program becomes hardware
SODA-OPT adds a soda dialect to express the partition between software and hardware. Its analysis and transformation passes search the input for candidate regions. The frontend can recognize structured operations in linalg, where the identity of a computation can be visible before its implementation is spelled out as individual loads, arithmetic instructions, and stores.
SODA-OPT then outlines the selected regions. Outlining makes a region into a separate unit that can be compiled on its own. Values the region needs have to cross its interface, as do the results it gives back. This boundary determines what the hardware generator sees together. Arithmetic inside a region can be considered as part of the same accelerator. Work outside it remains with the rest of the program or can belong to another region.
The host program is the part that coordinates execution. Its route through the frontend produces LLVM IR containing runtime calls to control the generated accelerators. The region chosen for hardware takes a separate path geared to synthesis. This arrangement lets the application retain software orchestration while moving a computationally important part into an accelerator. The runtime boundary is part of the compilation scheme, even though the evaluation concentrates on the generated kernels.
For a neural network, the default partition assigns an accelerator to each layer. A layer is an operation or stage of the network, such as a convolution or an activation, with inputs and outputs that give the compiler a natural boundary. The same mechanism can also outline a tile. A tile covers a bounded portion of a larger calculation. If that portion is suitable for repeated use, the generated circuit can be invoked for each part needed to carry out the larger operation. Thus the boundary controls both the scope of specialization and the amount of work that each invocation performs.
Lower the computation while its structure is still available
The paper describes the accelerator path through linalg, affine, scf, cf, and llvm. Lowering means converting a description into one that spells out more of its implementation. The transition from a structured operation to loops, for instance, makes the order and bounds of iteration available for manipulation. A further transition to explicit control flow makes branches and the sequence of instructions visible.
At the linalg level, the frontend can recognize the algebraic operation and use it in partitioning. In affine, the description exposes structured relationships among loop indices, bounds, and accesses. That organization is where SODA applies important loop transformations. The scf dialect describes structured control flow, while cf exposes control flow in a lower-level form. Operations also pass through representations for arithmetic and memory references, arith and memref, at points where the compiler can simplify expressions and storage. The final MLIR llvm dialect leads to the LLVM IR file handed to Bambu.
A direct lowering can give Bambu enough instructions to implement the original calculation. SODA’s optimization path uses the intermediate stages to change the arrangement of that calculation first. Consider a loop that performs similar operations on successive values. At a high level, the compiler can see the repeated body and the expressions that determine which data it touches. After lowering to branches and individual instructions, an optimizer may have to reconstruct those relationships to make the same change. SODA chooses the stage where the relationships are already expressed in a useful form.
The pipeline is composed of passes, each of which analyzes or changes the representation. Some of the passes come from MLIR and others are oriented specifically toward HLS. The developer can select passes and tune their options. This creates different candidate implementations from the same computation. There is no single mathematical objective defining how the tool should choose among runtime, area, and power. The paper specifies transformations and evaluates the designs they produce under chosen settings.
Give the scheduler independent work to consider
Unrolling expands loop iterations into multiple instances of the body. Consider a loop whose iterations read separate values and compute independent results. While the loop stays compact, the repeated operations are expressed through the iteration structure. After unrolling, the synthesis input can expose several individual operations at once. If their operands are ready and the hardware has the required resources, the scheduler can issue them concurrently.
The scheduling advantage depends on what is inside the loop. An operation that needs an earlier result still has to wait for it. Multiple memory accesses need the available memory resources to serve them. Expanding a loop can also make a greater demand on functional units if the resulting design is intended to carry out more work in each cycle. SODA uses unrolling to make opportunities visible, and Bambu decides what schedule and resources can realize them.
Tiling divides a larger iteration space into portions. The intent in the convolution experiments is to control the amount of arithmetic and memory parallelism that the circuit has to implement at once. A tile can contain multiple independent operations that benefit from unrolling. Its limited extent can also bound how much data and work the circuit has to handle during an invocation. A full convolution and a circuit for a repeated tile can therefore perform the same overall operation through different schedules and patterns of data access.
The paper also associates tiling and unrolling with concentrating computationally intensive work in one basic block. A basic block is a straight-line sequence of instructions that proceeds without a branch within the sequence. When many relevant operations are available within such a region, the synthesis scheduler can consider their dependencies together. If memory accesses can reach distinct resources concurrently, making those accesses explicit can expose parallelism in data movement as well as in arithmetic.
Keep useful values close to the computation
Several passes change the way the kernel holds and accesses data. The paper lists temporary-buffer allocation and buffer promotion among the techniques that support local reuse. To see why they matter, consider a value read from a kernel argument and then used by several operations. Repeatedly issuing a read makes each use depend on another memory access. Keeping the value locally allows later operations to use the result of the earlier read. An intermediate accumulation can similarly stay in a scalar temporary while the calculation proceeds, with the completed result written out at the appropriate point.
Scalar replacement of aggregates, or SRoA, is part of this storage work. An aggregate groups values in a storage object. When the compiler can identify the parts touched by the computation, it can represent appropriate parts as individual scalar values. That can let the hardware hold values in registers and avoid repeated accesses to the aggregate. The compiler has to be able to identify the accessed elements for the transformation to apply. Loop bounds and index expressions therefore influence whether a change intended to help memory behavior is available at all.
SODA also carries information about aliasing. Two arguments can alias if they refer to overlapping storage. If a write through one argument might change the value read through another, access order may matter. A synthesis tool that lacks evidence about the overlap must preserve possible dependencies. When SODA supplies reliable non-aliasing information, Bambu can schedule accesses to those arguments independently where the resources permit. The mechanism communicates a property of the program from the stage where it can be recognized to the stage where it affects timing.
Common subexpression elimination, abbreviated CSE, lets later uses take an existing result when the same computation would otherwise be repeated. Dead code elimination, or DCE, removes work whose result is unnecessary. In hardware synthesis, redundancies can occupy time in the schedule or contribute to the resources allocated to a design. Cleaning them up can help after transformations have expanded or reorganized the computation. Bambu can perform some of the same general kinds of cleanup. The paper treats their availability at both stages as a consequence of the multilevel design, with pass interactions addressed individually when needed.
Build a circuit from the prepared LLVM program
Bambu reads the frontend’s LLVM IR through its Clang-based input path and constructs its own representation for HLS. It analyzes widths of values and performs loop optimizations along with resource allocation, scheduling, and binding. These operations connect the program to a clocked circuit. Allocation decides what resources the design can use. Scheduling places work in time. Binding associates operations with specific resources, so the circuit can use a unit repeatedly or assign independent work to separate units.
For example, a series of arithmetic operations with ready inputs might be distributed among units in the same cycle, or it might use fewer units across several cycles. The scheduler must account for when operands are available and how long each unit takes. The design must also move results to the places where later operations need them. The choices are related. Binding several operations to one unit can require a different schedule, and a schedule that moves more operations into the same cycle can require more hardware.
Bambu generates an RTL design organized as a finite-state machine with a datapath, abbreviated FSMD. The finite-state machine controls the progression of execution. The datapath includes the registers, functional units, and connections that carry out the work. Bambu can emit Verilog or VHDL, and it can produce testbenches. In the reported ASIC flow, the generated Verilog proceeds to verification and downstream implementation.
The backend can also produce function modules that can be reused or replicated within a larger design. The paper discusses extensions that use such modules as processing elements in coarse-grained dataflow architectures, as well as templates that dynamically schedule multithreaded work. A dataflow arrangement organizes execution around the movement and availability of data among processing elements. The authors see a route from MLIR’s hierarchy to these backend capabilities. Structured operations can help identify independent work, while affine regions can express tasks. Automatic selection and construction of those wider architectures from SODA-OPT is a prospective use of the infrastructure.
Use target-specific information to make timing choices
The resource library gives Bambu descriptions of units such as adders and multipliers, with implementations appropriate to different data types. An available unit also needs timing and area information. A synthesis algorithm needs to know how much hardware the unit uses and whether an operation or a chain of operations can fit within the requested clock period. Interconnection costs matter because an operation has to receive and deliver its values within the planned timing.
The authors broaden the characterization by synthesizing functional units for FreePDK and collecting the resulting measurements of library area and performance. A practical question this helps answer is whether the output of a unit can feed the next unit within the same clock period. If the total path meets timing, the tool can potentially chain the operations without a register between them. If it cannot, a register boundary changes both the schedule and the circuit.
Floating-point arithmetic provides the paper’s concrete example. For the ASIC target, the authors generate floating-point units from a C software implementation of the arithmetic. This gives them a way to support FP32 and FP64, with full IEEE754 compliance available if required. The total latency of their FP32 multiplier is 5 cycles at 500 MHz and 4 cycles at 200 MHz. The example distinguishes the number of cycles assigned to an operation from the clock frequency of the target. A tighter clock period can lead to a design that spreads the operation over more cycles.
For ASIC implementation, the paper describes an open-source route using OpenROAD and the FreePDK 45 nm cell library. It also describes a Design Compiler route with FreePDK 45 nm or Global Foundries 12/14 nm targeting. In these flows, the HDL describes the circuit to be realized, and the implementation tools produce a physical design. The paper shows LeNet layouts in GDSII, the layout format used for the ASIC output. The backend can also target FPGAs, although the numerical studies discussed below concern ASIC generation.
Check the circuit through reference execution
Verification begins with values for the kernel inputs, supplied to Bambu in an XML file. Bambu can create a Verilog testbench and the scripts needed to run it. A testbench provides inputs to the circuit description and observes its behavior during simulation. The paper’s flow uses Verilator for this stage. Bambu compares the outputs from the simulated circuit with reference outputs obtained by executing the original computation on the supplied values.
This check links the final circuit behavior back to the calculation that entered the flow. It matters because the compiler has changed loop organization, storage, and scheduling along the way. A layout shows that implementation tools were able to realize a circuit description. Comparison with the reference tests whether the generated circuit performs the intended computation for the supplied inputs. The performance experiments use randomly generated test vectors and obtain kernel execution times through simulation.
The paper identifies SODA-OPT and PandA-Bambu HLS as the implementation components at the center of the flow. OpenROAD provides the open-source physical implementation path, and Verilator provides the simulation used for the reported verification setup. The distinct roles explain what SODA integrates. The frontend prepares the computation, the backend makes a clocked hardware design, simulation checks its behavior where exercised, and physical design turns the circuit into a placed and routed layout.
Experiments and results
What the baseline holds fixed
The experiments ask what changes when SODA-OPT transforms the computation before Bambu receives it. The baseline begins with MLIR and lowers it without the high-level optimizations. The comparison starts from the same computation and uses a selected frontend transformation or the full experimental pipeline. Both conditions use Bambu with -O2. Thus labels such as noopt and No Opt. refer to the MLIR stage. The baseline circuit still receives the backend’s normal treatment.
The metrics describe several different properties. Clock cycles count how long hardware execution lasts in the simulated schedule. Runtime expresses the duration at the specified clock. Speedup compares a configuration with its baseline. Physical-design results report circuit area and power. GFLOPS expresses floating-point throughput, and GFLOPS/W expresses throughput per watt. The last measure can move in a different direction from execution time if a design raises throughput by committing more hardware and drawing more power.
The paper uses randomly generated inputs for timing the generated kernels in simulation. It describes area and power as physical-design results after placement and routing. The tables identify the process technologies used for particular comparisons. These measurement conditions are important for reading the study. The baseline and optimized kernel at a given target can be compared directly, while moving to a different process technology changes the physical context in which the circuit is realized.
PolyBench isolates linear algebra kernels
The authors describe their evaluation as covering 14 linear algebra kernels from PolyBench. The kernels start in C and enter SODA in the affine dialect. Each is simulated on its own, which lets the authors compare the schedules produced by their compilation settings without the behavior of a host application. In the table, kernel size specifies the extent used for the dimensions of input and output tensors. The tested sizes shown there are 2, 4, 8, and 16. The hardware target is FreePDK 45 nm at 500 MHz.
For the optimized designs, the authors fully unroll the three innermost loops, enable the buffer transformations, mark function arguments as non-aliasing, and apply CSE, DCE, and SRoA. The baseline proceeds through direct lowering to LLVM IR and the shared Bambu stage. The authors report an average speedup of 18x and summarize the best result as 86x. The visible table gives the strongest individual entry as 86.1x for symm at kernel size 4.
PolyBench symm at kernel size 4, simulated execution cycles
The frontend pipeline gives Bambu a computation it can schedule in far fewer cycles.
The numbers
| System or setting | clock cycles |
|---|---|
| Direct MLIR lowering | 2,928 |
| SODA-OPT Pipeline (this paper) | 34 |
The symm result illustrates that a favorable size can make an unusually large difference. At size 2 the corresponding speedup is 13.6x. At sizes 8 and 16 it is 65.8x and 62.8x, respectively. Those entries still show substantial gains at the larger sizes. They also make clear that the headline peak describes a particular combination of kernel and dimensions.
Other kernels show different relationships with size. For doitgen, the reported speedups are 9.6x at size 2, 16.6x at size 4, 32.8x at size 8, and 60.5x at size 16. The size 16 implementation goes from 999,698 baseline cycles to 16,512 cycles using the frontend pipeline. For gemm, the reported speedup is 26.6x at both size 8 and size 16. The larger of those cases takes 95,376 cycles with direct lowering and 3,584 after frontend optimization. These examples show that the broad gain appears across distinct kernels without following a single progression as dimensions change.
The evaluation includes intermediate and weak outcomes. At size 16, gemver has a reported speedup of 10.4x and atax has 7.0x. At the same size, syr2k and syrk reach 2.8x and 2.4x. The trmm entries at sizes 4, 8, and 16 show 1.0x, with identical baseline and optimized cycle counts at each of those sizes. At size 2, trmm reaches 1.9x. This range gives the subsequent pass analysis a concrete problem to explain. Some kernels gave the hardware generator much more freedom after transformation, while several retained essentially the same schedule at the larger dimensions.
LeNet shows how the response varies by operator
The neural-network study starts from LeNet, MobileNetV2, ResNet-18, and ResNet-50. The authors select representative operators because networks repeat computational patterns. Their LeNet whole-layer results include convolution, bias addition, and rectified linear activation. A bias operation adds an offset, and the activation in these rows is a ReLU. The authors say the selected LeNet operations account for 98% of its execution time. Each reported row describes one accelerator implementation. The layout figure shows generated physical designs for the layers, and the table compares the implementations at FreePDK 45 nm and 500 MHz.
The convolution rows enable non-aliasing information as the frontend change. CONV 01 goes from 10,262,618 cycles to 4,627,982 cycles and has a reported speedup of 2.22. Its area increases from 29,073 µm² to 124,255 µm², and its power from 0.01380 W to 0.05060 W. The throughput values go from 0.061 GFLOPS to 0.135 GFLOPS. With the higher power draw, the efficiency figures move from 4.43 GFLOPS/W to 2.68 GFLOPS/W. The frontend change therefore gives a clear runtime benefit for this convolution alongside a cost in physical resources and throughput per watt.
On CONV 04, the same frontend option yields a reported speedup of 1.02. The baseline takes 85,380,948 cycles, and the noalias design takes 83,380,180 cycles. Its area and power change comparatively little in the displayed designs, while efficiency is 3.32 GFLOPS/W in the baseline and 3.34 GFLOPS/W with the optimization. The table shows how differently whole convolutions can respond even when the experiment supplies the same category of information to the backend.
The bias and activation rows combine non-aliasing with unrolling. For BIAS 02, the cycle count moves from 251,694 to 40,826, and the table reports a speedup of 6.17. The baseline achieves 11.48 GFLOPS/W and the faster design achieves 9.01 GFLOPS/W. For RELU 03, the baseline takes 151,342 cycles and the selected frontend settings reduce that to 38,446 cycles, with a reported speedup of 3.94. Its efficiency values are 41.55 GFLOPS/W and 38.39 GFLOPS/W. In the other bias and activation rows, the table gives speedups of 6.16 for BIAS 05 and 3.93 for RELU 06.
Across the selected LeNet experiments, the authors describe speedups up to 6.2x and efficiency ranging from 2.68 to 41.75 GFLOPS/W. That efficiency range includes the baseline as well as the transformed implementations. Its upper endpoint is the baseline RELU 06 row. The different rows represent different operations, so the range characterizes the generated set of designs. The paired rows show the effect of changing frontend settings for an individual operation.
MobileNetV2 tests one frontend change on related layers
The selected MobileNetV2 kernels are depth-wise convolutions, labeled DWC2D. They share a computational structure and differ in tensor dimensions and loop bounds. The paper attributes 35% of MobileNetV2 inference time to the selected layers. It compares direct lowering with propagation of non-aliasing information alone, again for FreePDK 45 nm at 500 MHz.
MobileNetV2 DWC2D 01 at FreePDK 45 nm, simulated execution cycles
Supplying non-aliasing information shortens the schedule for this depth-wise convolution.
The numbers
| System or setting | clock cycles |
|---|---|
| No frontend optimization | 87,319,010 |
| Non-aliasing information (this paper) | 43,966,946 |
The table reports a speedup of 1.99 for each displayed MobileNetV2 layer. For DWC2D 02, the cycle counts are 65,482,874 before the frontend change and 32,968,826 after it. For DWC2D 05, they are 32,740,654 and 16,483,630. The matching reported speedups across layers support the authors’ account that the same structural opportunity is present at the different dimensions. With separate arguments established as non-overlapping, Bambu can schedule memory accesses to them in parallel when resources permit.
The physical tradeoff in the displayed MobileNetV2 rows differs from that in the faster LeNet convolution. For DWC2D 01, the area grows from 39,106 µm² to 62,676 µm², and power rises from 0.01800 W to 0.02570 W. Efficiency also improves, from 3.45 to 4.80 GFLOPS/W. For DWC2D 02, efficiency moves from 0.87 to 1.23 GFLOPS/W. For DWC2D 05, it moves from 3.61 to 4.91 GFLOPS/W. In these pairs, the reported throughput gains are sufficient to raise operations per watt even as the larger implementations draw more power.
Reusable tiles change the amount of work in each circuit invocation
The authors then tile a convolution and outline the tile as the hardware unit. The design is intended to run repeatedly to carry out a full layer. They also arrange for compatible layers within deeper networks to use the same tile. The planned reuse covers 35 convolutional layers in MobileNetV2, 14 in ResNet-18, and 46 in ResNet-50. The tile table gives settings for LeNet, MobileNetV2, and a shared ResNet case. Each tile is synthesized with and without the SODA-OPT pipeline.
The cycle counts at 500 MHz show the effect of the pipeline on the outlined portions. The LeNet tile takes 1,809 cycles with frontend optimization off and 125 with it on. Those rows give runtimes of 3.62E-06 seconds and 250.00E-09 seconds, respectively. The MobileNetV2 tile takes 3,194 and 225 cycles. The ResNet tile takes 963 and 99 cycles. In the table’s separate average-speedup column, the figures are 15.25 for LeNet, 14.20 for MobileNetV2, and 9.73 for the shared ResNet tile. The prose describes the best speedup as 15.2x. These figures refer to paired tile designs. Comparing a repeated tile with a full layer is a separate exercise.
The tile table reports physical results for FreePDK 45 nm and a column group labeled GF 12nm. In the GF 12nm LeNet rows, the baseline uses 8,470 µm² and 0.00017 W, while the pipeline design uses 169,635 µm² and 0.00689 W. The configuration with the shorter runtime therefore comes with a much larger accelerator and higher power. The reported efficiency is 364.19 GFLOPS/W for the baseline and 130.04 GFLOPS/W for the pipeline design.
Reusable convolution tiles at GF 12nm, floating-point efficiency
The highest efficiency belongs to the LeNet baseline, while MobileNetV2 improves with the frontend pipeline.
The numbers
| System or setting | GFLOPS/W |
|---|---|
| LeNet, frontend optimization off (this paper) | 364.19 |
| LeNet, SODA-OPT | 130.04 |
| MobileNetV2, frontend optimization off | 103.31 |
| MobileNetV2, SODA-OPT | 166.56 |
| Shared ResNet tile, frontend optimization off | 176.75 |
| Shared ResNet tile, SODA-OPT | 142.08 |
MobileNetV2 moves in the other direction on this metric at GF 12nm. Its pipeline design reaches 166.56 GFLOPS/W, compared with 103.31 GFLOPS/W before frontend optimization. The ResNet tile follows the same direction as LeNet, with 176.75 GFLOPS/W in the baseline and 142.08 GFLOPS/W with the pipeline. The FreePDK 45 nm tile rows give a different pattern for MobileNetV2. There the corresponding pair is 5.84 GFLOPS/W and 2.28 GFLOPS/W. In that set of physical results the fastest frontend setting has lower reported efficiency for every tile pair. Both process target and kernel matter when interpreting whether the faster configuration also performs more arithmetic per watt.
The abstract’s figure of 364 GFLOPS/W at 32-bit precision describes the upper end of the designs generated by the toolchain. The table locates it in the LeNet tile family with high-level optimization disabled. That setting still uses the toolchain and the shared Bambu optimizations. Enabling the high-level pipeline tests a distinct intervention and produces the faster design in that pair. Associating the headline with its actual row makes it possible to distinguish what the flow can generate from what its full frontend pipeline improves.
From an individual tile to a repeated operation
The authors compare the fastest outlined CONV 04 implementation with repeated calls to the optimized LeNet tile. In their comparison, the full layer takes 14.89x as long as running the tile 44,800 times. That comparison assumes a private scratchpad, a local memory used to hold values for the accelerator. The scratchpad has two ports, with load latency of 2 cycles and store latency of 1 cycle. Those conditions are part of the estimate because the timing of a repeated computation depends on how operands and results move between the accelerator and storage.
This experiment has a different scope from comparing a baseline tile to an optimized tile. The tile-to-tile comparison fixes the computation covered by each invocation and changes the frontend preparation. The full-convolution comparison changes what the circuit contains and how many times it is invoked. It therefore illustrates what can be gained by choosing a different partition, given an explicit local memory arrangement.
The authors also report turnaround for generating the designs. They report that each went from a high-level description to GDSII in under three hours on a node equipped with 256 GB of DDR4 3 and a pair of 16-core AMD EPYC 7282 CPUs.2 GHz memory. The bound describes the reported synthesis jobs on that machine. It gives a concrete measure of the time used to produce the studied physical designs, including the stages after HLS.
What the ablations show
The strongest measurements test the passes together
The paper’s main controlled comparison removes the high-level optimization pipeline as a group. For PolyBench, the same computation and Bambu optimization setting are used in both conditions. The large reductions in cycle counts establish that the frontend’s changes can help Bambu generate a shorter schedule. The setup measures the package of unrolling, storage changes, alias information, and cleanup passes. It gives no individual numerical contribution for each of those passes across the benchmark suite.
That distinction matters because a pass can change what another pass is able to do. Unrolling makes separate operation instances visible. Some of those instances may use the same value or access parts of an aggregate that can now be identified. A subsequent pass can then remove duplicate calculations or replace accesses with scalar values. Conversely, a dependence that persists after unrolling can prevent the hardware scheduler from exploiting the additional visible operations. The comparison captures the result of taking all these steps together.
The LeNet bias and activation measurements are another combined comparison. They enable both non-aliasing information and unrolling on the selected operations. Their gains establish the result of that choice for those kernels. The convolution rows use non-aliasing alone, but those rows concern different operations. They do not provide a way to infer the isolated contribution of unrolling on the bias and activation kernels. That would require matched variants of those same kernels.
The MobileNetV2 pairs identify a specific scheduling constraint
The depth-wise MobileNetV2 comparisons have a narrower change. The same operation is synthesized with and without frontend non-aliasing information. In the selected layers, supplying the information produces a similar relative change even as tensor dimensions and loop limits vary. This is the paper’s clearest experimental support for the idea that missing information about memory independence was holding back the schedule.
The causal account is about what Bambu can safely assume. If a write through one argument could affect a value accessed through another, the scheduler has to preserve the relevant ordering. The non-aliasing information removes that possible dependency. The table is consistent with the authors’ explanation that Bambu can then use concurrent memory operations. The paired comparisons measure the resulting schedules and physical costs. They do not enumerate which individual accesses advanced or how the scheduler used every memory unit.
The corresponding LeNet evidence places a useful boundary around the finding. Giving Bambu non-aliasing information helps CONV 01 more than CONV 04. Removing one constraint can help only to the extent that independent accesses were important to the schedule and the rest of the hardware can exploit them. The MobileNetV2 results concern structurally related layers. The difference between the LeNet layers shows why their response should not be extrapolated from the fact that both perform convolutions.
The weak PolyBench cases locate a problem before scheduling
The authors discuss syr2k, syrk, and trmm because the pipeline delivers small gains or no gain in several displayed cases. Their explanation concerns bounds on nested loops. An induction variable is the value that tracks the current iteration of a loop. When the bound of an inner loop depends on the induction variable of an outer loop, the amount of inner work varies with the outer iteration. That dependence can also affect the program’s descriptions of which storage elements are used.
In these cases, the paper says that SRoA cannot carry out scalar replacement. The obstacle occurs before Bambu’s final scheduling choices. The frontend cannot fully prepare the individual values that the intended transformation would expose. A kernel can have useful mathematical structure and still arrive at synthesis with the storage relationships that the pass was supposed to simplify. The unchanged trmm cycle counts at the larger tested sizes show how little the combined pipeline can achieve in that circumstance.
The authors propose an additional pass that would simplify index calculations where loop bounds are known. This is a diagnosis and a suggested repair. The paper gives no rerun with the proposed pass and no estimate of how many cycles the affected kernels would gain from it. Its evidence identifies a concrete prerequisite for improvement and gives cases on which a future implementation could be evaluated.
The tile comparisons change architecture and compilation separately
The experiments compare frontend settings within a fixed tile and also compare repeated tile execution with a full convolution accelerator. The former shows that Bambu can produce a much shorter tile schedule after the selected preprocessing. The latter evaluates a different grain of hardware computation, along with the repeated invocations and the assumed scratchpad timing. The full-layer advantage reported for CONV 04 therefore reflects a change in how the work is divided and delivered to hardware as well as what the optimizer can do within a selected region.
The physical results add an independent check on what the larger speedups mean. A design with more simultaneous work can require more resources. The LeNet tile undergoes a pronounced increase in area and power while executing faster, and the optimized version has lower reported efficiency. The MobileNetV2 tile at GF 12nm has higher reported efficiency after the optimization. Comparison across those pairs shows why the shortest schedule, the smallest design, and the largest throughput per watt need to remain distinct experimental outcomes.
Limitations
Limits the authors identify
The scope of the frontend is conditional on the input reaching a supported MLIR form. The paper argues that this can cover a broad range of computational patterns, including patterns that have no direct mapping to an existing accelerator template. That argument depends on the lowering available from the source framework. The demonstrated routes describe specific ways to bring computations into SODA. The title’s reference to Python is best understood through those framework routes.
Some compiler optimizations are available on both sides of the frontend-backend boundary. The authors explicitly acknowledge that passes at different stages could interfere. Their described response to a disruptive interaction is to control backend passes individually. The modular architecture permits that adjustment, but the paper leaves general coordination between the two sets of passes open. It likewise identifies the dependent-loop indexing problem in the PolyBench study as a limitation of the implemented frontend.
The scope of reported accelerator architectures also differs from the scope of the backend’s capabilities. The authors outline how SODA-OPT could take advantage of MLIR’s hierarchy to create larger dataflow or task-parallel arrangements. They also discuss possible improvements on the host path, including running accelerators in parallel, making better use of CPU caches, and reusing accelerator instances automatically when appropriate. These are proposed uses of the infrastructure. In the reported evaluation, evidence for reuse comes from the choice of compatible convolution tiles, while evidence for execution comes from the selected generated kernels.
The authors point out that their chosen linear algebra and neural-network workloads could also be implemented with templated accelerators. They use the workloads because the computations are common in high-level frameworks and allow them to examine frontend optimizations. The experiments therefore support the flow on familiar computations. The argument for applicability to less common patterns rests on the compiler architecture and the availability of a suitable MLIR description.
Limits visible in the evaluation
Kernel speed does not settle application speed. The linear algebra experiments deliberately isolate kernels. The neural-network runs select layers with substantial execution-time coverage or use tiles compatible with multiple layers. Those selections tell the reader why the kernels matter to the networks. They leave open how the circuits would perform together under actual host control, with time spent invoking accelerators, moving values between different levels of storage, and sharing resources. The conditional full-convolution comparison includes explicit local memory timings, but it is still a comparison under an assumed scratchpad arrangement.
The execution measurements come from simulation. Area and power are assessed from physical design, and the GDSII layouts demonstrate that the flow produces physical artifacts for the chosen implementations. The paper reports no measurements on a manufactured accelerator. Actual operation of a fabricated design under application conditions is a separate test. The same distinction applies to verification. Matching simulated outputs to reference execution on the supplied vectors tests the inputs exercised. The procedure does not establish agreement over every input, and the paper does not present a comprehensive numerical conformance evaluation of the accelerator variants.
The experiments measure hardware performance and cost using computations derived from trained neural networks. They do not compare different training strategies or report changes in prediction quality. The network preparation matters because it gives SODA real operators and parameters to compile without changes to the high-level descriptions. The evaluation then concerns the generated implementations of those operators.
The quantitative baseline isolates frontend preparation with a common backend. There is no matched comparison against a manually designed RTL accelerator, a commercial HLS flow, or a particular parameterized architecture from the related-work discussion. The paper gives reasons to expect architectural differences between those approaches, but the reported speedups answer the narrower question of what SODA-OPT adds when Bambu already performs its own optimizations. They do not measure how much design effort an alternative flow would need to reach the same area, power, and runtime.
Pass selection makes design exploration possible, but the paper reports selected settings. It supplies neither an exhaustive search result nor a rule that automatically chooses the best setting for a given constraint. The results show why such a choice would need an explicit objective. A configuration that wins on cycle count can require more area or yield fewer operations per watt. The reported turnaround applies to the designs that the authors generated and to their stated machine. It gives no general bound for larger regions or for a search over many pass combinations.
Some reported details also require care when reading across the paper. The PolyBench prose gives a kernel count of 14, while the displayed table lists fewer named kernels. The stated 18x average is therefore best treated as the authors’ aggregate, without reconstructing its scope from the displayed rows. The neural-network prose also describes whole-convolution increases as no higher than 2.1x in its discussion of reusable accelerators, whereas the whole-layer table gives CONV 01 a speedup of 2.22. The individual table result can be attributed to that kernel and setting. The broader prose statement should be read with this discrepancy in view.
What came after
There is no documented later citing work to trace here. The paper itself identifies unfinished routes for extending the system. One runs through the frontend’s treatment of index expressions, where simplifying accesses could make scalar replacement possible on more loop structures. Another runs through application partitioning, where the same representation that identifies independent operations could help express parallel accelerator execution. The paper leaves those extensions as proposals. Its demonstrated contribution is the connected compilation path and the measured effect of selected frontend and partitioning choices on the circuits it generates.
Cite
Cite as Nícolas Bohm Agostini, Serena Curzel, Jeff Jun Zhang, Ankur Limaye, Cheng Tan, Vinay Amatya, Marco Minutoli, Vito Giovanni Castellana, Joseph Manzano, David M. Brooks, Gu-Yeon Wei and Antonino Tumeo. 2022. Bridging Python to Silicon: The SODA Toolchain. IEEE Micro.
@inproceedings{agostini2022bridging,
title = {{Bridging Python to Silicon: The SODA Toolchain}},
author = {Nícolas Bohm Agostini, Serena Curzel, Jeff Jun Zhang, Ankur Limaye, Cheng Tan, Vinay Amatya, Marco Minutoli, Vito Giovanni Castellana, Joseph Manzano, David M. Brooks, Gu-Yeon Wei and Antonino Tumeo},
booktitle = {IEEE Micro},
year = {2022},
doi = {10.1109/mm.2022.3178580},
url = {https://doi.org/10.1109/mm.2022.3178580}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/agostini-2022-bridging-python-silicon-soda-toolchain/