How joennlae/halutmatmul works
Project type and purpose
• This is a heterogeneous accelerator project (“Stella Nera”) combining:
• An algorithmic/software stack (Python library “halutmatmul,” training scripts, model definitions, tests, example) that implements the Maddness‐based approximate matrix multiplication method.
• A hardware stack (SystemVerilog RTL, verification suites, OpenROAD synthesis & P&R flows, post‐layout simulation) realizing the accelerator in silicon.
• Purpose: provide both a software reference and a fully open‐source hardware implementation of a multiplier‐free DNN matmul accelerator.
File structure
• Top‐level directories:
• src/python – the Python package, subdivided into:
– concepts: unit tests and algorithmic building blocks
– halutmatmul: core library, CUDA functions, learning & inference code
– models: PyTorch models (ResNet variants, tiny nets)
– training: training scripts, presets, quantization routines
– test: pytest suites for algorithmic validation
– example.py – a stand‑alone usage demo
• hardware – the accelerator RTL and build flows:
– rtl – SystemVerilog modules (halut_encoder, halut_decoder, halut_matmul, support units)
– target – various flows:
• dv – Python testbenches & DV scripts
• open‑frontend, open‑synth‑and‑pnr – OpenROAD flow configurations & Makefiles
• post‑layout‑simulation – Sim scripts for extracted netlists
• scaling – helper scripts to adapt hardware width & units
– util – scripts for docs/table generation
– Dockerfile & Makefile for local builds
• config files: environment_*.yml for conda, pyproject.toml, GitHub workflows for CI.
Key insights from README
• Two pillars:
a) Algorithmic (Maddness) – offline training, LUT/threshold generation, numpy/CUDA/PyTorch-based inference.
b) Hardware (OpenROAD) – from RTL to GDS with fully open toolchain, including DV and post-layout simulation.
• Emphasis on code/CI badges for Python testing, type checking, ML validation (ResNet9), RTL linting, DV, synthesis+PNR.