Distributed Arithmetic for Machine Learning
Project description
da4ml: Distributed Arithmetic for Machine Learning
da4ml is a library for implementing distributed arithmetic (DA) based algorithms for ultra-low latency machine learning (ML) 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. For fully pipelined networks, da4ml can generate the firmware for the whole network standalone. Alternatively, da4ml 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 Simulation: 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.
- 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.
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 Distribution
Built Distribution
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.0b0.tar.gz.
File metadata
- Download URL: da4ml-0.5.0b0.tar.gz
- Upload date:
- Size: 275.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14ce653a4a3979da81c49733bda9534762cc027ba8f75bd56b9d764e7a0afdd3
|
|
| MD5 |
65659e3e2630fc896f0daceddb88a469
|
|
| BLAKE2b-256 |
0759a624470cbab26d4742ff8effe6a596ce35f75db862000a32cd57720293ed
|
Provenance
The following attestation bundles were made for da4ml-0.5.0b0.tar.gz:
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.0b0.tar.gz -
Subject digest:
14ce653a4a3979da81c49733bda9534762cc027ba8f75bd56b9d764e7a0afdd3 - Sigstore transparency entry: 630253741
- Sigstore integration time:
-
Permalink:
calad0i/da4ml@cdf2e46cbeaa233e39cf236352a7b1a4cc43d1c9 -
Branch / Tag:
refs/tags/v0.5.0beta0 - Owner: https://github.com/calad0i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@cdf2e46cbeaa233e39cf236352a7b1a4cc43d1c9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file da4ml-0.5.0b0-py3-none-any.whl.
File metadata
- Download URL: da4ml-0.5.0b0-py3-none-any.whl
- Upload date:
- Size: 198.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bf4f2dfdd6a3a7bf8a48bb7d1021bf2914771958f3c0be9ccc0b6b5a542108a
|
|
| MD5 |
7a4333495b4dce94246ea84dc5846dd9
|
|
| BLAKE2b-256 |
64542f78c57cc2d1680f7f87987bae5b8482975254ace7f1779529ed1525b72c
|
Provenance
The following attestation bundles were made for da4ml-0.5.0b0-py3-none-any.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.0b0-py3-none-any.whl -
Subject digest:
7bf4f2dfdd6a3a7bf8a48bb7d1021bf2914771958f3c0be9ccc0b6b5a542108a - Sigstore transparency entry: 630253743
- Sigstore integration time:
-
Permalink:
calad0i/da4ml@cdf2e46cbeaa233e39cf236352a7b1a4cc43d1c9 -
Branch / Tag:
refs/tags/v0.5.0beta0 - Owner: https://github.com/calad0i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@cdf2e46cbeaa233e39cf236352a7b1a4cc43d1c9 -
Trigger Event:
release
-
Statement type: