forked from fastmachinelearning/hls4ml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhls4ml-pytorch-test.sh
executable file
·33 lines (24 loc) · 1.14 KB
/
hls4ml-pytorch-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
VIVADO_INSTALL_DIR=/opt/Xilinx
VIVADO_VERSION=2017.2
# If running in docker image we would first need to activate the proper conda environment
#. activate hls4ml-py36
# Convert models in pytorch-models.txt
./convert-pytorch-models.sh -x -p 3 -f pytorch-models.txt
# Same for Python 2
#. activate hls4ml-py27
./convert-pytorch-models.sh -x -p 2 -f pytorch-models.txt
# Alternatively, pytorch-to-hls script can be called, with the model name(s) specified, i.e.:
#./pytorch-to-hls.sh -p 3 two_layer_model three_layer_model
#./pytorch-to-hls.sh -p 2 two_layer_model three_layer_model
# Check if there is any difference between files generated by Python 2 and Python 3
# Not needed if there were no changes in pytorch-to-hls.py or hls-writer.py
./py-diff.sh -r 2
# Build the projects generated by pytorch-to-hls script.
# Remove parameter -s to disable synthesis. -p controls the number of parallel tasks
./build-prj.sh -i ${VIVADO_INSTALL_DIR} -v ${VIVADO_VERSION} -c -s -p 2
# Go through the generated reports and print out basic information.
# Reports are available if synthesis is enabled.
./gather-reports.sh -b
# Clean-up at the end
#./cleanup.sh