Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 1.84 KB

README.md

File metadata and controls

48 lines (34 loc) · 1.84 KB

hls4ml

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!

Contact: hls4ml.help@gmail.com

Documentation & Tutorial

For more information visit the webpage: https://fastmachinelearning.org/hls4ml/

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

Installation

pip install hls4ml

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

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

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

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

#Use Vivado HLS to synthesize the model
#This might take several minutes
hls_model.build(synth=True)

#Print out the report if you want
hls4ml.report.read_vivado_report('my-hls-test')