Skip to main content

Machine learning in FPGAs using HLS

Project description


DOI PyPI version Supported Python versions

A package for machine learning inference in FPGAs. We create firmware implementations of machine learning algorithms using high level synthesis language (HLS). We translate traditional open-source machine learning package models into HLS that can be configured for your use-case!


Documentation & Tutorial

For more information visit the webpage:

Detailed tutorials on how to use hls4ml's various functionalities can be found here.


pip install hls4ml

To install the extra dependencies for profiling:

pip install hls4ml[profiling]

Getting Started

Creating an HLS project

import hls4ml

#Fetch a keras model from our example repository
#This will download our example model to your working directory and return an example configuration file
config = hls4ml.utils.fetch_example_model('KERAS_3layer.json')

print(config) #You can print the configuration to see some default parameters

#Convert it to a hls project
hls_model = hls4ml.converters.keras_to_hls(config)

# Print full list of example models if you want to explore more

Building a project with Xilinx Vitis (after downloading and installing from here)

#Use Vivado HLS to synthesize the model
#This might take several minutes

#Print out the report if you want'my-hls-test')

Project details

Download files

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

Files for hls4ml, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size hls4ml-0.4.0-py3-none-any.whl (215.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size hls4ml-0.4.0.tar.gz (234.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page