Skip to content

Commit e60cc17

Browse files
minor fixes
1 parent 1279b4d commit e60cc17

File tree

3 files changed

+16
-200
lines changed

3 files changed

+16
-200
lines changed

hls4ml/backends/vitis_accelerator/supported_boards.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
"alveo-u55c": {
33
"part": "xcu55c-fsvh2892-2L-e",
44
"platform": "xilinx_u55c_gen3x16_xdma_3_202210_1",
5-
"memory": {"type": "hbm", "channels": 32}
5+
"memory": {"type": "hbm", "channels": 32, "capacity": 16}
6+
},
7+
"alveo-u50": {
8+
"part": "xcu50-fsvh2104-2-e",
9+
"platform": "xilinx_u50_gen3x16_xdma_5_202210_1",
10+
"memory": {"type": "hbm", "channels": 32, "capacity": 8}
611
},
712
"alveo-u250": {
813
"part": "xcu250-figd2104-2L-e",
914
"platform": "xilinx_u250_xdma_201830_2",
10-
"memory": {"type": "ddr", "channels": 4}
15+
"memory": {"type": "ddr", "channels": 4, "capacity": 64}
1116
}
1217
}

hls4ml/backends/vitis_accelerator/vitis_accelerator_config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ def __init__(self, config):
1313
if self.board in self.supported_boards.keys():
1414
board_info = self.supported_boards[self.board]
1515
self.part = board_info['part']
16-
if self.board.startswith('alveo'):
17-
self.platform = board_info['platform']
16+
self.platform = board_info['platform']
1817
self.memory_type = board_info['memory']['type']
1918
self.memory_channel_count = board_info['memory']['channels']
2019
else:

vitis_accelerator_test/9_Vitis_Accel.ipynb

Lines changed: 8 additions & 196 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,9 @@
1111
},
1212
{
1313
"cell_type": "code",
14-
"execution_count": 1,
14+
"execution_count": null,
1515
"metadata": {},
16-
"outputs": [
17-
{
18-
"name": "stderr",
19-
"output_type": "stream",
20-
"text": [
21-
"2024-05-16 06:16:51.322811: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE4.1 SSE4.2 AVX AVX2 FMA\n",
22-
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n"
23-
]
24-
}
25-
],
16+
"outputs": [],
2617
"source": [
2718
"from tensorflow.keras.models import load_model\n",
2819
"from qkeras.utils import _add_supported_quantized_objects\n",
@@ -44,50 +35,9 @@
4435
},
4536
{
4637
"cell_type": "code",
47-
"execution_count": 2,
38+
"execution_count": null,
4839
"metadata": {},
49-
"outputs": [
50-
{
51-
"name": "stderr",
52-
"output_type": "stream",
53-
"text": [
54-
"2024-05-16 06:16:59.043487: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE4.1 SSE4.2 AVX AVX2 FMA\n",
55-
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n"
56-
]
57-
},
58-
{
59-
"name": "stdout",
60-
"output_type": "stream",
61-
"text": [
62-
"WARNING:tensorflow:From /opt/conda/lib/python3.10/site-packages/tensorflow/python/autograph/pyct/static_analysis/liveness.py:83: Analyzer.lamba_check (from tensorflow.python.autograph.pyct.static_analysis.liveness) is deprecated and will be removed after 2023-09-23.\n",
63-
"Instructions for updating:\n",
64-
"Lambda fuctions will be no more assumed to be used in the statement where they are used, or at least in the same block. https://github.com/tensorflow/tensorflow/issues/56089\n"
65-
]
66-
},
67-
{
68-
"name": "stderr",
69-
"output_type": "stream",
70-
"text": [
71-
"WARNING:tensorflow:From /opt/conda/lib/python3.10/site-packages/tensorflow/python/autograph/pyct/static_analysis/liveness.py:83: Analyzer.lamba_check (from tensorflow.python.autograph.pyct.static_analysis.liveness) is deprecated and will be removed after 2023-09-23.\n",
72-
"Instructions for updating:\n",
73-
"Lambda fuctions will be no more assumed to be used in the statement where they are used, or at least in the same block. https://github.com/tensorflow/tensorflow/issues/56089\n"
74-
]
75-
},
76-
{
77-
"name": "stdout",
78-
"output_type": "stream",
79-
"text": [
80-
"WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.\n"
81-
]
82-
},
83-
{
84-
"name": "stderr",
85-
"output_type": "stream",
86-
"text": [
87-
"WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.\n"
88-
]
89-
}
90-
],
40+
"outputs": [],
9141
"source": [
9242
"model = load_model('model_3/KERAS_check_best_model.h5', custom_objects=co)"
9343
]
@@ -102,131 +52,9 @@
10252
},
10353
{
10454
"cell_type": "code",
105-
"execution_count": 5,
55+
"execution_count": null,
10656
"metadata": {},
107-
"outputs": [
108-
{
109-
"name": "stdout",
110-
"output_type": "stream",
111-
"text": [
112-
"Interpreting Sequential\n",
113-
"Topology:\n",
114-
"Layer name: fc1_input, layer type: InputLayer, input shapes: [[None, 16]], output shape: [None, 16]\n",
115-
"Layer name: fc1, layer type: QDense, input shapes: [[None, 16]], output shape: [None, 64]\n",
116-
"Layer name: relu1, layer type: Activation, input shapes: [[None, 64]], output shape: [None, 64]\n",
117-
"Layer name: fc2, layer type: QDense, input shapes: [[None, 64]], output shape: [None, 32]\n",
118-
"Layer name: relu2, layer type: Activation, input shapes: [[None, 32]], output shape: [None, 32]\n",
119-
"Layer name: fc3, layer type: QDense, input shapes: [[None, 32]], output shape: [None, 32]\n",
120-
"Layer name: relu3, layer type: Activation, input shapes: [[None, 32]], output shape: [None, 32]\n",
121-
"Layer name: output, layer type: QDense, input shapes: [[None, 32]], output shape: [None, 5]\n",
122-
"Layer name: softmax, layer type: Softmax, input shapes: [[None, 5]], output shape: [None, 5]\n",
123-
"-----------------------------------\n",
124-
"Model\n",
125-
" Precision: fixed<16,6>\n",
126-
" ReuseFactor: 1\n",
127-
" Strategy: Latency\n",
128-
" BramFactor: 1000000000\n",
129-
" TraceOutput: False\n",
130-
"LayerName\n",
131-
" fc1_input\n",
132-
" Trace: False\n",
133-
" Precision\n",
134-
" result: fixed<16,6>\n",
135-
" fc1\n",
136-
" Trace: False\n",
137-
" Precision\n",
138-
" result: fixed<16,6>\n",
139-
" weight: fixed<6,1,TRN,WRAP,0>\n",
140-
" bias: fixed<6,1,TRN,WRAP,0>\n",
141-
" fc1_linear\n",
142-
" Trace: False\n",
143-
" Precision\n",
144-
" result: fixed<16,6>\n",
145-
" relu1\n",
146-
" Trace: False\n",
147-
" Precision\n",
148-
" result: ufixed<6,0,RND_CONV,SAT,0>\n",
149-
" fc2\n",
150-
" Trace: False\n",
151-
" Precision\n",
152-
" result: fixed<16,6>\n",
153-
" weight: fixed<6,1,TRN,WRAP,0>\n",
154-
" bias: fixed<6,1,TRN,WRAP,0>\n",
155-
" fc2_linear\n",
156-
" Trace: False\n",
157-
" Precision\n",
158-
" result: fixed<16,6>\n",
159-
" relu2\n",
160-
" Trace: False\n",
161-
" Precision\n",
162-
" result: ufixed<6,0,RND_CONV,SAT,0>\n",
163-
" fc3\n",
164-
" Trace: False\n",
165-
" Precision\n",
166-
" result: fixed<16,6>\n",
167-
" weight: fixed<6,1,TRN,WRAP,0>\n",
168-
" bias: fixed<6,1,TRN,WRAP,0>\n",
169-
" fc3_linear\n",
170-
" Trace: False\n",
171-
" Precision\n",
172-
" result: fixed<16,6>\n",
173-
" relu3\n",
174-
" Trace: False\n",
175-
" Precision\n",
176-
" result: ufixed<6,0,RND_CONV,SAT,0>\n",
177-
" output\n",
178-
" Trace: False\n",
179-
" Precision\n",
180-
" result: fixed<16,6>\n",
181-
" weight: fixed<6,1,TRN,WRAP,0>\n",
182-
" bias: fixed<6,1,TRN,WRAP,0>\n",
183-
" output_linear\n",
184-
" Trace: False\n",
185-
" Precision\n",
186-
" result: fixed<16,6>\n",
187-
" softmax\n",
188-
" Trace: False\n",
189-
" Precision\n",
190-
" result: fixed<16,6>\n",
191-
" exp_table_t: ap_fixed<18,8>\n",
192-
" inv_table_t: ap_fixed<18,4>\n",
193-
"-----------------------------------\n",
194-
"Interpreting Sequential\n",
195-
"Topology:\n",
196-
"Layer name: fc1_input, layer type: InputLayer, input shapes: [[None, 16]], output shape: [None, 16]\n",
197-
"Layer name: fc1, layer type: QDense, input shapes: [[None, 16]], output shape: [None, 64]\n",
198-
"Layer name: relu1, layer type: Activation, input shapes: [[None, 64]], output shape: [None, 64]\n",
199-
"Layer name: fc2, layer type: QDense, input shapes: [[None, 64]], output shape: [None, 32]\n",
200-
"Layer name: relu2, layer type: Activation, input shapes: [[None, 32]], output shape: [None, 32]\n",
201-
"Layer name: fc3, layer type: QDense, input shapes: [[None, 32]], output shape: [None, 32]\n",
202-
"Layer name: relu3, layer type: Activation, input shapes: [[None, 32]], output shape: [None, 32]\n",
203-
"Layer name: output, layer type: QDense, input shapes: [[None, 32]], output shape: [None, 5]\n",
204-
"Layer name: softmax, layer type: Softmax, input shapes: [[None, 5]], output shape: [None, 5]\n",
205-
"Creating HLS model\n",
206-
"Writing HLS project\n",
207-
"WARNING:tensorflow:Compiled the loaded model, but the compiled metrics have yet to be built. `model.compile_metrics` will be empty until you train or evaluate the model.\n"
208-
]
209-
},
210-
{
211-
"name": "stderr",
212-
"output_type": "stream",
213-
"text": [
214-
"WARNING:tensorflow:Compiled the loaded model, but the compiled metrics have yet to be built. `model.compile_metrics` will be empty until you train or evaluate the model.\n"
215-
]
216-
},
217-
{
218-
"name": "stdout",
219-
"output_type": "stream",
220-
"text": [
221-
"Done\n",
222-
"\n",
223-
"\n",
224-
"Writing Accelerator code\n",
225-
"WARNING: You set a Part that does not correspond to the Board you specified.The correct Part is now set.\n",
226-
"Done\n"
227-
]
228-
}
229-
],
57+
"outputs": [],
23058
"source": [
23159
"import sys\n",
23260
"import os\n",
@@ -271,25 +99,9 @@
27199
},
272100
{
273101
"cell_type": "code",
274-
"execution_count": 6,
102+
"execution_count": null,
275103
"metadata": {},
276-
"outputs": [
277-
{
278-
"name": "stdout",
279-
"output_type": "stream",
280-
"text": [
281-
"Part: xcvu13p-flga2577-2-e\n",
282-
"ClockPeriod: 5\n",
283-
"IOType: io_parallel\n",
284-
"HLSConfig\n",
285-
"AcceleratorConfig\n",
286-
" Board: alveo-u55c\n",
287-
" Num_Kernel: 1\n",
288-
" Num_Thread: 1\n",
289-
" Batchsize: 8192\n"
290-
]
291-
}
292-
],
104+
"outputs": [],
293105
"source": [
294106
"plotting.print_dict(hls4ml.backends.get_backend('VitisAccelerator').create_initial_config())"
295107
]

0 commit comments

Comments
 (0)