Skip to main content

fpgaConvNet Model

This repo contains performance and resource for the building blocks of fpgaConvNet, a Streaming Architecture-based Convolutional Neural Network (CNN) acceleration toolflow, which maps CNN models to FPGAs. The building blocks are implemented in hardware in the fpgaconvnet-hls repository. These models are used in conjunction with samo, a Streaming Architecture optimiser, where there are instructions for performing optimisation.

Setup

The following programs are required:

  • python (>=3.7)

To install this package, run from this directory the following:

python -m pip install fpgaconvnet-model

Usage

This repo can be used to get performance and resource estimates for different hardware configurations. To start, the desired network will need to be parsed into fpgaConvNet's representation. Then a hardware configuration can be loaded, and performance and resource predictions obtained.

from fpgaconvnet.models.network import Network

# initialise network, and load a configuration
net = Network("model-name", "model.onnx")
net.load_network("model-config.json")

# print performance and resource estimates
print(f"predicted latency (us): {net.get_latency()*1000000}")
print(f"predicted throughput (img/s): {net.get_throughput()} (batch size={net.batch_size})")
print(f"predicted resource usage: {net.partitions[0].get_resource_usage()}")

# visualise the network configuration
net.visualise("image-path.png", mode="png")

# export out the configuration
net.save_all_partitions("config-path.json")

Modelling

In order to do the CNN to hardware mapping, a model of the hardware is needed. There are four levels of abstraction for the final hardware: modules, layers, partitions and network. At each level of abstraction, there is an associated performance and resource estimate so that the constraints for the optimiser can be obtained.

  • Module: These are the basic building blocks of the accelerator. The modules are the following:
    • Accum
    • BatchNorm
    • Conv
    • Glue
    • SlidingWindow
    • Fork
    • Pool
    • Squeeze
  • Layer: Layers are comprised of modules. They have the same functionality of the equivalent layers of the CNN model. The following layers are supported:
    • Batch Normalization
    • Convolution
    • Inner Product
    • Pooling
    • ReLU
  • Partition: Partitions make up a sub-graph of the CNN model network. They are comprised of layers. A single partition fits on an FPGA at a time, and partitions are changed by reconfiguring the FPGA.
  • Network: This is the entire CNN model described through hardware. A network contains partitions and information on how to execute them.

Feel free to post an issue if you have any questions or problems!

Metadata

Release files for fpgaconvnet-model 0.1.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fpgaconvnet-model 0.1.4.2
File Size Uploaded Provenance Actions
fpgaconvnet-model-0.1.4.2.tar.gz 60.1 kB Without provenance Details for fpgaconvnet-model-0.1.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fpgaconvnet-model 0.1.4.2
File Interpreter ABI Platform Actions
fpgaconvnet_model-0.1.4.2-py3-none-any.whl Python 3 none any Details for fpgaconvnet_model-0.1.4.2-py3-none-any.whl

Total release size: 156.7 kB

Release files / fpgaconvnet-model-0.1.4.2.tar.gz

Download URL fpgaconvnet-model-0.1.4.2.tar.gz
Size 60.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1150692d7be400ef1a6b2bbc0cd55d722f4a9c2fd868821698547d1d300cbc26
BLAKE2b-256 checksum
How to use checksums
6dd03c7f67e1c2a4eb936e486d155dc667798b262572439b429622f01b63dd67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / fpgaconvnet_model-0.1.4.2-py3-none-any.whl

Download URL fpgaconvnet_model-0.1.4.2-py3-none-any.whl
Size 96.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
773793a5728ce7dd80321f8a9f11d7a9229aa1ae43a19674fff509b826e0f20e
BLAKE2b-256 checksum
How to use checksums
2018d962fb2b2b17b4e6be8d2575900a78bd02ff6c27746efbde14451ea04a57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Security for fpgaconvnet-model 0.1.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page