Skip to content

Commit

Permalink
Updating driver and backend options
Browse files Browse the repository at this point in the history
  • Loading branch information
jicampos committed Sep 16, 2024
1 parent 668de11 commit 9446586
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions notebooks/workflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"name": "stderr",
"output_type": "stream",
"text": [
"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",
"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",
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
"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",
"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",
"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",
"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",
"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"
"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",
"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",
"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",
"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",
"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"
]
},
{
Expand All @@ -34,7 +34,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/home/jcampos/miniforge3/envs/ml4qick-env/lib/python3.8/site-packages/hls4ml/converters/__init__.py:27: UserWarning: WARNING: Pytorch converter is not enabled!\n",
"/data/jcampos/projects/ml-quantum-readout/environment/hls4ml/hls4ml/converters/__init__.py:27: UserWarning: WARNING: Pytorch converter is not enabled!\n",
" warnings.warn(\"WARNING: Pytorch converter is not enabled!\", stacklevel=1)\n"
]
}
Expand Down Expand Up @@ -210,10 +210,10 @@
"name": "stderr",
"output_type": "stream",
"text": [
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n"
]
},
Expand Down Expand Up @@ -265,7 +265,7 @@
" model.add(QDense(\n",
" hidden, \n",
" activation='relu', \n",
" name='fc1',\n",
" # name='fc1',\n",
" input_shape=(input_shape,), \n",
" kernel_quantizer=quantized_bits(6,0,alpha=1), bias_quantizer=quantized_bits(6,0,alpha=1)\n",
" ))\n",
Expand Down Expand Up @@ -312,7 +312,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -405,7 +405,7 @@
},
{
"cell_type": "code",
"execution_count": 94,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -414,14 +414,14 @@
},
{
"cell_type": "code",
"execution_count": 95,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"3125/3125 [==============================] - 5s 1ms/step\n",
"3125/3125 [==============================] - 5s 2ms/step\n",
"Keras Accuracy: 0.96111\n",
"Keras Fidelity: 0.92222\n"
]
Expand Down Expand Up @@ -518,7 +518,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -532,7 +532,7 @@
},
{
"cell_type": "code",
"execution_count": 88,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -615,20 +615,24 @@
},
{
"cell_type": "code",
"execution_count": 93,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"output_dir = f'../hls4ml_projects/sl-{start_location}_ws-{window_size}'\n",
"xilinx_part = 'xczu49dr-ffvf1760-2-e'\n",
"io_type = 'io_parallel'\n",
"clock_period = 3.225 # 3.225ns (307.2 MHz)\n",
"hls_fig = os.path.join(output_dir, 'model.png')"
"hls_fig = os.path.join(output_dir, 'model.png')\n",
"backend = 'VivadoAccelerator'\n",
"interface = 'axi_master'\n",
"driver = 'c'\n",
"board = 'zcu216'"
]
},
{
"cell_type": "code",
"execution_count": 89,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -672,6 +676,10 @@
" part=xilinx_part,\n",
" io_type=io_type,\n",
" clock_period=clock_period,\n",
" backend=backend,\n",
" board=board,\n",
" interface=interface,\n",
" driver=driver,\n",
")\n",
"\n",
"print(f\"Creating hls4ml project directory {output_dir}\")\n",
Expand All @@ -692,7 +700,7 @@
},
{
"cell_type": "code",
"execution_count": 90,
"execution_count": 15,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -728,7 +736,7 @@
},
{
"cell_type": "code",
"execution_count": 91,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand All @@ -752,8 +760,8 @@
"output_type": "stream",
"text": [
"Done\n",
"3125/3125 [==============================] - 3s 981us/step\n",
"3125/3125 [==============================] - 5s 2ms/step\n",
"3125/3125 [==============================] - 3s 1ms/step\n",
"3125/3125 [==============================] - 5s 1ms/step\n",
"Done taking outputs for Keras model.\n",
"HLS Keys: dict_keys(['q_dense_1', 'q_dense_1_relu', 'q_batch_normalization_1', 'fc2'])\n",
"Keras Keys: dict_keys(['q_dense_1', 'q_dense_1_relu', 'q_batch_normalization_1', 'fc2'])\n"
Expand All @@ -770,7 +778,7 @@
},
{
"cell_type": "code",
"execution_count": 92,
"execution_count": 17,
"metadata": {},
"outputs": [
{
Expand Down

0 comments on commit 9446586

Please sign in to comment.