Distributed Arithmetic for Machine Learning
Project description
da4ml: Distributed Arithmetic for Machine Learning
da4ml is a static computation graph to RTL/HLS design compiler targeting ultra-low latency applications on FPGAs. It as two major components:
- A fast and performant constant-matrix-vector multiplications (CMVM) optimizer to implement them as efficient adder trees. Common sub-expressions elimination (CSE) with graph-based pre-optimization are performed to reduce the firmware footprint and improve the performance.
- Low-level symbolic tracing frameworks for generating combinational/fully pipelined logics in HDL or HLS code. da4ml can generate the firmware for almost all fully pipelined networks standalone. Alternatively, da4ml also be used as a plugin in hls4ml to optimize the CMVM operations in the network.
Key Features
- Optimized Algorithms: Comparing to hls4ml's latency strategy, da4ml's CMVM implementation uses no DSO and consumes up to 50% less LUT usage.
- Fast code generation: da4ml can generate HDL for a fully pipelined network in seconds. For the same models, high-level synthesis tools like Vivado/Vitis HLS can take up to days to generate the HDL code.
- Low-level symbolic tracing: As long as the operation can be expressed by a combination of the low-level operations supported, adding new operations is straightforward by "replaying" the operation on the symbolic tensor provided. In most cases, adding support for a new operation/layer takes just a few lines of code in numpy flavor.
- Automatic model conversion: da4ml can automatically convert models trained in
HGQ2 <https://github.com/calad0i/hgq2>_. - Bit-accurate Emulation: All operation in da4ml is bit-accurate, meaning the generated HDL code will produce the same output as the original model. da4ml's computation is converted to a RISC-like, instruction set level intermediate representation, distributed arithmetic instruction set (DAIS), which can be easily simulated in multiple ways. da4ml also provides a fast C++ based DAIS interpreter to run bit-exact inference on the traced models for verification and benchmarking.
- hls4ml integration: da4ml can be used as a plugin in hls4ml to optimize the CMVM operations in the network by setting
strategy='distributed_arithmetic'for the strategy of the Dense, EinsumDense, or Conv1/2D layers.
Installation
pip install da4ml
Getting Started
- See the Getting Started guide for a quick introduction to using da4ml.
- See JEDI-linear project which is based on da4ml
Citation
If you use da4ml in a publication, please cite our TRETS'25 paper with the following bibtex entry:
@article{sun2025da4ml,
author = {Sun, Chang and Que, Zhiqiang and Loncar, Vladimir and Luk, Wayne and Spiropulu, Maria},
title = {da4ml: Distributed Arithmetic for Real-time Neural Networks on FPGAs},
year = {2025},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
issn = {1936-7406},
url = {https://doi.org/10.1145/3777387},
doi = {10.1145/3777387},
journal = {ACM Trans. Reconfigurable Technol. Syst.},
month = nov,
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file da4ml-0.5.2-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: da4ml-0.5.2-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 382.9 kB
- Tags: CPython 3.12+, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f75025ac4f07db0265933da6ed2ee24b0cc70b6fe65636a77ab900a5f514b44
|
|
| MD5 |
0780a5ec783a0688097deff26bc0abd7
|
|
| BLAKE2b-256 |
fedf274c0789548a2ad5a233314505833a50d87b0408ff4ced894d2286fdfc61
|
Provenance
The following attestation bundles were made for da4ml-0.5.2-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on calad0i/da4ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
da4ml-0.5.2-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
4f75025ac4f07db0265933da6ed2ee24b0cc70b6fe65636a77ab900a5f514b44 - Sigstore transparency entry: 871734322
- Sigstore integration time:
-
Permalink:
calad0i/da4ml@2feadca84d75f09fe0f89da9c1d221cbcf0316b0 -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/calad0i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2feadca84d75f09fe0f89da9c1d221cbcf0316b0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file da4ml-0.5.2-cp312-abi3-macosx_15_0_arm64.whl.
File metadata
- Download URL: da4ml-0.5.2-cp312-abi3-macosx_15_0_arm64.whl
- Upload date:
- Size: 505.1 kB
- Tags: CPython 3.12+, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1ea4995cf6200d5d3a545d04009b46b13c37d2b5dd63d5db92bf4236e760d92
|
|
| MD5 |
a2f0e9a3e7936fcc25884629ed04a030
|
|
| BLAKE2b-256 |
33efa8f3fd5227c34ec833e2f5d34ee85e278ccf527b240f8b034d2ebb0c0366
|
Provenance
The following attestation bundles were made for da4ml-0.5.2-cp312-abi3-macosx_15_0_arm64.whl:
Publisher:
python-publish.yml on calad0i/da4ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
da4ml-0.5.2-cp312-abi3-macosx_15_0_arm64.whl -
Subject digest:
b1ea4995cf6200d5d3a545d04009b46b13c37d2b5dd63d5db92bf4236e760d92 - Sigstore transparency entry: 871734325
- Sigstore integration time:
-
Permalink:
calad0i/da4ml@2feadca84d75f09fe0f89da9c1d221cbcf0316b0 -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/calad0i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2feadca84d75f09fe0f89da9c1d221cbcf0316b0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file da4ml-0.5.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: da4ml-0.5.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 385.5 kB
- Tags: CPython 3.11, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74234dc3f14653a64f1fc126e255e94fff5a703a2a3ef57ff8f7fbb793f8fdc1
|
|
| MD5 |
bee6b76a01bbfef138ed91827b05369d
|
|
| BLAKE2b-256 |
c74b93d074e2e6be216d1f609769f4e05f8501ff4ef2a617ab879a56150450ef
|
Provenance
The following attestation bundles were made for da4ml-0.5.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on calad0i/da4ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
da4ml-0.5.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
74234dc3f14653a64f1fc126e255e94fff5a703a2a3ef57ff8f7fbb793f8fdc1 - Sigstore transparency entry: 871734323
- Sigstore integration time:
-
Permalink:
calad0i/da4ml@2feadca84d75f09fe0f89da9c1d221cbcf0316b0 -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/calad0i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2feadca84d75f09fe0f89da9c1d221cbcf0316b0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file da4ml-0.5.2-cp311-cp311-macosx_15_0_arm64.whl.
File metadata
- Download URL: da4ml-0.5.2-cp311-cp311-macosx_15_0_arm64.whl
- Upload date:
- Size: 506.9 kB
- Tags: CPython 3.11, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a535c593e6d29bc303aac17091f9267b9ce7117e53079b034ae9e7de5f602fef
|
|
| MD5 |
e498a69fc9752dc2dbcb72bb1d34969d
|
|
| BLAKE2b-256 |
0516f56ef10672fa157d50df9faa1e9d5b38be5cb4dc5953c17fc6872c563df6
|
Provenance
The following attestation bundles were made for da4ml-0.5.2-cp311-cp311-macosx_15_0_arm64.whl:
Publisher:
python-publish.yml on calad0i/da4ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
da4ml-0.5.2-cp311-cp311-macosx_15_0_arm64.whl -
Subject digest:
a535c593e6d29bc303aac17091f9267b9ce7117e53079b034ae9e7de5f602fef - Sigstore transparency entry: 871734330
- Sigstore integration time:
-
Permalink:
calad0i/da4ml@2feadca84d75f09fe0f89da9c1d221cbcf0316b0 -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/calad0i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2feadca84d75f09fe0f89da9c1d221cbcf0316b0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file da4ml-0.5.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: da4ml-0.5.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 385.7 kB
- Tags: CPython 3.10, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abb1ef549e1d9d8538de310277b4024e4d7772537d8f6755f5e7e7b25ca38c51
|
|
| MD5 |
d033383ab04e2b3ad3a91208c832a76a
|
|
| BLAKE2b-256 |
bc8a89afd39a4dc3146e2817d82eb260504465aba9388285efb890ef58b8aeb1
|
Provenance
The following attestation bundles were made for da4ml-0.5.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on calad0i/da4ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
da4ml-0.5.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
abb1ef549e1d9d8538de310277b4024e4d7772537d8f6755f5e7e7b25ca38c51 - Sigstore transparency entry: 871734321
- Sigstore integration time:
-
Permalink:
calad0i/da4ml@2feadca84d75f09fe0f89da9c1d221cbcf0316b0 -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/calad0i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2feadca84d75f09fe0f89da9c1d221cbcf0316b0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file da4ml-0.5.2-cp310-cp310-macosx_15_0_arm64.whl.
File metadata
- Download URL: da4ml-0.5.2-cp310-cp310-macosx_15_0_arm64.whl
- Upload date:
- Size: 506.9 kB
- Tags: CPython 3.10, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6536cbd703779eb58f4098f0f3efab67cb4a8b02b1ee74f96064547b3f1e688c
|
|
| MD5 |
04af97922e549f984e144a238a394066
|
|
| BLAKE2b-256 |
c67a62c7d95617c1eec398b77cb13eb3660c979108430c97eca15acb19cde8c3
|
Provenance
The following attestation bundles were made for da4ml-0.5.2-cp310-cp310-macosx_15_0_arm64.whl:
Publisher:
python-publish.yml on calad0i/da4ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
da4ml-0.5.2-cp310-cp310-macosx_15_0_arm64.whl -
Subject digest:
6536cbd703779eb58f4098f0f3efab67cb4a8b02b1ee74f96064547b3f1e688c - Sigstore transparency entry: 871734326
- Sigstore integration time:
-
Permalink:
calad0i/da4ml@2feadca84d75f09fe0f89da9c1d221cbcf0316b0 -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/calad0i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2feadca84d75f09fe0f89da9c1d221cbcf0316b0 -
Trigger Event:
release
-
Statement type: