TL;DR
XtraMAC is a novel, datatype-adaptive multiply-accumulate (MAC) architecture that unifies integer, floating-point, and mixed-precision operations into a single FPGA microarchitecture. By decomposing diverse numerical formats into a shared integer mantissa product with lightweight peripheral logic, it enables cycle-level runtime datatype switching and multi-lane operand packing while maintaining constant latency and maximum throughput.
What Problem Does This Paper Address?
To make Large Language Models (LLMs) faster and more memory-efficient, researchers and engineers rely heavily on quantization. However, modern LLM deployment frameworks rarely use a single numeric format. Instead, they mix and match: compute-heavy projection layers might use low-bit integers (like INT4) to save memory, while sensitive attention layers retain floating-point formats (like BF16) to preserve model accuracy.
This creates two major hardware challenges: handling mixed-precision MAC operations (e.g., INT4 $\times$ BF16) and supporting runtime datatype switching as execution moves from layer to layer.
Existing FPGA-based solutions handle this variability poorly. They typically either "upcast" low-precision data to match a fixed high-precision format (wasting valuable hardware bit space) or replicate entirely separate hardware paths for each datatype (leaving parts of the chip idle). This results in severely under-utilized Digital Signal Processing (DSP) blocks—the core arithmetic engines of an FPGA.
Methods
The authors introduce XtraMAC, a microarchitecture that cleanly decouples format interpretation from arithmetic execution through the following innovations:
- Unified Multiplication Formulation: The authors demonstrate mathematically that integer, floating-point, and mixed-precision multiplications can all be stripped down to a core integer mantissa product. The sign and exponent logic can be handled separately by lightweight logic outside the multiplier.
- Multi-Lane DSP Packing: XtraMAC exploits this unified formulation by packing multiple low-precision mantissa lanes into a single physical DSP block (e.g., up to four lanes for FP4/FP8, or two lanes for BF16), drastically multiplying compute density.
- Decoupled Accumulation: While multiplication is unified, addition is kept separate. Floating-point addition requires expensive barrel shifters for exponent alignment, whereas integer addition relies on simple carry chains. XtraMAC implements decoupled integer and floating-point adder paths, ensuring that simple integer math isn't forced to waste resources traversing complex floating-point shifters.
- 4-Stage Fixed Pipeline: Operands are mapped and packed in Stage 1, multiplied via a datatype-invariant DSP block in Stage 2, accumulated via the decoupled paths in Stage 3, and selected/assembled in Stage 4. This structure guarantees an Initiation Interval (II) of 1 (one operation per clock cycle) across all datatypes.
Datasets
The architecture was evaluated using workloads derived from real-world quantized LLM checkpoints available on HuggingFace:
- Qwen-3-8B-AWQ (utilizing INT4 $\times$ BF16 + BF16)
- Llama-3.1-8B-W8A8 (utilizing INT8 $\times$ INT8 + INT32)
- Qwen-3-8B-FP8 & Llama-3.1-8B-FP8 (utilizing FP8 $\times$ FP8 + BF16)
- GPT-oss-20b (utilizing FP4 $\times$ BF16 + BF16)
Key Insights and Ideas
- All Math is Integer Math at the Core: The realization that mixed-precision and floating-point multiplication can be cleanly mapped onto standard integer DSP blocks means hardware designers do not need specialized, rigid floating-point silicon for every new format variation.
- Unify Multiplication, Decouple Addition: A unified architecture shouldn't mean a completely uniform pipeline. Forcing simple integer addition through complex floating-point alignment shifters destroys resource efficiency. Separating the accumulation paths is the secret to keeping the look-up table (LUT) footprint small.
- Pipeline-Invariant Exception Handling: Instead of stalling or flushing the pipeline when encountering special values (like NaNs or infinities), XtraMAC passes status flags alongside the data stream, resolving exceptions purely through combinational logic at the final output stage.
Key Results
- Compute Density: XtraMAC achieves 1.4–2.0× higher compute density compared to standard AMD Xilinx Floating-Point Operator IP baselines.
- Resource Savings: It cuts down per-operation Look-Up Table (LUT) usage by an average of 30.0%, Flip-Flop (FF) usage by 47.9%, and DSP block consumption by 50.0%.
- Hardware Efficiency vs. GPU: When integrated into a tile-based GEMV (General Matrix-Vector Multiplication) engine on an AMD Xilinx U55c FPGA, XtraMAC delivered up to 1.2× lower latency and 1.9× higher energy efficiency than a high-end NVIDIA H100 GPU for bandwidth-bound workloads.
- End-to-End LLM Speedup: In full LLM decode-stage simulations at a batch size of 32, XtraMAC provided a 1.5× to 1.8× speedup over conventional FPGA implementations by allowing more parallel compute units to fit onto the same chip.
Limitations and Future Work
- Frequency Trade-off: Due to the routing complexity introduced by multi-lane packing and dynamic bit-mapping, XtraMAC's maximum clock frequency is about 22% slower than the vendor's highly optimized, single-datatype native IP. However, because it doubles the parallel lanes per DSP, it still delivers a net 1.56× higher effective throughput per DSP.
- Future Work: While the paper provides clear system integration guidelines showing XtraMAC can act as a drop-in replacement for standard MAC units, building automated compiler toolchains to seamlessly map arbitrary new software quantization formats down to this hardware remains an open area for development.
Summary updated