Skip to content

Commit 9446586

Browse files
committed
Updating driver and backend options
1 parent 668de11 commit 9446586

File tree

1 file changed

+34
-26
lines changed

1 file changed

+34
-26
lines changed

notebooks/workflow.ipynb

+34-26
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
"name": "stderr",
1010
"output_type": "stream",
1111
"text": [
12-
"2024-09-16 15:05:42.586474: 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: AVX2 AVX512F FMA\n",
12+
"2024-09-16 16:48:07.678368: 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: AVX2 AVX512F FMA\n",
1313
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
14-
"2024-09-16 15:05:42.694392: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory\n",
15-
"2024-09-16 15:05:42.694414: I tensorflow/compiler/xla/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.\n",
16-
"2024-09-16 15:05:43.217525: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory\n",
17-
"2024-09-16 15:05:43.217583: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory\n",
18-
"2024-09-16 15:05:43.217590: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.\n"
14+
"2024-09-16 16:48:07.780357: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory\n",
15+
"2024-09-16 16:48:07.780375: I tensorflow/compiler/xla/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.\n",
16+
"2024-09-16 16:48:08.294768: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory\n",
17+
"2024-09-16 16:48:08.294833: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory\n",
18+
"2024-09-16 16:48:08.294840: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.\n"
1919
]
2020
},
2121
{
@@ -34,7 +34,7 @@
3434
"name": "stderr",
3535
"output_type": "stream",
3636
"text": [
37-
"/home/jcampos/miniforge3/envs/ml4qick-env/lib/python3.8/site-packages/hls4ml/converters/__init__.py:27: UserWarning: WARNING: Pytorch converter is not enabled!\n",
37+
"/data/jcampos/projects/ml-quantum-readout/environment/hls4ml/hls4ml/converters/__init__.py:27: UserWarning: WARNING: Pytorch converter is not enabled!\n",
3838
" warnings.warn(\"WARNING: Pytorch converter is not enabled!\", stacklevel=1)\n"
3939
]
4040
}
@@ -210,10 +210,10 @@
210210
"name": "stderr",
211211
"output_type": "stream",
212212
"text": [
213-
"2024-09-16 15:05:48.812504: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory\n",
214-
"2024-09-16 15:05:48.812560: W tensorflow/compiler/xla/stream_executor/cuda/cuda_driver.cc:265] failed call to cuInit: UNKNOWN ERROR (303)\n",
215-
"2024-09-16 15:05:48.812599: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (correlator4.fnal.gov): /proc/driver/nvidia/version does not exist\n",
216-
"2024-09-16 15:05:48.813005: 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: AVX2 AVX512F FMA\n",
213+
"2024-09-16 16:48:11.835530: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory\n",
214+
"2024-09-16 16:48:11.835556: W tensorflow/compiler/xla/stream_executor/cuda/cuda_driver.cc:265] failed call to cuInit: UNKNOWN ERROR (303)\n",
215+
"2024-09-16 16:48:11.835575: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (correlator4.fnal.gov): /proc/driver/nvidia/version does not exist\n",
216+
"2024-09-16 16:48:11.835777: 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: AVX2 AVX512F FMA\n",
217217
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n"
218218
]
219219
},
@@ -265,7 +265,7 @@
265265
" model.add(QDense(\n",
266266
" hidden, \n",
267267
" activation='relu', \n",
268-
" name='fc1',\n",
268+
" # name='fc1',\n",
269269
" input_shape=(input_shape,), \n",
270270
" kernel_quantizer=quantized_bits(6,0,alpha=1), bias_quantizer=quantized_bits(6,0,alpha=1)\n",
271271
" ))\n",
@@ -312,7 +312,7 @@
312312
},
313313
{
314314
"cell_type": "code",
315-
"execution_count": 8,
315+
"execution_count": 7,
316316
"metadata": {},
317317
"outputs": [
318318
{
@@ -405,7 +405,7 @@
405405
},
406406
{
407407
"cell_type": "code",
408-
"execution_count": 94,
408+
"execution_count": 8,
409409
"metadata": {},
410410
"outputs": [],
411411
"source": [
@@ -414,14 +414,14 @@
414414
},
415415
{
416416
"cell_type": "code",
417-
"execution_count": 95,
417+
"execution_count": 9,
418418
"metadata": {},
419419
"outputs": [
420420
{
421421
"name": "stdout",
422422
"output_type": "stream",
423423
"text": [
424-
"3125/3125 [==============================] - 5s 1ms/step\n",
424+
"3125/3125 [==============================] - 5s 2ms/step\n",
425425
"Keras Accuracy: 0.96111\n",
426426
"Keras Fidelity: 0.92222\n"
427427
]
@@ -518,7 +518,7 @@
518518
},
519519
{
520520
"cell_type": "code",
521-
"execution_count": 10,
521+
"execution_count": 11,
522522
"metadata": {},
523523
"outputs": [],
524524
"source": [
@@ -532,7 +532,7 @@
532532
},
533533
{
534534
"cell_type": "code",
535-
"execution_count": 88,
535+
"execution_count": 12,
536536
"metadata": {},
537537
"outputs": [
538538
{
@@ -615,20 +615,24 @@
615615
},
616616
{
617617
"cell_type": "code",
618-
"execution_count": 93,
618+
"execution_count": 13,
619619
"metadata": {},
620620
"outputs": [],
621621
"source": [
622622
"output_dir = f'../hls4ml_projects/sl-{start_location}_ws-{window_size}'\n",
623623
"xilinx_part = 'xczu49dr-ffvf1760-2-e'\n",
624624
"io_type = 'io_parallel'\n",
625625
"clock_period = 3.225 # 3.225ns (307.2 MHz)\n",
626-
"hls_fig = os.path.join(output_dir, 'model.png')"
626+
"hls_fig = os.path.join(output_dir, 'model.png')\n",
627+
"backend = 'VivadoAccelerator'\n",
628+
"interface = 'axi_master'\n",
629+
"driver = 'c'\n",
630+
"board = 'zcu216'"
627631
]
628632
},
629633
{
630634
"cell_type": "code",
631-
"execution_count": 89,
635+
"execution_count": 14,
632636
"metadata": {},
633637
"outputs": [
634638
{
@@ -672,6 +676,10 @@
672676
" part=xilinx_part,\n",
673677
" io_type=io_type,\n",
674678
" clock_period=clock_period,\n",
679+
" backend=backend,\n",
680+
" board=board,\n",
681+
" interface=interface,\n",
682+
" driver=driver,\n",
675683
")\n",
676684
"\n",
677685
"print(f\"Creating hls4ml project directory {output_dir}\")\n",
@@ -692,7 +700,7 @@
692700
},
693701
{
694702
"cell_type": "code",
695-
"execution_count": 90,
703+
"execution_count": 15,
696704
"metadata": {},
697705
"outputs": [
698706
{
@@ -728,7 +736,7 @@
728736
},
729737
{
730738
"cell_type": "code",
731-
"execution_count": 91,
739+
"execution_count": 16,
732740
"metadata": {},
733741
"outputs": [
734742
{
@@ -752,8 +760,8 @@
752760
"output_type": "stream",
753761
"text": [
754762
"Done\n",
755-
"3125/3125 [==============================] - 3s 981us/step\n",
756-
"3125/3125 [==============================] - 5s 2ms/step\n",
763+
"3125/3125 [==============================] - 3s 1ms/step\n",
764+
"3125/3125 [==============================] - 5s 1ms/step\n",
757765
"Done taking outputs for Keras model.\n",
758766
"HLS Keys: dict_keys(['q_dense_1', 'q_dense_1_relu', 'q_batch_normalization_1', 'fc2'])\n",
759767
"Keras Keys: dict_keys(['q_dense_1', 'q_dense_1_relu', 'q_batch_normalization_1', 'fc2'])\n"
@@ -770,7 +778,7 @@
770778
},
771779
{
772780
"cell_type": "code",
773-
"execution_count": 92,
781+
"execution_count": 17,
774782
"metadata": {},
775783
"outputs": [
776784
{

0 commit comments

Comments
 (0)