-
Notifications
You must be signed in to change notification settings - Fork 462
New backend development framework #395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Front end fixes to the quartus pull request
Can you push this also to branch |
It took just ~120 commits, but this PR now passes all tests. There's still many tests to be added, especially for Quartus and all the new features of the IR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get a pytest that targets the Quartus backend? Perhaps adding a parametrisation by backend to test_keras_api.py which tests conversion but also a basic test of the backend correctness.
I have added the tests for the layers supported by Quartus backend into the keras_api test. The latest commit includes the agreed change to drop the use of "HLS" in the names of the classes. I left This is now ready. |
New backend development framework
This is the big PR that was months in the making. The general idea behind it was to decouple the internal model representation from the backend-specific requirements and to be able to create new backends that don't behave exactly the same nor even target the same type of processor (the FPGA).
The changes are extensive, and I'll try to briefly summarize them here:
ip
flow that applies all other flows and produces an IP (essentially the same functionality as we have now but broken into smaller chunks that can be controlled and hooked into)reuse_factor
) to the layers are applied via the flows/optimizers, which replace the layers, types and variables with their versions that can be converted to C++/HLS. For example, we start from simple objects representing tensors that are turned into stream- or array-based variables and the precision is converted from the starting data type to the specific implementation (ap_
orac_
)function_cpp
andconfig_cpp
have been removed from the layers and replaced with backend-specific optimizers (templates) that contain the same functionality. This is the single biggest change by affected line numbers and it came in the very last commit.templates
submodule now only contains the big C++ templates, the accompanying python classes have been moved tobackends
submodule. The folders of this module contain the backend implementations and their optimizers. The three (and the 4th that will come in 2022) FPGA backends share the same ancestorFPGABackend
that defines the common stuff.HLS
in the layers/types/variables I would propose we drophls_
from the file names as well, sohls_model.py
becomesgraph.py
andHLSModel
becomesModelGraph
,hls_layers.py
becomes justlayers.py
,hls_attributes.py
becomesattributes.py
,hls_types.py
becomestypes.py
etc(I'll expand this description over time and also will follow up with a dedicated document describing each feature and how to use it)
Known issues:
Optimizers
andSkipOptimizers
feature of the configQKeras alpharelated stuff has not been wired correctly, so most of the QKeras models don't work.Fixed as of35bf771
GarNet is broken since it wasn't updated to make use of new featuresFixed as of ea7e1d0