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 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


Download files

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

Source Distribution

da4ml-0.5.0b0.tar.gz (275.4 kB view details)

Uploaded Source

Built Distribution

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

da4ml-0.5.0b0-py3-none-any.whl (198.2 kB view details)

Uploaded Python 3

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

Hashes for da4ml-0.5.0b0.tar.gz
Algorithm Hash digest
SHA256 14ce653a4a3979da81c49733bda9534762cc027ba8f75bd56b9d764e7a0afdd3
MD5 65659e3e2630fc896f0daceddb88a469
BLAKE2b-256 0759a624470cbab26d4742ff8effe6a596ce35f75db862000a32cd57720293ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for da4ml-0.5.0b0.tar.gz:

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.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

Hashes for da4ml-0.5.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bf4f2dfdd6a3a7bf8a48bb7d1021bf2914771958f3c0be9ccc0b6b5a542108a
MD5 7a4333495b4dce94246ea84dc5846dd9
BLAKE2b-256 64542f78c57cc2d1680f7f87987bae5b8482975254ace7f1779529ed1525b72c

See more details on using hashes here.

Provenance

The following attestation bundles were made for da4ml-0.5.0b0-py3-none-any.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