{"id":13654259,"url":"https://github.com/fastmachinelearning/hls4ml","last_synced_at":"2025-12-12T00:46:23.581Z","repository":{"id":36997415,"uuid":"108329371","full_name":"fastmachinelearning/hls4ml","owner":"fastmachinelearning","description":"Machine learning on FPGAs using HLS","archived":false,"fork":false,"pushed_at":"2025-05-05T20:51:30.000Z","size":268963,"stargazers_count":1463,"open_issues_count":212,"forks_count":448,"subscribers_count":53,"default_branch":"main","last_synced_at":"2025-05-05T21:48:55.921Z","etag":null,"topics":["fpga","hls","intel-hls","keras","machine-learning","neural-network","onnx","python","pytorch","vivado","vivado-hls"],"latest_commit_sha":null,"homepage":"https://fastmachinelearning.org/hls4ml","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fastmachinelearning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-10-25T21:43:56.000Z","updated_at":"2025-05-05T20:50:26.000Z","dependencies_parsed_at":"2023-02-18T08:16:05.137Z","dependency_job_id":"f070890a-6a95-4bbe-855b-21af1257525c","html_url":"https://github.com/fastmachinelearning/hls4ml","commit_stats":{"total_commits":1652,"total_committers":66,"mean_commits":25.03030303030303,"dds":0.6355932203389831,"last_synced_commit":"52411091beb871a80dff33f474cda6ce92310360"},"previous_names":["hls-fpga-machine-learning/hls4ml"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastmachinelearning%2Fhls4ml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastmachinelearning%2Fhls4ml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastmachinelearning%2Fhls4ml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastmachinelearning%2Fhls4ml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastmachinelearning","download_url":"https://codeload.github.com/fastmachinelearning/hls4ml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254020640,"owners_count":22000756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fpga","hls","intel-hls","keras","machine-learning","neural-network","onnx","python","pytorch","vivado","vivado-hls"],"created_at":"2024-08-02T02:01:25.798Z","updated_at":"2025-12-12T00:46:23.536Z","avatar_url":"https://github.com/fastmachinelearning.png","language":"C++","readme":"\u003cp align=\"center\"\u003e\n   \u003cimg src=\"https://github.com/fastmachinelearning/fastmachinelearning.github.io/raw/master/images/hls4ml_logo.svg\" alt=\"hls4ml\" width=\"400\"/\u003e\n\u003c/p\u003e\n\n[![DOI](https://zenodo.org/badge/108329371.svg)](https://zenodo.org/badge/latestdoi/108329371)\n[![License](https://img.shields.io/badge/License-Apache_2.0-red.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Documentation Status](https://github.com/fastmachinelearning/hls4ml/actions/workflows/build-sphinx.yml/badge.svg)](https://fastmachinelearning.org/hls4ml)\n[![PyPI version](https://badge.fury.io/py/hls4ml.svg)](https://badge.fury.io/py/hls4ml)\n[![Downloads](https://static.pepy.tech/personalized-badge/hls4ml?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=orange\u0026left_text=Downloads)](https://pepy.tech/project/hls4ml)\n\u003ca href=\"https://anaconda.org/conda-forge/hls4ml/\"\u003e\u003cimg alt=\"conda-forge\" src=\"https://img.shields.io/conda/dn/conda-forge/hls4ml.svg?label=conda-forge\"\u003e\u003c/a\u003e\n\nA 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!\n\nIf you have any questions, comments, or ideas regarding hls4ml or just want to show us how you use hls4ml, don't hesitate to reach us through the [discussions](https://github.com/fastmachinelearning/hls4ml/discussions) tab.\n\n# Documentation \u0026 Tutorial\n\nFor more information visit the webpage: [https://fastmachinelearning.org/hls4ml/](https://fastmachinelearning.org/hls4ml/).\n\nFor introductory material on FPGAs, HLS and ML inferences using hls4ml, check out the [video](https://www.youtube.com/watch?v=2y3GNY4tf7A\u0026ab_channel=SystemsGroupatETHZ%C3%BCrich).\n\nDetailed tutorials on how to use `hls4ml`'s various functionalities can be found [here](https://github.com/hls-fpga-machine-learning/hls4ml-tutorial).\n\n# Installation\n```bash\npip install hls4ml\n```\n\nTo install the extra dependencies for profiling:\n\n```bash\npip install hls4ml[profiling]\n```\n\n# Getting Started\n### Creating an HLS project\n```Python\nimport hls4ml\n\n# Fetch a keras model from our example repository\n# This will download our example model to your working directory and return an example configuration file\nconfig = hls4ml.utils.fetch_example_model('KERAS_3layer.json')\n\n# You can print the configuration to see some default parameters\nprint(config)\n\n# Convert it to a hls project\nhls_model = hls4ml.converters.keras_to_hls(config)\n\n# Print full list of example models if you want to explore more\nhls4ml.utils.fetch_example_list()\n```\n\n### Building a project.\nWe will build the project using Xilinx Vivado HLS, which can be downloaded and installed from [here](https://www.xilinx.com/products/design-tools/vivado/integration/esl-design.html). Alongside Vivado HLS, hls4ml also supports Vitis HLS, Intel HLS, Catapult HLS and has some experimental support dor Intel oneAPI. The target back-end can be changed using the argument backend when building the model.\n\n```Python\n# Use Vivado HLS to synthesize the model\n# This might take several minutes\nhls_model.build()\n\n# Print out the report if you want\nhls4ml.report.read_vivado_report('my-hls-test')\n```\n\n# FAQ\n\nList of frequently asked questions and common HLS synthesis can be found [here](https://fastmachinelearning.org/hls4ml/intro/faq.html)\n\n# Citation\nIf you use this software in a publication, please cite the software\n```bibtex\n@software{fastml_hls4ml,\n  author       = {{FastML Team}},\n  title        = {fastmachinelearning/hls4ml},\n  year         = 2025,\n  publisher    = {Zenodo},\n  version      = {v1.1.0},\n  doi          = {10.5281/zenodo.1201549},\n  url          = {https://github.com/fastmachinelearning/hls4ml}\n}\n```\nand first publication:\n```bibtex\n@article{Duarte:2018ite,\n    author = \"Duarte, Javier and others\",\n    title = \"{Fast inference of deep neural networks in FPGAs for particle physics}\",\n    eprint = \"1804.06913\",\n    archivePrefix = \"arXiv\",\n    primaryClass = \"physics.ins-det\",\n    reportNumber = \"FERMILAB-PUB-18-089-E\",\n    doi = \"10.1088/1748-0221/13/07/P07027\",\n    journal = \"JINST\",\n    volume = \"13\",\n    number = \"07\",\n    pages = \"P07027\",\n    year = \"2018\"\n}\n```\nAdditionally, if you use specific features developed in later papers, please cite those as well. For example, CNNs:\n```bibtex\n@article{Aarrestad:2021zos,\n    author = \"Aarrestad, Thea and others\",\n    title = \"{Fast convolutional neural networks on FPGAs with hls4ml}\",\n    eprint = \"2101.05108\",\n    archivePrefix = \"arXiv\",\n    primaryClass = \"cs.LG\",\n    reportNumber = \"FERMILAB-PUB-21-130-SCD\",\n    doi = \"10.1088/2632-2153/ac0ea1\",\n    journal = \"Mach. Learn. Sci. Tech.\",\n    volume = \"2\",\n    number = \"4\",\n    pages = \"045015\",\n    year = \"2021\"\n}\n@article{Ghielmetti:2022ndm,\n    author = \"Ghielmetti, Nicol\\`{o} and others\",\n    title = \"{Real-time semantic segmentation on FPGAs for autonomous vehicles with hls4ml}\",\n    eprint = \"2205.07690\",\n    archivePrefix = \"arXiv\",\n    primaryClass = \"cs.CV\",\n    reportNumber = \"FERMILAB-PUB-22-435-PPD\",\n    doi = \"10.1088/2632-2153/ac9cb5\",\n    journal =\"Mach. Learn. Sci. Tech.\",\n    year = \"2022\"\n}\n```\nbinary/ternary networks:\n```bibtex\n@article{Loncar:2020hqp,\n    author = \"Ngadiuba, Jennifer and others\",\n    title = \"{Compressing deep neural networks on FPGAs to binary and ternary precision with HLS4ML}\",\n    eprint = \"2003.06308\",\n    archivePrefix = \"arXiv\",\n    primaryClass = \"cs.LG\",\n    reportNumber = \"FERMILAB-PUB-20-167-PPD-SCD\",\n    doi = \"10.1088/2632-2153/aba042\",\n    journal = \"Mach. Learn. Sci. Tech.\",\n    volume = \"2\",\n    pages = \"015001\",\n    year = \"2021\"\n}\n```\n\n# Acknowledgments\nIf you benefited from participating in our community, we ask that you please acknowledge the Fast Machine Learning collaboration, and particular individuals who helped you, in any publications.\nPlease use the following text for this acknowledgment:\n  \u003e We acknowledge the Fast Machine Learning collective as an open community of multi-domain experts and collaborators. This community and \\\u003cnames of individuals\\\u003e, in particular, were important for the development of this project.\n\n# Funding\nWe gratefully acknowledge previous and current support from the U.S. National Science Foundation (NSF) Harnessing the Data Revolution (HDR) Institute for \u003ca href=\"https://a3d3.ai\"\u003eAccelerating AI Algorithms for Data Driven Discovery (A3D3)\u003c/a\u003e under Cooperative Agreement No. \u003ca href=\"https://www.nsf.gov/awardsearch/showAward?AWD_ID=2117997\"\u003ePHY-2117997\u003c/a\u003e, U.S. Department of Energy (DOE) Office of Science, Office of Advanced Scientific Computing Research under the Real‐time Data Reduction Codesign at the Extreme Edge for Science (XDR) Project (\u003ca href=\"https://science.osti.gov/-/media/grants/pdf/foas/2021/SC_FOA_0002501.pdf\"\u003eDE-FOA-0002501\u003c/a\u003e), DOE Office of Science, Office of High Energy Physics Early Career Research Program (\u003ca href=\"https://pamspublic.science.energy.gov/WebPAMSExternal/Interface/Common/ViewPublicAbstract.aspx?rv=df0ae4ab-a46e-481a-9acc-3856b6b041e5\u0026rtc=24\u0026PRoleId=10\"\u003eDE-SC0021187\u003c/a\u003e, DE-0000247070), and the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation program (Grant No. \u003ca href=\"https://doi.org/10.3030/772369\"\u003e772369\u003c/a\u003e).\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/fastmachinelearning/hls4ml/assets/29201053/bd1217d4-9930-47b7-8917-ad3fc430c75d\" alt=\"A3D3\" width=\"130\"/\u003e\n\u003cimg src=\"https://github.com/fastmachinelearning/hls4ml/assets/4932543/16e77374-9829-40a8-800e-8d12018a7cb3\" alt=\"NSF\" width=\"130\"/\u003e\n\u003cimg src=\"https://github.com/fastmachinelearning/hls4ml/assets/4932543/de6ca6ea-4d1c-4c56-9d93-f759914bbbf9\" alt=\"DOE\" width=\"130\"/\u003e\n\u003cimg src=\"https://github.com/fastmachinelearning/hls4ml/assets/4932543/7a369971-a381-4bb8-932a-7162b173cbac\" alt=\"ERC\" width=\"130\"/\u003e\n\u003c/p\u003e\n","funding_links":[],"categories":["Tools"],"sub_categories":["FPGA based accelerator / HLS for CNNs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastmachinelearning%2Fhls4ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastmachinelearning%2Fhls4ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastmachinelearning%2Fhls4ml/lists"}