-
Notifications
You must be signed in to change notification settings - Fork 480
Vitis accelerator #991
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
Open
axiotisk
wants to merge
76
commits into
fastmachinelearning:main
Choose a base branch
from
axiotisk:vitis_accelerator_dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Vitis accelerator #991
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
de5d4d3
Initial version of VitisAccelerator backend:
axiotisk 54fa480
fixing discrepancies post-merge
alex-yang-upenn b4dd93d
reverting unnecessary changes
alex-yang-upenn b477cce
final adjustments
alex-yang-upenn be71a58
minor fixes and testing notebook
alex-yang-upenn 7163096
minor fixes
alex-yang-upenn 1e6fa24
Updated host code and added more board support
alex-yang-upenn 6e0bb8a
cleaned up c++ code generation and added build functionality
alex-yang-upenn ea95210
Added ability to use numpy array as I/O + CNN fixes
alex-yang-upenn 17ef012
Optimizations for reading dat + copytree bugfix
alex-yang-upenn 6e0cb47
updated testing notebook
alex-yang-upenn 0e0185a
Cleaned-up host code + improved .dat generation
alex-yang-upenn 6eccfb1
fixed testing notebook
alex-yang-upenn c1de99b
build() signature alignment + xcl update + write_host() overwrite
alex-yang-upenn fa01fa1
Fix VCK5000 part definition
2165127
Documentation draft
axiotisk f1300f4
Default directives + HLS Clock control
alex-yang-upenn 713781a
implementing hw quant option
alex-yang-upenn 680aa29
Update makefile
21b4d92
Fix vck5000 detection in makefile
eb9ddf5
Remove messageDb from config file now that it is handled in makefile
4b5925b
build dir name + versal packaging + ultraclean
alex-yang-upenn 9ae3705
minor fixes
alex-yang-upenn a63fe52
Fix Makefile template and Makefile generation
c73114c
Python black formating
49cf2e8
Apply pre-commit suggested changes (formating)
76520d8
Update manifest and remove developpement requirement.txt
55400fa
Update documentation.
17a2dde
Documentation update
alex-yang-upenn a04e1f3
fixing build() behavior + documentation
alex-yang-upenn 631d13d
Whitespace cleanup
2f23026
Fix missing parameter in create_initial_config() (due to rebase)
75584bf
Remove duplication in documentation
axiotisk e209bfb
Fix pre-commit
axiotisk 7e08a31
fixing spacing in generated code
alex-yang-upenn 673fbab
Fix typo
0ee67bc
Update bulild():
b4df872
Add a target parameter to hardware_predict()
81aaa27
Update documentation.
0c1c6aa
Setup emu in Makefile and edit tb_input_features in host
axiotisk 3071549
Backend and Makefile fixes for emulation
axiotisk 9cccde2
Update host code for clarity & better data handling
alex-yang-upenn 901dc64
Allowing flexibility with platforms
alex-yang-upenn 109b331
VitisAccelerator Host code refactor:
766c07d
fix(vitis_backend.py): command variable not initialized on hardware_p…
Djokzer 3630148
feat[shared_library]: started a predict function in host code
Djokzer c31bbbe
feat[shared_library]: Can load test data from python to the host code
Djokzer 1716eff
feat[shared_library]: shared library works in python but not with jup…
Djokzer 6230d70
feat[hardware_predict]: add shared lib way in the hardware predict fu…
Djokzer 667cf53
fix[hardware_predict]: Check if shared lib exists
Djokzer 8407bb0
fix[hardware_predict]: Fixed hardcoded output directory
Djokzer f840df8
feat[hardware_predict] : add debug print
Djokzer 3a0c43d
fix[debug]: fixed a print error
Djokzer 2492ce9
fix[shared_library] : Print on a file, because print don't work with …
Djokzer 0902ba6
fix[hardware_predict]: Force x array to float64
Djokzer d9c0370
Fix[hardware_predict]: Fixed working directory changing
Djokzer 9448b12
feat[shared_lib]: small opti for input buffer to vector
Djokzer 6032ee7
fix[hardware_predict]: file based makefile, fix make run
Djokzer 5aaaf47
feat[platforms]: more user friendly platform selection
Djokzer 6df5b93
fix[platforms] : fixed typo on print
Djokzer 33d85dc
fix[hardware_predict]: Fixed rebuild when hardware predict, changed d…
Djokzer 1340296
fix[hardware_predict]: fixed x input for file based
Djokzer 12ad2d2
Improves commande line help message
fe60c69
Enable dynamic batch size for io_stream wrapper
172c9a5
Enable dynmamic batch size for io_parallel
8d218d3
fix[io_parralel]: fixed dynamic batchsize for io_parallel
Djokzer f32175d
fix[io_parallel]: override nnet utils with vitis backend
Djokzer 608b520
docs[vitis_accel]: updated docs
Djokzer 49577ca
docs[vitis_accel]: updated example
Djokzer 7eda110
docs[vitis_accel]: add platform selection
Djokzer 476a9b7
docs[vitis_accel]: add note about io_type
Djokzer c228558
docs[vitis_accel]: formatting and typo fix
Djokzer 2858a0c
Update doc
0dbd6e9
Fix pre-commit formating
d224ffb
fix[feature_check]: align warning with vitis backend
Djokzer 9e91c95
Make HGQ aware of VitisAccelerator backend.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Empty file.
Empty file.
This file contains hidden or 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,35 @@ | ||
from hls4ml.model.optimizer import OptimizerPass | ||
|
||
|
||
class ValidateConvImplementation(OptimizerPass): | ||
def match(self, node): | ||
return 'Conv' in node.class_name | ||
|
||
def transform(self, model, node): | ||
if node.get_attr('implementation', 'linebuffer') == 'encoded': | ||
print( | ||
f'WARNING: "Encoded" implementation in "{node.name}" ({node.class_name}) is not supported in Vitis backend. ' | ||
'Switching to "LineBuffer" implementation.' | ||
) | ||
node.set_attr('implementation', 'linebuffer') | ||
|
||
|
||
class ValidateStrategy(OptimizerPass): | ||
_resource_layer_cls = ['Conv1D', 'Conv2D', 'Dense'] | ||
|
||
def match(self, node): | ||
is_resource_layer = len([layer_cls for layer_cls in self._resource_layer_cls if layer_cls in node.class_name]) > 0 | ||
is_resource_strategy = node.model.config.is_resource_strategy(node) | ||
|
||
return is_resource_layer and is_resource_strategy | ||
|
||
def transform(self, model, node): | ||
n_in, _ = model.config.backend.get_layer_mult_size(node) | ||
rf = node.get_attr('reuse_factor') | ||
if rf > n_in and rf % n_in > 0: | ||
print( | ||
f'WARNING: "Resource" strategy in "{node.name}" ({node.class_name}) may have suboptimal QoR in Vitis ' | ||
'backend due to use of "urem" cores in Vitis HLS <= 2022.1.\n' | ||
'Consider using a different ReuseFactor or switching to "Latency" strategy if using older versions ' | ||
'of Vitis HLS.' | ||
) |
This file contains hidden or 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,26 @@ | ||
{ | ||
"alveo-u55c": { | ||
"board_type": "alveo", | ||
"part": "xcu55c-fsvh2892-2L-e", | ||
"platform": ["xilinx_u55c_gen3x16_xdma_3_202210_1"], | ||
"memory": {"type": "hbm", "channels": 32, "capacity": 16} | ||
}, | ||
"alveo-u50": { | ||
"board_type": "alveo", | ||
"part": "xcu50-fsvh2104-2-e", | ||
"platform": ["xilinx_u50_gen3x16_xdma_5_202210_1"], | ||
"memory": {"type": "hbm", "channels": 32, "capacity": 8} | ||
}, | ||
"alveo-u250": { | ||
"board_type": "alveo", | ||
"part": "xcu250-figd2104-2L-e", | ||
"platform": ["xilinx_u250_xdma_201830_2"], | ||
"memory": {"type": "ddr", "channels": 4, "capacity": 64} | ||
}, | ||
"vck5000": { | ||
"board_type": "versal", | ||
"part": "xcvc1902-vsvd1760-2MP-e-S", | ||
"platform": ["xilinx_vck5000_gen4x8_qdma_2_202220_1"], | ||
"memory":{"type": "ddr", "channels": 3, "capacity": 12} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this still an issue? For the regular Vitis backend Resource now works fine.
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.
Thanks for pointing this out! I checked and the regular Vitis backend still has this warning in its feature_check. To keep consistency between backends, I just updated the code here to replicate the current Vitis behavior.