Skip to content

MehdiRh17/HLS4ML_Additional_Boards

This branch is 14 commits ahead of hls4ml-finn-mlperftiny/hls4ml:fifo_depth_opt.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4c790b4 · Jan 20, 2023
Mar 3, 2021
Mar 4, 2021
Nov 26, 2021
Mar 8, 2019
Jan 20, 2023
Aug 4, 2021
Nov 12, 2021
Jan 12, 2021
Oct 5, 2021
Jul 29, 2020
Aug 26, 2021
Feb 6, 2021
Mar 20, 2018
Aug 27, 2019
Mar 4, 2021
Sep 8, 2021
Oct 19, 2021

Repository files navigation

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: [email protected]

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

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
hls4ml.utils.fetch_example_list()

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

Note: Vitis HLS is not yet supported. Vivado HLS versions between 2018.2 and 2020.1 are recommended.

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

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

About

Machine learning in FPGAs using HLS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 49.9%
  • Python 29.3%
  • Tcl 9.2%
  • C 9.2%
  • Shell 1.6%
  • Verilog 0.5%
  • Other 0.3%