Budget the pipeline you can actually synthesize
Relate initiation interval, first-result latency, memory traffic, and implemented resource limits in FPGA inference.
On this page
The question for today
What you’ll understand
- Distinguish pipeline latency from initiation interval.
- Compute a throughput ceiling constrained by input bandwidth.
- Explain folding, buffering, precision, and post-route timing requirements.
An FPGA inference design can map successive layers into a streaming pipeline instead of launching general-purpose kernels for each layer. That makes dataflow and buffering central architectural choices. A deeply pipelined operator may accept a new item every few cycles while taking many cycles to produce its first result. Quoting only its clock frequency or arithmetic count hides that distinction. Begin with a precise definition of an item, the number of items per inference, and the input/output protocol, then connect compute resources to memory traffic and implemented timing.
Separate acceptance rate from first output
Initiation interval is the number of clock cycles between accepted input items under the relevant pipeline conditions. Latency is the cycle count from an item’s acceptance to its result. A design can have latency twenty cycles and initiation interval one without contradiction because many items occupy different stages simultaneously. For a finite stream, fill and drain remain visible. Backpressure or missing inputs can add stalls beyond the ideal initiation-interval calculation.
A requested HLS initiation interval is a synthesis goal rather than a hardware guarantee. Dependencies, limited arithmetic resources, memory ports, and timing constraints can force a larger achieved interval. The AMD Vitis HLS 2024.2 documentation explicitly distinguishes that request from the achieved design. Inspect synthesis reports and post-implementation timing. A schedule estimated at an aggressive clock is not the same evidence as a placed-and-routed design meeting that clock on a particular FPGA and tool version.
Balance folded compute with data supply
Unrolling creates parallel work but consumes multipliers, logic, registers, routing, and memory bandwidth. Folding reuses hardware across logical operations, trading resources for more cycles. A layer-wise streaming design must balance stages so an overprovisioned early stage does not merely wait for a slower later one. Keep FIFO occupancy and backpressure visible, and size buffers from producer-consumer rates and burst behavior rather than guessing a depth that passes one simulation.
External traffic can become the bottleneck after arithmetic is replicated. Count weights, activations, outputs, metadata, and any reloads that do not remain on chip. A local buffer improves reuse only while it fits and is supplied through enough ports. Quantized or binary arithmetic may reduce resource and byte costs, but its accuracy and representation differ from floating-point inference. FINN demonstrates workload-specific streaming architectures for binarized networks; it does not establish that an arbitrary floating-point model inherits the same throughput or quality.
Validate the complete implemented inference path
Use bit-accurate comparisons or declared numerical tolerances against the chosen model reference. Include accumulation width, rounding, saturation, activation functions, and unsupported-operator fallbacks. A fast stream producing a lower-quality answer is a different design point, not a free hardware speedup. Test boundary shapes, partial tiles, and variable input sizes. A static pipeline built for a fixed shape may require padding or recompilation when the application changes its request contract.
Measure host preparation, transfers, queueing, pipeline execution, and result consumption together, then separately report the accelerator’s steady streaming rate. State whether power covers the FPGA fabric, board, host, or full system, and whether weight loading and reconfiguration are amortized. Release the model, compiler, HLS/RTL configuration, target part, timing reports, and measurement procedure. These artifacts let another evaluator distinguish an architectural estimate from a working implementation at the claimed operating point.
Work it through
The memory path limits a fast fictional pipeline
A fictional FPGA pipeline runs at 200 MHz with achieved II=4 and first-result latency L=20 cycles. It processes 100 items without stalls. Each item also requires 16 external bytes and the sustained external budget is 400 decimal MB/s. Calculate compute-only timing and the steady input-bandwidth ceiling.
The compute acceptance ceiling is 200×10⁶/4=50 million items/s. First-result latency is 20/(200×10⁶)=100 ns; it is distinct from the 20 ns acceptance interval.
For 100 continuously supplied items, compute-only completion is 20+99×4=416 cycles, or 416/(200×10⁶)=2.08 microseconds under the counting convention.
External supply can support at most 400×10⁶/16=25 million items/s. Thus the combined steady ceiling is 25 million items/s before other constraints, and the no-stall compute-only timing cannot be assumed for that memory-fed run.
A pipeline’s initiation interval does not remove its data-supply limit. These fictional item rates become inference rates only after specifying how many items one inference consumes.
The living notebook
Explore the model
Interactive lab · roofline
Expose the data-supply ceiling
Reset, set Operational intensity I to 2 and Memory bandwidth B to 100. Predict synthetic ceiling 200 GFLOP/s before Step. Reset, explicitly set I=8 and B=100, then Step: predict 800 GFLOP/s, still below the fixed 1000 GFLOP/s compute ceiling. Playback traces a fixed roofline. This model does not synthesize FPGA logic, calculate initiation interval, or predict any board’s measured rate.
- Attainable ceiling
- 640 GFLOP/s
- Ridge intensity
- 12.5 FLOP/byte
- Ceiling regime
- Memory-bound ceiling
Synthetic roofline ceiling min(1000, B·I), in GFLOP/s, with B in decimal GB/s and I in FLOP/byte. Playback traces the roof without changing the selected kernel. This upper-bound model is not a measured throughput prediction, hardware comparison or price model. 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 forReplicated compute helps only while the required data can be supplied.
Pause & reason
Check your understanding
Your turn
Try it yourself
A pipeline achieves II=2 at 150 MHz and transfers 12 external bytes per item. Its sustained external budget is 600 decimal MB/s. Find compute and memory item ceilings and the combined bound.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Compute frequency/II and bytes-per-second/bytes-per-item independently.
Compare with the solution
Compute supports at most 150×10⁶/2=75 million items/s. External supply supports 600×10⁶/12=50 million items/s, so the combined bound is 50 million items/s before other overheads. Reaching it still requires the achieved timing, valid dataflow, and no tighter output or resource bottleneck.
Keep the idea
Take it with you
- Define items, achieved initiation interval, and first-result latency separately.
- Balance unrolling and folding against ports, buffers, and external traffic.
- Require implemented timing and matched model-quality evidence.
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.