{"id":31815695,"url":"https://github.com/xilinx/finn-examples","last_synced_at":"2025-10-11T09:23:17.359Z","repository":{"id":38198360,"uuid":"317767587","full_name":"Xilinx/finn-examples","owner":"Xilinx","description":"Dataflow QNN inference accelerator examples on FPGAs","archived":false,"fork":false,"pushed_at":"2025-08-26T16:56:51.000Z","size":24620,"stargazers_count":231,"open_issues_count":11,"forks_count":67,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-09-25T04:28:15.694Z","etag":null,"topics":["alveo","finn","fpga","neural-network-accelerators","pynq"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Xilinx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-12-02T06:11:10.000Z","updated_at":"2025-09-17T01:52:56.000Z","dependencies_parsed_at":"2023-01-29T21:30:58.472Z","dependency_job_id":"ce2f7d09-9c0a-4f4a-b37e-abb2944a81aa","html_url":"https://github.com/Xilinx/finn-examples","commit_stats":{"total_commits":230,"total_committers":15,"mean_commits":"15.333333333333334","dds":0.6,"last_synced_commit":"3cdec2b90c598b4a26e9a6a3c5510bd217b64cf6"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/Xilinx/finn-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xilinx%2Ffinn-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xilinx%2Ffinn-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xilinx%2Ffinn-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xilinx%2Ffinn-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xilinx","download_url":"https://codeload.github.com/Xilinx/finn-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xilinx%2Ffinn-examples/sbom","scorecard":{"id":153367,"data":{"date":"2025-08-11","repo":{"name":"github.com/Xilinx/finn-examples","commit":"810a1e7759163ac313cb7739743da4184fb9135d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/pre-commit.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":7,"reason":"binaries present in source code","details":["Warn: binary detected: finn_examples/__pycache__/__init__.cpython-36.pyc:1","Warn: binary detected: finn_examples/__pycache__/driver.cpython-36.pyc:1","Warn: binary detected: finn_examples/__pycache__/models.cpython-36.pyc:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pre-commit.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/Xilinx/finn-examples/pre-commit.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pre-commit.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/Xilinx/finn-examples/pre-commit.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pre-commit.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/Xilinx/finn-examples/pre-commit.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/Xilinx/finn-examples/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/Xilinx/finn-examples/python-publish.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:22","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.0.7a not signed: https://api.github.com/repos/Xilinx/finn-examples/releases/168084834","Warn: release artifact v0.0.6 not signed: https://api.github.com/repos/Xilinx/finn-examples/releases/92031671","Warn: release artifact v0.0.7a does not have provenance: https://api.github.com/repos/Xilinx/finn-examples/releases/168084834","Warn: release artifact v0.0.6 does not have provenance: https://api.github.com/repos/Xilinx/finn-examples/releases/92031671"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'","Warn: branch protection not enabled for branch 'dev'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T11:12:47.856Z","repository_id":38198360,"created_at":"2025-08-16T11:12:47.857Z","updated_at":"2025-08-16T11:12:47.857Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006753,"owners_count":26084178,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["alveo","finn","fpga","neural-network-accelerators","pynq"],"created_at":"2025-10-11T09:23:13.442Z","updated_at":"2025-10-11T09:23:17.352Z","avatar_url":"https://github.com/Xilinx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=https://raw.githubusercontent.com/Xilinx/finn/github-pages/docs/img/finn-logo.png width=200 style=\"margin-bottom: -15px; margin-right: 10px\"/\u003e Dataflow Accelerator Examples\n\u003cp align=\"center\"\u003e \u003cem\u003efor PYNQ on Zynq and Alveo\u003c/em\u003e \u003cp\u003e\n\u003cp align=\"left\"\u003e\n    \u003ca\u003e\n        \u003cimg src=\"https://img.shields.io/github/v/release/Xilinx/finn-examples?color=%09%23228B22\u0026display_name=tag\u0026label=Release\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/Xilinx/finn/tree/v0.10.1\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/FINN-v0.10.1-blue\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/Xilinx/PYNQ/tree/v3.0.1\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/PYNQ-v3.0.1-blue\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/2022-1.html\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Vivado%2FVitis-v2022.2-blue\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cimg align=\"left\" src=\"docs/img/finn-example.png\" alt=\"drawing\" style=\"margin-right: 20px\" width=\"250\"/\u003e\n\nThis repository contains a variety of customized FPGA neural network accelerator\nexamples built using\nthe [FINN compiler](https://github.com/Xilinx/finn), which\ntargets few-bit quantized neural networks with emphasis on\ngenerating dataflow-style architectures customized for each network.\n\nThe examples here come with\npre-built bitfiles, PYNQ Python drivers and Jupyter notebooks to get started,\nand you can rebuild them from source.\nBoth PYNQ on Zynq and Alveo are supported.\n\nNeed help with a problem in this repo, or got a question? Feel free to ask for help in the [GitHub discussions](https://github.com/Xilinx/finn/discussions).\nIn the past, we also had a [Gitter channel](https://gitter.im/xilinx-finn/community). Please be aware that this is no longer maintained by us but can still be used to search for questions previous users had.\n\n## Quickstart\n*We recommend PYNQ version 3.0.1, but older installations of PYNQ should also work. For PYNQ v2.6.1, please refer for set-up instructions to [FINN-examples v0.0.5](https://github.com/Xilinx/finn-examples/tree/v0.0.5).*\n\n### Zynq\n*For ZYNQ boards, all commands below must be prefixed with `sudo` or by first going into `sudo su`.*\n\nFirst, source the PYNQ and XRT virtual environment:\n\n```shell\nsource /etc/profile.d/pynq_venv.sh\nsource /etc/profile.d/xrt_setup.sh\n```\n\nNext, ensure that your `pip` and `setuptools` installations are up-to-date\non your PYNQ board:\n\n```shell\npython3 -m pip install pip==23.0 setuptools==67.1.0\n```\n\nSince we are going to install finn-examples without build-isolation, we need to ensure all dependencies are installed. For that, install `setuptools_scm` as well:\n\n```shell\npython3 -m pip install setuptools_scm==7.1.0\n```\n\nInstall the `finn-examples` package using `pip`:\n\n```shell\n# remove previous versions with: pip3 uninstall finn-examples\npip3 install finn-examples --no-build-isolation\n# to install particular git branch:\n# pip3 install git+https://github.com/Xilinx/finn-examples.git@dev --no-build-isolation\n```\n\nRetrieve the example Jupyter notebooks using the PYNQ get-notebooks command. An example of how to run the Jupyter notebook server, assuming we are forwarding port 8888 from the target to some port on our local machine, is also shown below:\n\n```shell\n# on PYNQ boards, first cd /home/xilinx/jupyter_notebooks\npynq get-notebooks --from-package finn-examples -p . --force\njupyter-notebook --no-browser --allow-root --port=8888\n```\n\n### Alveo\n*For Alveo we recommend setting up everything inside a virtualenv as described [here](https://pynq.readthedocs.io/en/v2.6.1/getting_started/alveo_getting_started.html?highlight=alveo#install-conda).*\n\nFirst, create \u0026 source a virtual environment:\n```shell\nconda create -n \u003cvirtual-env\u003e python=3.8\nconda activate \u003cvirtual-env\u003e\n```\n\nNext, ensure that your `pip` and `setuptools` installations are up-to-date:\n```shell\npython3 -m pip install --upgrade pip==23.0 setuptools==67.2.0\n```\n\nFinally, we can now install Pynq, FINN-examples and Jupyter (please note to source the XRT environment before):\n```shell\npip3 install pynq==3.0.1\npython3 -m pip install setuptools_scm==7.1.0 ipython==8.9.0\npip3 install finn-examples --no-build-isolation\n# to install particular git branch:\n# pip3 install git+https://github.com/Xilinx/finn-examples.git@dev --no-build-isolation\npython3 -m pip install jupyter==1.0.0\n```\n\nRetrieve the example Jupyter notebooks using the PYNQ get-notebooks command. An example of how to run the Jupyter notebook server is also shown below:\n\n```shell\npynq get-notebooks --from-package finn-examples -p . --force\njupyter-notebook --no-browser --port=8888\n```\n\n***\n\nYou can now navigate the provided Jupyter notebook examples, or just use the\nprovided accelerators as part of your own Python program:\n\n```python\nfrom finn_examples import models\nimport numpy as np\n\n# instantiate the accelerator\naccel = models.cnv_w2a2_cifar10()\n# generate an empty numpy array to use as input\ndummy_in = np.empty(accel.ishape_normal(), dtype=np.uint8)\n# perform inference and get output\ndummy_out = accel.execute(dummy_in)\n```\n\n##  Example Neural Network Accelerators\n| Dataset                                                        | Topology                | Quantization                                               | Supported boards | Supported build flows\n|:----------------------------------------------------------------:|:-------------------------:|:------------------------------------------------------------:|:------------------:|:------------------:|\n| CIFAR-10     | CNV (VGG-11-like)       | several variants:\u003cbr\u003e1/2-bit weights/activations           | Pynq-Z1\u003cbr\u003eZCU104\u003cbr\u003eUltra96\u003cbr\u003eU250              | Pynq-Z1\u003cbr\u003eZCU104\u003cbr\u003eUltra96\u003cbr\u003eU250 |\n| MNIST       | 3-layer fully-connected | several variants:\u003cbr\u003e1/2-bit weights/activations           | Pynq-Z1\u003cbr\u003eZCU104\u003cbr\u003eUltra96\u003cbr\u003eU250              | Pynq-Z1\u003cbr\u003eZCU104\u003cbr\u003eUltra96\u003cbr\u003eU250 |\n| ImageNet | MobileNet-v1            | 4-bit weights \u0026 activations\u003cbr\u003e8-bit first layer weights | Alveo U250       | Alveo U250 |\n| ImageNet | ResNet-50            | 1-bit weights 2-bit activations\u003cbr\u003e4-bit residuals\u003cbr\u003e8-bit first/last layer weights | Alveo U250       | Alveo U250 |\n| RadioML 2018 | 1D CNN (VGG10)     |  4-bit weights \u0026 activations | ZCU104  | ZCU104 |\n| MaskedFace-Net | [BinaryCoP](https://arxiv.org/pdf/2102.03456)\u003cbr/\u003e*Contributed by TU Munich+BMW*  | 1-bit weights \u0026 activations | Pynq-Z1       | Pynq-Z1 |\n| Google Speech Commands v2 | 3-layer fully-connected  | 3-bit weights \u0026 activations | Pynq-Z1       | Pynq-Z1 |\n| UNSW-NB15 | 4-layer fully-connected  | 2-bit weights \u0026 activations | Pynq-Z1 \u003cbr\u003e ZCU104 \u003cbr\u003e Ultra96       | Pynq-Z1 \u003cbr\u003e ZCU104 \u003cbr\u003e Ultra96 |\n| GTSRB | CNV (VGG-11-like) | 1-bit weights \u0026 activations | Pynq-Z1 | Pynq-Z1 |\n\n*Please note that you can target other boards (such as the Pynq-Z2 or ZCU102) by changing the build script manually, but these accelerators have not been tested.*\n\nWe welcome community contributions to add more examples to this repo!\n\n## Supported Boards\n\n*Note that the larger NNs are only available on Alveo or selected Zynq boards.*\n\n`finn-examples` provides pre-built FPGA bitfiles for the following boards:\n\n* **Edge:** Pynq-Z1, Ultra96 and ZCU104\n* **Datacenter:** Alveo U250\n\nIt's possible to generate Vivado IP for the provided examples to target *any*\nmodern Xilinx FPGA of sufficient size.\nIn this case you'll have to manually integrate the generated IP into your design\nusing Vivado IPI.\nYou can read more about this [here](build/README.md).\n\n## Rebuilding the bitfiles\n\nAll of the examples here are built using the [FINN compiler](https://github.com/Xilinx/finn), and can be re-built or customized.\nSee the [build/README.md](build/README.md) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxilinx%2Ffinn-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxilinx%2Ffinn-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxilinx%2Ffinn-examples/lists"}