Skip to main content

Distributed Arithmetic for Machine Learning

Project description

da4ml: Distributed Arithmetic for Machine Learning

LGPLv3 Documentation PyPI version ArXiv

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

da4ml-0.5.1.post1-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (380.9 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

da4ml-0.5.1.post1-cp312-abi3-macosx_15_0_arm64.whl (503.1 kB view details)

Uploaded CPython 3.12+macOS 15.0+ ARM64

da4ml-0.5.1.post1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (383.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

da4ml-0.5.1.post1-cp311-cp311-macosx_15_0_arm64.whl (505.0 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

da4ml-0.5.1.post1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (383.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

da4ml-0.5.1.post1-cp310-cp310-macosx_15_0_arm64.whl (505.0 kB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

Details for the file da4ml-0.5.1.post1-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for da4ml-0.5.1.post1-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 340e7571d991a6a1884ce66f0f7a198aece5f49912e3b3d1dc6219311ffbf31e
MD5 dfc617e28ac2319af3d0944f1b747dd6
BLAKE2b-256 09e61b3a9ec4fec1318cadc9ebc8f6ab4911414d0ef23ebd7b755248e3ba6340

See more details on using hashes here.

Provenance

The following attestation bundles were made for da4ml-0.5.1.post1-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on calad0i/da4ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file da4ml-0.5.1.post1-cp312-abi3-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for da4ml-0.5.1.post1-cp312-abi3-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 56832572f55d564eaa719b68416905bd2fc887808811f2483e356f96c3f1151c
MD5 05a412e1c23b1d6ca5212b451d0fe2ae
BLAKE2b-256 f7c828932efc405c1f2c31b77ca784c2df2fecb51f994c3ed485b8fbdc2efad3

See more details on using hashes here.

Provenance

The following attestation bundles were made for da4ml-0.5.1.post1-cp312-abi3-macosx_15_0_arm64.whl:

Publisher: python-publish.yml on calad0i/da4ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file da4ml-0.5.1.post1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for da4ml-0.5.1.post1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 597fe9da548bf4b45afd6b43588898eba9aeb2cb627dd4aeb9abe4506009e186
MD5 6d46760a220fa7d73886244f39b6aade
BLAKE2b-256 864e46558a4e548c061cd220532609518342e415e8a1197c3ac90bc9932ba002

See more details on using hashes here.

Provenance

The following attestation bundles were made for da4ml-0.5.1.post1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on calad0i/da4ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file da4ml-0.5.1.post1-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for da4ml-0.5.1.post1-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3637a43078400083ceaa1dd842311c1ebceed92be956d49de57769bb1dc4404f
MD5 0404cf04e9f636695703c2883ca5029d
BLAKE2b-256 fbcb1cf14e3de1cca75e9b7b3a0ea71a235106a54758bc8b6605129ffe2c7a67

See more details on using hashes here.

Provenance

The following attestation bundles were made for da4ml-0.5.1.post1-cp311-cp311-macosx_15_0_arm64.whl:

Publisher: python-publish.yml on calad0i/da4ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file da4ml-0.5.1.post1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for da4ml-0.5.1.post1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 775d93924f71c682eed031bbf1ac5522b2f86f3ae22f4f21033f98ef72db8b5d
MD5 2bb3135a2be3cef1451fd701786d98c0
BLAKE2b-256 2cb01db72f9df2fd0da66ff2f79f92bf82bc33fc0c0c1773abd218825cbb15bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for da4ml-0.5.1.post1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on calad0i/da4ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file da4ml-0.5.1.post1-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for da4ml-0.5.1.post1-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 500b677f7314be3045d5bf538fb417a0b8801da2b230e5c06332928a96c22f2f
MD5 9d9a562001dc9d767939ec6b8b4bd291
BLAKE2b-256 93ed11a0ebd9492d1126c81bbecad1b41aa1b902c7a7bfad6b3b36f5856d89cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for da4ml-0.5.1.post1-cp310-cp310-macosx_15_0_arm64.whl:

Publisher: python-publish.yml on calad0i/da4ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page