Skip to main content

Parser and model for Convolutional Neural Network Streaming-Based Accelerator on FPGA devices.

Project description

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!

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

fpgaconvnet-model-0.1.4.2.tar.gz (60.1 kB view details)

Uploaded Source

Built Distribution

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

fpgaconvnet_model-0.1.4.2-py3-none-any.whl (96.6 kB view details)

Uploaded Python 3

File details

Details for the file fpgaconvnet-model-0.1.4.2.tar.gz.

File metadata

  • Download URL: fpgaconvnet-model-0.1.4.2.tar.gz
  • Upload date:
  • Size: 60.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for fpgaconvnet-model-0.1.4.2.tar.gz
Algorithm Hash digest
SHA256 1150692d7be400ef1a6b2bbc0cd55d722f4a9c2fd868821698547d1d300cbc26
MD5 93f02db437be567582a9b4d66ee3326f
BLAKE2b-256 6dd03c7f67e1c2a4eb936e486d155dc667798b262572439b429622f01b63dd67

See more details on using hashes here.

File details

Details for the file fpgaconvnet_model-0.1.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fpgaconvnet_model-0.1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 773793a5728ce7dd80321f8a9f11d7a9229aa1ae43a19674fff509b826e0f20e
MD5 be8b9ca054c3243a4d245a9ec3a44869
BLAKE2b-256 2018d962fb2b2b17b4e6be8d2575900a78bd02ff6c27746efbde14451ea04a57

See more details on using hashes here.

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