-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #413 from Xilinx/dev
FINN v0.7
- Loading branch information
Showing
205 changed files
with
8,062 additions
and
4,574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
name: Bug report | ||
about: Something isn't working as expected | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
|
||
## Prerequisites | ||
Please make sure to check off these prerequisites before submitting a bug report. | ||
- [ ] Test that the bug appears on the current version of the dev-branch. Make sure to include the commit hash of the commit you checked out. | ||
- [ ] Check that the issue hasn't already been reported, by checking the currently open issues. | ||
- [ ] If there are steps to reproduce the problem, make sure to write them down below. | ||
- [ ] If relevant, please include the ONNX files, which were created directly before and/or after the bug. | ||
|
||
## Quick summary | ||
Please give a brief and concise description of the bug. | ||
|
||
## Details | ||
Please add to the following sections to describe the bug as accurately as possible. | ||
|
||
### Steps to Reproduce | ||
Add what needs to be done to reproduce the bug. Add code examples where useful | ||
and make sure to include the resulting ONNX files, and the commit hash you are working on. | ||
|
||
1. Clone the FINN repository | ||
2. Checkout the dev branch, with commit hash: [...] | ||
3. Start the docker container with the command: [...] | ||
4. Run transformation [...] on ONNX file [...] or run the dataflow builder with the following settings: [...] | ||
5. [Further steps ...] | ||
|
||
### Expected behavior | ||
Please add a brief description of what you expected to happen. | ||
|
||
### Actual behavior | ||
Describe what actually happens instead. | ||
|
||
## Optional | ||
|
||
### Possible fix | ||
If you already know where the issue stems from, or you have a hint please let us know. | ||
|
||
### Additional context | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Getting started with FINN | ||
url: https://finn.readthedocs.io/en/latest/getting_started.html | ||
about: Documentation about how to get up and running with FINN. | ||
- name: Ask for help and get in touch with the community | ||
url: https://gitter.im/xilinx-finn/community | ||
about: Check out our gitter channel, if you have a question about FINN or a general problem that is likely not a bug. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for FINN | ||
title: '' | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Prerequisites | ||
Please make sure to check that the idea is not already being worked on | ||
by looking at the currently open issues and the [project Kanbans](https://github.com/Xilinx/finn/projects). | ||
|
||
Even if an idea is already being worked on you can still create a feature request, | ||
if you would like to open a discussion about the feature or want to contribute to it. | ||
|
||
## Details | ||
Please add to the following sections to describe the feature as accurately as possible. | ||
|
||
### New behavior | ||
Please add a brief and concise description of what you would like to happen in FINN in the future. | ||
|
||
### Motivation | ||
Please tell us why this feature is important to the FINN community. | ||
|
||
### Parts of FINN affected | ||
Please describe which parts of FINN would be affected by this feature. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: DockerImage | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'dev' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- | ||
name: checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
file: docker/Dockerfile.finn | ||
context: . | ||
push: true | ||
tags: maltanar/finn:dev_latest | ||
- | ||
name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Pre-commit | ||
|
||
on: | ||
pull_request: | ||
branches: [ main, dev ] | ||
push: | ||
branches: [ main, dev ] | ||
|
||
jobs: | ||
lint: | ||
name: Lint PR or Push to DEV | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Run Lint | ||
uses: pre-commit/action@v2.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[settings] | ||
line_length=88 | ||
indent=' ' | ||
skip=.tox,.venv,build,dist | ||
known_standard_library=setuptools,pkg_resources | ||
known_test=pytest | ||
known_first_party=finn | ||
sections=FUTURE,STDLIB,TEST,THIRDPARTY,FIRSTPARTY,LOCALFOLDER | ||
default_section=THIRDPARTY | ||
multi_line_output=3 | ||
profile=black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright (c) 2021, Xilinx | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# | ||
# * Redistributions of source code must retain the above copyright notice, this | ||
# list of conditions and the following disclaimer. | ||
# | ||
# * Redistributions in binary form must reproduce the above copyright notice, | ||
# this list of conditions and the following disclaimer in the documentation | ||
# and/or other materials provided with the distribution. | ||
# | ||
# * Neither the name of FINN nor the names of its | ||
# contributors may be used to endorse or promote products derived from | ||
# this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
version: 2 | ||
|
||
sphinx: | ||
configuration: docs/finn/conf.py | ||
|
||
python: | ||
version: 3.7 | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/****************************************************************************** | ||
* Copyright (c) 2021, Xilinx | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* | ||
* * Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* * Neither the name of FINN nor the names of its | ||
* contributors may be used to endorse or promote products derived from | ||
* this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*******************************************************************************/ | ||
|
||
#include <ap_int.h> | ||
#include <hls_stream.h> | ||
|
||
#ifndef LOOKUP_HPP | ||
#define LOOKUP_HPP | ||
|
||
template < | ||
unsigned NumEmbeddings, | ||
unsigned EmbeddingDim, | ||
unsigned NumInputs, | ||
typename InputType, | ||
typename EmbeddingType, | ||
typename InputPackedType = ap_uint<InputType::width>, | ||
typename OutputPackedType = ap_uint<EmbeddingDim*EmbeddingType::width>> | ||
void StreamingLookup( | ||
hls::stream<InputPackedType> &in, | ||
hls::stream<OutputPackedType> &out, | ||
OutputPackedType const embeddings[NumEmbeddings] | ||
) { | ||
for(unsigned i = 0; i < NumInputs; i++) { | ||
#pragma HLS PIPELINE II=1 | ||
InputPackedType inPackedElem = in.read(); | ||
InputType inElem = *(reinterpret_cast<InputType*>(&inPackedElem)); | ||
OutputPackedType outElem = embeddings[inElem]; | ||
out.write(outElem); | ||
} | ||
} | ||
|
||
#endif |
Oops, something went wrong.