From 3b4bfda6145462d32702b8de08efcafd70d0164c Mon Sep 17 00:00:00 2001 From: Hashim Sharif <hsharif3@miranda.cs.illinois.edu> Date: Sat, 23 Jan 2021 01:10:03 -0600 Subject: [PATCH] TensorRT source cleanups + CMake cleanup --- hpvm/projects/hpvm-tensor-rt/CMakeLists.txt | 158 +-- .../{half => fp16}/alexnet2_cifar10_half.cc | 0 .../{half => fp16}/alexnet_cifar10_half.cc | 0 .../src/{half => fp16}/lenet_mnist_half.cc | 0 .../src/{half => fp16}/mobilenet_half.cc | 0 .../{half => fp16}/mobilenet_shallow_half.cc | 0 .../alexnet2_cifar10_half_profiling.cc | 0 .../alexnet_cifar10_half_profiling.cc | 0 .../profiling/lenet_keras_half_profiling.cc | 0 .../mobilenet_depthwise_half_profiling.cc | 0 .../mobilenet_half_cifar10_profiling.cc | 0 ...ilenet_shallow_depthwise_half_profiling.cc | 0 .../mobilenet_shallow_half_profiling.cc | 0 .../resnet18_cifar10_half_profiling.cc | 0 .../vgg16_cifar100_half_profiling.cc | 0 .../profiling/vgg16_cifar10_half_profiling.cc | 0 .../{half => fp16}/resnet18_cifar10_half.cc | 0 .../src/{half => fp16}/vgg16_cifar100_half.cc | 0 .../src/{half => fp16}/vgg16_cifar10_half.cc | 0 .../src/{ => fp32}/alexnet2_canny.cc | 0 .../src/{ => fp32}/alexnet2_cifar10.cc | 0 .../src/{ => fp32}/alexnet_cifar10.cc | 0 .../src/{ => fp32}/alexnet_imagenet.cc | 0 .../dnn_sources/src/{ => fp32}/lenet_mnist.cc | 0 .../dnn_sources/src/{ => fp32}/mobilenet.cc | 0 .../src/{ => fp32}/mobilenet_shallow.cc | 0 .../src/{ => fp32}/resnet18_cifar10.cc | 0 .../src/{ => fp32}/resnet50_imagenet.cc | 0 .../src/{ => fp32}/vgg16_cifar10.cc | 0 .../src/{ => fp32}/vgg16_cifar100.cc | 0 .../src/{ => fp32}/vgg16_cifar100_5.cc | 0 .../src/{ => fp32}/vgg16_imagenet.cc | 0 .../dnn_sources/src/promise/alexnet2_piped.cc | 172 ---- .../src/promise/alexnet2_promise.cc | 167 ---- .../src/promise/alexnet_imagenet_piped.cc | 106 -- .../src/promise/alexnet_imagenet_promise.cc | 102 -- .../dnn_sources/src/promise/alexnet_piped.cc | 167 ---- .../src/promise/alexnet_promise.cc | 160 --- .../dnn_sources/src/promise/lenet_piped.cc | 175 ---- .../dnn_sources/src/promise/lenet_promise.cc | 167 ---- .../src/promise/mobilenet_piped.cc | 492 ---------- .../src/promise/mobilenet_promise.cc | 487 --------- .../src/promise/mobilenet_shallow_piped.cc | 313 ------ .../src/promise/mobilenet_shallow_promise.cc | 304 ------ .../dnn_sources/src/promise/resnet18_piped.cc | 265 ----- .../src/promise/resnet18_promise.cc | 259 ----- .../src/promise/resnet50_imagenet_piped.cc | 925 ------------------ .../src/promise/resnet50_imagenet_promise.cc | 874 ----------------- .../src/promise/vgg16_cifar100_piped.cc | 212 ---- .../src/promise/vgg16_cifar100_promise.cc | 207 ---- .../promise/vgg16_cifar100_top5_promise.cc | 137 --- .../src/promise/vgg16_cifar10_piped.cc | 214 ---- .../src/promise/vgg16_cifar10_promise.cc | 208 ---- .../src/promise/vgg16_imagenet_piped.cc | 186 ---- .../src/promise/vgg16_imagenet_promise.cc | 179 ---- 55 files changed, 33 insertions(+), 6603 deletions(-) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/alexnet2_cifar10_half.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/alexnet_cifar10_half.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/lenet_mnist_half.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/mobilenet_half.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/mobilenet_shallow_half.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/profiling/alexnet2_cifar10_half_profiling.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/profiling/alexnet_cifar10_half_profiling.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/profiling/lenet_keras_half_profiling.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/profiling/mobilenet_depthwise_half_profiling.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/profiling/mobilenet_half_cifar10_profiling.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/profiling/mobilenet_shallow_depthwise_half_profiling.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/profiling/mobilenet_shallow_half_profiling.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/profiling/resnet18_cifar10_half_profiling.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/profiling/vgg16_cifar100_half_profiling.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/profiling/vgg16_cifar10_half_profiling.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/resnet18_cifar10_half.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/vgg16_cifar100_half.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{half => fp16}/vgg16_cifar10_half.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/alexnet2_canny.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/alexnet2_cifar10.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/alexnet_cifar10.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/alexnet_imagenet.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/lenet_mnist.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/mobilenet.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/mobilenet_shallow.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/resnet18_cifar10.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/resnet50_imagenet.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/vgg16_cifar10.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/vgg16_cifar100.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/vgg16_cifar100_5.cc (100%) rename hpvm/projects/hpvm-tensor-rt/dnn_sources/src/{ => fp32}/vgg16_imagenet.cc (100%) delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet2_piped.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet2_promise.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_imagenet_piped.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_imagenet_promise.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_piped.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_promise.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/lenet_piped.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/lenet_promise.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_piped.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_promise.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_shallow_piped.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_shallow_promise.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet18_piped.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet18_promise.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet50_imagenet_piped.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet50_imagenet_promise.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar100_piped.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar100_promise.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar100_top5_promise.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar10_piped.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar10_promise.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_imagenet_piped.cc delete mode 100644 hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_imagenet_promise.cc diff --git a/hpvm/projects/hpvm-tensor-rt/CMakeLists.txt b/hpvm/projects/hpvm-tensor-rt/CMakeLists.txt index d5d7895dcd..0b66eb6950 100644 --- a/hpvm/projects/hpvm-tensor-rt/CMakeLists.txt +++ b/hpvm/projects/hpvm-tensor-rt/CMakeLists.txt @@ -178,158 +178,66 @@ add_dependencies(tensor_runtime_online tensor_runtime) target_link_libraries(tensor_runtime_online ${LINK_LIBS}) target_compile_definitions(tensor_runtime_online PRIVATE -DONLINE_PROFILING=true -DFP16_tuning=false) -# Adding new rule for building a cuDNN runtime library -#-- find_package(OpenMP REQUIRED) -#-- cuda_add_library(tensor_cpu_runtime tensor_runtime/src/tensor_cpu_runtime.cc) -#-- target_compile_options(tensor_cpu_runtime PRIVATE ${OpenMP_CXX_FLAGS}) -#-- target_link_libraries(tensor_cpu_runtime PRIVATE ${OpenMP_CXX_FLAGS}) -### TODO: Remove unsued CMake rules after careful consideration +# -------------- Unit Test Source ---------------- -# Adding rule for the debugging source add_executable(unit_tests dnn_sources/src/unit_tests.cc) target_link_libraries(unit_tests tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) -#**************** FP32 Source Builds *********** - -add_executable(lenet_mnist dnn_sources/src/lenet_mnist.cc) -target_link_libraries(lenet_mnist tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(alexnet_cifar10 dnn_sources/src/alexnet_cifar10.cc) -target_link_libraries(alexnet_cifar10 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(alexnet2_cifar10 dnn_sources/src/alexnet2_cifar10.cc) -target_link_libraries(alexnet2_cifar10 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(vgg16_cifar10 dnn_sources/src/vgg16_cifar10.cc) -target_link_libraries(vgg16_cifar10 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(resnet18_cifar10 dnn_sources/src/resnet18_cifar10.cc) -target_link_libraries(resnet18_cifar10 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(vgg16_cifar100 dnn_sources/src/vgg16_cifar100.cc) -target_link_libraries(vgg16_cifar100 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(mobilenet dnn_sources/src/mobilenet.cc) -target_link_libraries(mobilenet tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(mobilenet_shallow dnn_sources/src/mobilenet_shallow.cc) -target_link_libraries(mobilenet_shallow tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(resnet50_imagenet dnn_sources/src/resnet50_imagenet.cc) -target_link_libraries(resnet50_imagenet tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - - - - -#********* FP16 Source Builds ****** - -add_executable(lenet_half dnn_sources/src/half/lenet_mnist_half.cc) -target_link_libraries(lenet_half tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(alexnet_half dnn_sources/src/half/alexnet_cifar10_half.cc) -target_link_libraries(alexnet_half tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(alexnet2_half dnn_sources/src/half/alexnet2_cifar10_half.cc) -target_link_libraries(alexnet2_half tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(resnet18_half dnn_sources/src/half/resnet18_cifar10_half.cc) -target_link_libraries(resnet18_half tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(vgg16_cifar10_half dnn_sources/src/half/vgg16_cifar10_half.cc) -target_link_libraries(vgg16_cifar10_half tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(vgg16_cifar100_half dnn_sources/src/half/vgg16_cifar100_half.cc) -target_link_libraries(vgg16_cifar100_half tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(mobilenet_half dnn_sources/src/half/mobilenet_half.cc) -target_link_libraries(mobilenet_half tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(mobilenet_shallow_half dnn_sources/src/half/mobilenet_shallow_half.cc) -target_link_libraries(mobilenet_shallow_half tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - - - - -#********* Promise API sources - Used with the Autouner - -add_executable(lenet_promise dnn_sources/src/promise/lenet_promise.cc) -target_link_libraries(lenet_promise tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - - -add_executable(alexnet_promise dnn_sources/src/promise/alexnet_promise.cc) -target_link_libraries(alexnet_promise tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(alexnet2_promise dnn_sources/src/promise/alexnet2_promise.cc) -target_link_libraries(alexnet2_promise tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(resnet18_promise dnn_sources/src/promise/resnet18_promise.cc) -target_link_libraries(resnet18_promise tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(vgg16_cifar100_promise dnn_sources/src/promise/vgg16_cifar100_promise.cc) -target_link_libraries(vgg16_cifar100_promise tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(vgg16_cifar10_promise dnn_sources/src/promise/vgg16_cifar10_promise.cc) -target_link_libraries(vgg16_cifar10_promise tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(mobilenet_promise dnn_sources/src/promise/mobilenet_promise.cc) -target_link_libraries(mobilenet_promise tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(mobilenet_shallow_promise dnn_sources/src/promise/mobilenet_shallow_promise.cc) -target_link_libraries(mobilenet_shallow_promise tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - - -add_executable(vgg16_imagenet_promise dnn_sources/src/promise/vgg16_imagenet_promise.cc) -target_link_libraries(vgg16_imagenet_promise tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) - -add_executable(resnet50_imagenet_promise dnn_sources/src/promise/resnet50_imagenet_promise.cc) -target_link_libraries(resnet50_imagenet_promise tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +#**************** FP32 TensorRT Source Builds *********** +add_executable(lenet_mnist_fp32 dnn_sources/src/fp32/lenet_mnist.cc) +target_link_libraries(lenet_mnist_fp32 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(alexnet_cifar10_fp32 dnn_sources/src/fp32/alexnet_cifar10.cc) +target_link_libraries(alexnet_cifar10_fp32 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(alexnet2_cifar10_fp32 dnn_sources/src/fp32/alexnet2_cifar10.cc) +target_link_libraries(alexnet2_cifar10_fp32 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(vgg16_cifar10_fp32 dnn_sources/src/fp32/vgg16_cifar10.cc) +target_link_libraries(vgg16_cifar10_fp32 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(resnet18_cifar10_fp32 dnn_sources/src/fp32/resnet18_cifar10.cc) +target_link_libraries(resnet18_cifar10_fp32 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) -# OpenTuner Piped Sources -add_executable(alexnet_piped dnn_sources/src/promise/alexnet_piped.cc) -target_link_libraries(alexnet_piped tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(vgg16_cifar100_fp32 dnn_sources/src/fp32/vgg16_cifar100.cc) +target_link_libraries(vgg16_cifar100_fp32 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) -add_executable(alexnet2_piped dnn_sources/src/promise/alexnet2_piped.cc) -target_link_libraries(alexnet2_piped tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(mobilenet_cifar10_fp32 dnn_sources/src/fp32/mobilenet.cc) +target_link_libraries(mobilenet_cifar10_fp32 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) -add_executable(lenet_piped dnn_sources/src/promise/lenet_piped.cc) -target_link_libraries(lenet_piped tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(resnet50_imagenet_fp32 dnn_sources/src/fp32/resnet50_imagenet.cc) +target_link_libraries(resnet50_imagenet_fp32 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) -add_executable(resnet18_piped dnn_sources/src/promise/resnet18_piped.cc) -target_link_libraries(resnet18_piped tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) -add_executable(vgg16_cifar10_piped dnn_sources/src/promise/vgg16_cifar10_piped.cc) -target_link_libraries(vgg16_cifar10_piped tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) -add_executable(vgg16_cifar100_piped dnn_sources/src/promise/vgg16_cifar100_piped.cc) -target_link_libraries(vgg16_cifar100_piped tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) -add_executable(mobilenet_piped dnn_sources/src/promise/mobilenet_piped.cc) -target_link_libraries(mobilenet_piped tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +#********* FP16 TensorRT Source Builds ****** -add_executable(mobilenet_shallow_piped dnn_sources/src/promise/mobilenet_shallow_piped.cc) -target_link_libraries(mobilenet_shallow_piped tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(lenet_mnist_fp16 dnn_sources/src/fp16/lenet_mnist_half.cc) +target_link_libraries(lenet_mnist_fp16 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) -add_executable(vgg16_imagenet_piped dnn_sources/src/promise/vgg16_imagenet_piped.cc) -target_link_libraries(vgg16_imagenet_piped tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(alexnet_cifar10_fp16 dnn_sources/src/fp16/alexnet_cifar10_half.cc) +target_link_libraries(alexnet_cifar10_fp16 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) -add_executable(resnet50_imagenet_piped dnn_sources/src/promise/resnet50_imagenet_piped.cc) -target_link_libraries(resnet50_imagenet_piped tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(alexnet2_cifar10_fp16 dnn_sources/src/fp16/alexnet2_cifar10_half.cc) +target_link_libraries(alexnet2_cifar10_fp16 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(resnet18_cifar10_fp16 dnn_sources/src/fp16/resnet18_cifar10_half.cc) +target_link_libraries(resnet18_cifar10_fp16 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(vgg16_cifar10_fp16 dnn_sources/src/fp16/vgg16_cifar10_half.cc) +target_link_libraries(vgg16_cifar10_fp16 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) +add_executable(vgg16_cifar100_fp16 dnn_sources/src/fp16/vgg16_cifar100_half.cc) +target_link_libraries(vgg16_cifar100_fp16 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) -#### Image Processing Benchmarks +add_executable(mobilenet_cifar10_fp16 dnn_sources/src/fp16/mobilenet_half.cc) +target_link_libraries(mobilenet_cifar10_fp16 tensor_runtime_online ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) -add_executable(alexnet2_canny dnn_sources/src/alexnet2_canny.cc) -target_link_libraries(alexnet2_canny tensor_runtime ${GPU_PROFILER_LIB} ${SOC_SIMULATOR_LIB}) diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/alexnet2_cifar10_half.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/alexnet2_cifar10_half.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/alexnet2_cifar10_half.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/alexnet2_cifar10_half.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/alexnet_cifar10_half.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/alexnet_cifar10_half.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/alexnet_cifar10_half.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/alexnet_cifar10_half.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/lenet_mnist_half.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/lenet_mnist_half.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/lenet_mnist_half.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/lenet_mnist_half.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/mobilenet_half.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/mobilenet_half.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/mobilenet_half.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/mobilenet_half.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/mobilenet_shallow_half.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/mobilenet_shallow_half.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/mobilenet_shallow_half.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/mobilenet_shallow_half.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/alexnet2_cifar10_half_profiling.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/alexnet2_cifar10_half_profiling.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/alexnet2_cifar10_half_profiling.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/alexnet2_cifar10_half_profiling.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/alexnet_cifar10_half_profiling.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/alexnet_cifar10_half_profiling.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/alexnet_cifar10_half_profiling.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/alexnet_cifar10_half_profiling.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/lenet_keras_half_profiling.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/lenet_keras_half_profiling.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/lenet_keras_half_profiling.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/lenet_keras_half_profiling.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/mobilenet_depthwise_half_profiling.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/mobilenet_depthwise_half_profiling.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/mobilenet_depthwise_half_profiling.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/mobilenet_depthwise_half_profiling.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/mobilenet_half_cifar10_profiling.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/mobilenet_half_cifar10_profiling.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/mobilenet_half_cifar10_profiling.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/mobilenet_half_cifar10_profiling.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/mobilenet_shallow_depthwise_half_profiling.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/mobilenet_shallow_depthwise_half_profiling.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/mobilenet_shallow_depthwise_half_profiling.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/mobilenet_shallow_depthwise_half_profiling.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/mobilenet_shallow_half_profiling.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/mobilenet_shallow_half_profiling.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/mobilenet_shallow_half_profiling.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/mobilenet_shallow_half_profiling.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/resnet18_cifar10_half_profiling.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/resnet18_cifar10_half_profiling.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/resnet18_cifar10_half_profiling.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/resnet18_cifar10_half_profiling.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/vgg16_cifar100_half_profiling.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/vgg16_cifar100_half_profiling.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/vgg16_cifar100_half_profiling.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/vgg16_cifar100_half_profiling.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/vgg16_cifar10_half_profiling.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/vgg16_cifar10_half_profiling.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/profiling/vgg16_cifar10_half_profiling.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/profiling/vgg16_cifar10_half_profiling.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/resnet18_cifar10_half.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/resnet18_cifar10_half.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/resnet18_cifar10_half.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/resnet18_cifar10_half.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/vgg16_cifar100_half.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/vgg16_cifar100_half.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/vgg16_cifar100_half.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/vgg16_cifar100_half.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/vgg16_cifar10_half.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/vgg16_cifar10_half.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/half/vgg16_cifar10_half.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp16/vgg16_cifar10_half.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/alexnet2_canny.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/alexnet2_canny.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/alexnet2_canny.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/alexnet2_canny.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/alexnet2_cifar10.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/alexnet2_cifar10.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/alexnet2_cifar10.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/alexnet2_cifar10.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/alexnet_cifar10.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/alexnet_cifar10.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/alexnet_cifar10.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/alexnet_cifar10.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/alexnet_imagenet.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/alexnet_imagenet.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/alexnet_imagenet.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/alexnet_imagenet.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/lenet_mnist.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/lenet_mnist.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/lenet_mnist.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/lenet_mnist.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/mobilenet.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/mobilenet.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/mobilenet.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/mobilenet.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/mobilenet_shallow.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/mobilenet_shallow.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/mobilenet_shallow.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/mobilenet_shallow.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/resnet18_cifar10.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/resnet18_cifar10.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/resnet18_cifar10.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/resnet18_cifar10.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/resnet50_imagenet.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/resnet50_imagenet.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/resnet50_imagenet.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/resnet50_imagenet.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/vgg16_cifar10.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/vgg16_cifar10.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/vgg16_cifar10.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/vgg16_cifar10.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/vgg16_cifar100.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/vgg16_cifar100.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/vgg16_cifar100.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/vgg16_cifar100.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/vgg16_cifar100_5.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/vgg16_cifar100_5.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/vgg16_cifar100_5.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/vgg16_cifar100_5.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/vgg16_imagenet.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/vgg16_imagenet.cc similarity index 100% rename from hpvm/projects/hpvm-tensor-rt/dnn_sources/src/vgg16_imagenet.cc rename to hpvm/projects/hpvm-tensor-rt/dnn_sources/src/fp32/vgg16_imagenet.cc diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet2_piped.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet2_piped.cc deleted file mode 100644 index 653d2e7bdf..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet2_piped.cc +++ /dev/null @@ -1,172 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 500; - int offset = 5000; - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - llvm_hpvm_initTensorRt(0); - - std::string dir_prefix = std::string("../model_params/alexnet2_cifar10/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,32,3,3,3); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,32,32,3,3); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,64,32,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,128,64,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,128,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,2048,10); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,10,1,1); - - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - // NOTE: Wait on signal from OpenTuner - stallOnOpenTunerSignal(); - - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - for(int i = 0; i < batch_count; i++){ - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.8816435, 2.0934134, conv2d_1_w, -0.5421946, 0.3710851, conv2d_1_b, -0.06697306, 0.040868897, 1, 1, 1, 1, -1, 0, 0, -0.9998477, 0.99987465, 9); - // void* var_1 = ConvLayer_PROMISE(var_0, -0.9998477, 0.99987465, conv2d_2_w, -0.42474225, 0.31460348, conv2d_2_b, -0.3557253, -0.17281663, 1, 1, 1, 1, 0, 2, 0, -0.99997115, 1.0, 9); - void* var_1 = ConvLayer_PROMISE(var_0, -0.8, 0.8, conv2d_2_w, -0.42474225, 0.31460348, conv2d_2_b, -0.3557253, -0.17281663, 1, 1, 1, 1, 0, 2, 0, -0.99997115, 1.0, 9); - - void* var_2 = ConvLayer_PROMISE(var_1, -0.99997115, 1.0, conv2d_3_w, -0.44134507, 0.79587924, conv2d_3_b, -0.80424446, 0.75330096, 1, 1, 1, 1, -1, 0, 0, -0.9999999, 1.0, 9); - void* var_3 = ConvLayer_PROMISE(var_2, -0.9999999, 1.0, conv2d_4_w, -0.2883836, 0.31025785, conv2d_4_b, -0.6353164, 0.29015934, 1, 1, 1, 1, 0, 2, 0, -0.9999999, 0.99999934, 9); - void* var_4 = ConvLayer_PROMISE(var_3, -0.9999999, 0.99999934, conv2d_5_w, -0.2792431, 0.37689754, conv2d_5_b, -1.1379756, 1.2391574, 1, 1, 1, 1, -1, 0, 0, -1.0, 1.0, 9); - void* var_5 = ConvLayer_PROMISE(var_4, -1.0, 1.0, conv2d_6_w, -0.27078503, 0.27942517, conv2d_6_b, -0.503003, 0.12762362, 1, 1, 1, 1, 0, 2, 0, -0.9999941, 0.9999964, 9); - void* var_6 = FCLayer_PROMISE(var_5, -0.9999941, 0.9999964, dense_1_w, -0.24273404, 0.5845544, dense_1_b, -0.53745, 0.558251, -1, -140.6419, 16.402884, 9); - void* var_7 = tensorSoftmax(var_6); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_7); - final_accuracy += accuracy; - - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_7, classConfs, predictedLabels, relative_start, relative_end); - } - - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - - // NOTE: Signal back to OpenTuner - signalPipeToOpenTuner(); - } - - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet2_promise.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet2_promise.cc deleted file mode 100644 index ab3a20dfaf..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet2_promise.cc +++ /dev/null @@ -1,167 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 1000; - int offset = 5000; - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - llvm_hpvm_initTensorRt(0); - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - - std::string dir_prefix = std::string("../model_params/alexnet2_cifar10/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - - for(int i = 0; i < batch_count; i++){ - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,32,3,3,3); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,32,32,3,3); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,64,32,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,128,64,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,128,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,2048,10); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,10,1,1); - - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.8816435, 2.0934134, conv2d_1_w, -0.5421946, 0.3710851, conv2d_1_b, -0.06697306, 0.040868897, 1, 1, 1, 1, -1, 0, 0, -0.9998477, 0.99987465, 9); - // void* var_1 = ConvLayer_PROMISE(var_0, -0.9998477, 0.99987465, conv2d_2_w, -0.42474225, 0.31460348, conv2d_2_b, -0.3557253, -0.17281663, 1, 1, 1, 1, 0, 2, 0, -0.99997115, 1.0, 9); - void* var_1 = ConvLayer_PROMISE(var_0, -0.8, 0.8, conv2d_2_w, -0.42474225, 0.31460348, conv2d_2_b, -0.3557253, -0.17281663, 1, 1, 1, 1, 0, 2, 0, -0.99997115, 1.0, 9); - - void* var_2 = ConvLayer_PROMISE(var_1, -0.99997115, 1.0, conv2d_3_w, -0.44134507, 0.79587924, conv2d_3_b, -0.80424446, 0.75330096, 1, 1, 1, 1, -1, 0, 0, -0.9999999, 1.0, 9); - void* var_3 = ConvLayer_PROMISE(var_2, -0.9999999, 1.0, conv2d_4_w, -0.2883836, 0.31025785, conv2d_4_b, -0.6353164, 0.29015934, 1, 1, 1, 1, 0, 2, 0, -0.9999999, 0.99999934, 9); - void* var_4 = ConvLayer_PROMISE(var_3, -0.9999999, 0.99999934, conv2d_5_w, -0.2792431, 0.37689754, conv2d_5_b, -1.1379756, 1.2391574, 1, 1, 1, 1, -1, 0, 0, -1.0, 1.0, 9); - void* var_5 = ConvLayer_PROMISE(var_4, -1.0, 1.0, conv2d_6_w, -0.27078503, 0.27942517, conv2d_6_b, -0.503003, 0.12762362, 1, 1, 1, 1, 0, 2, 0, -0.9999941, 0.9999964, 9); - void* var_6 = FCLayer_PROMISE(var_5, -0.9999941, 0.9999964, dense_1_w, -0.24273404, 0.5845544, dense_1_b, -0.53745, 0.558251, -1, -140.6419, 16.402884, 9); - void* var_7 = tensorSoftmax(var_6); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_7); - final_accuracy += accuracy; - - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_7, classConfs, predictedLabels, relative_start, relative_end); - } - - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - } - - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_imagenet_piped.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_imagenet_piped.cc deleted file mode 100644 index da2331c965..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_imagenet_piped.cc +++ /dev/null @@ -1,106 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int main(){ - - llvm_hpvm_initTensorRt(1); - - int total_runs = 1; - for (int i = 0 ; i < total_runs; i++){ - - // NOTE: Wait on signal from OpenTuner - stallOnOpenTunerSignal(); - - startMemTracking(); - - int test_input_size = 5000; - int batch_size = 200; - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - for(int i = 0; i < batch_count; i++){ - - std::string dir_prefix = std::string("/shared/hsharif3/alexnet_imagenet_tune/"); - std::string input_path = dir_prefix + std::string("tune_input.bin"); - std::string labels_path = dir_prefix + std::string("tune_labels.bin"); - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,11,11); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,192,64,5,5); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,192,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,384,192,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,384,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,256,384,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,9216,4096); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,4096,1,1); - std::string dense_2_w_path = dir_prefix + std::string("dense_2_w.bin"); - void* dense_2_w = readTrainedWeights(dense_2_w_path.c_str(), 0,1,1,4096,4096); - std::string dense_2_b_path = dir_prefix + std::string("dense_2_b.bin"); - void* dense_2_b = readTrainedWeights(dense_2_b_path.c_str(), 0,1,4096,1,1); - std::string dense_3_w_path = dir_prefix + std::string("dense_3_w.bin"); - void* dense_3_w = readTrainedWeights(dense_3_w_path.c_str(), 0,1,1,4096,1000); - std::string dense_3_b_path = dir_prefix + std::string("dense_3_b.bin"); - void* dense_3_b = readTrainedWeights(dense_3_b_path.c_str(), 0,1,1000,1,1); - - - int start = i * batch_size; - int end = (i + 1) * batch_size; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,224,224); - - void* var_0 = ConvLayer_PROMISE2(input, 0.0, 255.0, conv2d_1_w, -0.5503702693581581, 0.5811487324237921, conv2d_1_b, -2.802485, 1.648145, 2, 2, 4, 4, 0, 3, 2, 1, 0.0, 1572.3096923828125, 9); - void* var_1 = ConvLayer_PROMISE2(var_0, 0.0, 1572.3096923828125, conv2d_2_w, -0.2867645202279091, 0.26272463005783797, conv2d_2_b, -0.47985682, 0.501206, 2, 2, 1, 1, 0, 3, 2, 1, 0.0, 3183.7813264160477, 9); - void* var_2 = ConvLayer_PROMISE(var_1, 0.0, 3183.7813264160477, conv2d_3_w, -0.16606662392616273, 0.15785247704386754, conv2d_3_b, -0.42038992, 0.5545839, 1, 1, 1, 1, -1, 0, 1, 0.0, 1765.4451872558668, 9); - void* var_3 = ConvLayer_PROMISE(var_2, 0.0, 1765.4451872558668, conv2d_4_w, -0.10464580833911895, 0.11035470351576919, conv2d_4_b, -1.4275751, 0.9042998, 1, 1, 1, 1, -1, 0, 1, 0.0, 1345.5418548586083, 9); - void* var_4 = ConvLayer_PROMISE2(var_3, 0.0, 1345.5418548586083, conv2d_5_w, -0.09240880391001702, 0.10250756608694818, conv2d_5_b, -0.45662758, 2.4040315, 1, 1, 1, 1, 0, 3, 2, 1, 0.0, 1227.3563232421875, 9); - void* var_5 = FCLayer_PROMISE(var_4, 0.0, 1227.3563232421875, dense_1_w, -0.030517672039568428, 0.02963459612801672, dense_1_b, -0.07124679, 0.09377053, 1, 0.0, 1034.5966391601676, 9); - void* var_6 = FCLayer_PROMISE(var_5, 0.0, 1034.5966391601676, dense_2_w, -0.038392101023346184, 0.039147199764847845, dense_2_b, -0.050027702, 0.1841282, 1, 0.0, 839.0697069702154, 9); - void* var_7 = FCLayer_PROMISE(var_6, 0.0, 839.0697069702154, dense_3_w, -0.05494491942599416, 0.08549865524470925, dense_3_b, -0.16314922, 0.15416704, -1, -608.3993963623047, 1082.8444653320819, 9); - void* var_8 = tensorSoftmax(var_7); - - uint32_t* labels = readLabelsBatch3(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy3(labels, var_8); - final_accuracy += accuracy; - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - - // NOTE: Signal back to OpenTuner - signalPipeToOpenTuner(); - } - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_imagenet_promise.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_imagenet_promise.cc deleted file mode 100644 index c848c8614d..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_imagenet_promise.cc +++ /dev/null @@ -1,102 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int main(){ - - llvm_hpvm_initTensorRt(1); - - int total_runs = 1; - for (int i = 0 ; i < total_runs; i++){ - - - startMemTracking(); - - int test_input_size = 5000; - int batch_size = 200; - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - for(int i = 0; i < batch_count; i++){ - - std::string dir_prefix = std::string("/shared/hsharif3/alexnet_imagenet_tune/"); - std::string input_path = dir_prefix + std::string("tune_input.bin"); - std::string labels_path = dir_prefix + std::string("tune_labels.bin"); - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,11,11); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,192,64,5,5); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,192,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,384,192,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,384,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,256,384,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,9216,4096); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,4096,1,1); - std::string dense_2_w_path = dir_prefix + std::string("dense_2_w.bin"); - void* dense_2_w = readTrainedWeights(dense_2_w_path.c_str(), 0,1,1,4096,4096); - std::string dense_2_b_path = dir_prefix + std::string("dense_2_b.bin"); - void* dense_2_b = readTrainedWeights(dense_2_b_path.c_str(), 0,1,4096,1,1); - std::string dense_3_w_path = dir_prefix + std::string("dense_3_w.bin"); - void* dense_3_w = readTrainedWeights(dense_3_w_path.c_str(), 0,1,1,4096,1000); - std::string dense_3_b_path = dir_prefix + std::string("dense_3_b.bin"); - void* dense_3_b = readTrainedWeights(dense_3_b_path.c_str(), 0,1,1000,1,1); - - - int start = i * batch_size; - int end = (i + 1) * batch_size; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,224,224); - - void* var_0 = ConvLayer_PROMISE2(input, 0.0, 255.0, conv2d_1_w, -0.5503702693581581, 0.5811487324237921, conv2d_1_b, -2.802485, 1.648145, 2, 2, 4, 4, 0, 3, 2, 1, 0.0, 1572.3096923828125, 9); - void* var_1 = ConvLayer_PROMISE2(var_0, 0.0, 1572.3096923828125, conv2d_2_w, -0.2867645202279091, 0.26272463005783797, conv2d_2_b, -0.47985682, 0.501206, 2, 2, 1, 1, 0, 3, 2, 1, 0.0, 3183.7813264160477, 9); - void* var_2 = ConvLayer_PROMISE(var_1, 0.0, 3183.7813264160477, conv2d_3_w, -0.16606662392616273, 0.15785247704386754, conv2d_3_b, -0.42038992, 0.5545839, 1, 1, 1, 1, -1, 0, 1, 0.0, 1765.4451872558668, 9); - void* var_3 = ConvLayer_PROMISE(var_2, 0.0, 1765.4451872558668, conv2d_4_w, -0.10464580833911895, 0.11035470351576919, conv2d_4_b, -1.4275751, 0.9042998, 1, 1, 1, 1, -1, 0, 1, 0.0, 1345.5418548586083, 9); - void* var_4 = ConvLayer_PROMISE2(var_3, 0.0, 1345.5418548586083, conv2d_5_w, -0.09240880391001702, 0.10250756608694818, conv2d_5_b, -0.45662758, 2.4040315, 1, 1, 1, 1, 0, 3, 2, 1, 0.0, 1227.3563232421875, 9); - void* var_5 = FCLayer_PROMISE(var_4, 0.0, 1227.3563232421875, dense_1_w, -0.030517672039568428, 0.02963459612801672, dense_1_b, -0.07124679, 0.09377053, 1, 0.0, 1034.5966391601676, 9); - void* var_6 = FCLayer_PROMISE(var_5, 0.0, 1034.5966391601676, dense_2_w, -0.038392101023346184, 0.039147199764847845, dense_2_b, -0.050027702, 0.1841282, 1, 0.0, 839.0697069702154, 9); - void* var_7 = FCLayer_PROMISE(var_6, 0.0, 839.0697069702154, dense_3_w, -0.05494491942599416, 0.08549865524470925, dense_3_b, -0.16314922, 0.15416704, -1, -608.3993963623047, 1082.8444653320819, 9); - void* var_8 = tensorSoftmax(var_7); - - uint32_t* labels = readLabelsBatch3(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy3(labels, var_8); - final_accuracy += accuracy; - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - - } - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_piped.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_piped.cc deleted file mode 100644 index 22fe979cb5..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_piped.cc +++ /dev/null @@ -1,167 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 500; - int offset = 5000; - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - llvm_hpvm_initTensorRt(0); - - - std::string dir_prefix = std::string("../model_params/alexnet_cifar10/"); - //std::string dir_prefix = std::string("../model_params/alexnet_cifar10_test/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,11,11); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,192,64,5,5); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,192,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,384,192,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,384,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,256,384,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,4096,10); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,10,1,1); - - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - // NOTE: Wait on signal from OpenTuner - stallOnOpenTunerSignal(); - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - for(int i = 0; i < batch_count; i++){ - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.8816426241908337, 2.0934095498544254, conv2d_1_w, -0.33087718, 0.3323643, conv2d_1_b, -0.7782218, 0.6020472, 5, 5, 1, 1, 0, 2, 0, -0.978641152381897, 0.9989452958106995, 9); - void* var_1 = ConvLayer_PROMISE(var_0, -0.978641152381897, 0.9989452958106995, conv2d_2_w, -0.2095158, 0.33543423, conv2d_2_b, -0.45020863, 0.30596754, 2, 2, 1, 1, 0, 2, 0, -0.9997039437294006, 0.999930202960968, 9); - void* var_2 = ConvLayer_PROMISE(var_1, -0.9997039437294006, 0.999930202960968, conv2d_3_w, -0.1715614, 0.17037082, conv2d_3_b, -0.6519161, 0.5939945, 1, 1, 1, 1, -1, 0, 0, -0.9999336004257202, 0.999940037727356, 9); - void* var_3 = ConvLayer_PROMISE(var_2, -0.9999336004257202, 0.999940037727356, conv2d_4_w, -0.15575546, 0.14456555, conv2d_4_b, -0.55873865, 0.4704539, 1, 1, 1, 1, -1, 0, 0, -0.9999991059303284, 0.9999993443489075, 9); - void* var_4 = ConvLayer_PROMISE(var_3, -0.9999991059303284, 0.9999993443489075, conv2d_5_w, -0.16108225, 0.16864482, conv2d_5_b, -0.22135437, 0.10401678, 1, 1, 1, 1, 0, 2, 0, -0.9994344115257263, 0.9996342062950134, 9); - void* var_5 = FCLayer_PROMISE(var_4, -0.9994344115257263, 0.9996342062950134, dense_1_w, -0.18183032, 0.19018902, dense_1_b, -0.07189204, 0.106005594, -1, -15.076565380096437, 19.422585220336913, 9); - void* var_6 = tensorSoftmax(var_5); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_6); - final_accuracy += accuracy; - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_6, classConfs, predictedLabels, relative_start, relative_end); - } - - - freeBatchMemory(); - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - - // NOTE: Signal back to OpenTuner - signalPipeToOpenTuner(); - } - - dumpExecutionAccuracies(); - - - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} - diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_promise.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_promise.cc deleted file mode 100644 index c67eb1153e..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/alexnet_promise.cc +++ /dev/null @@ -1,160 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 1000; - int offset = 5000; - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - llvm_hpvm_initTensorRt(1); - - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - std::string dir_prefix = std::string("../model_params/alexnet_cifar10/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - for(int i = 0; i < batch_count; i++){ - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,11,11); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,192,64,5,5); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,192,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,384,192,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,384,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,256,384,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,4096,10); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,10,1,1); - - - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.8816426241908337, 2.0934095498544254, conv2d_1_w, -0.33087718, 0.3323643, conv2d_1_b, -0.7782218, 0.6020472, 5, 5, 1, 1, 0, 2, 0, -0.978641152381897, 0.9989452958106995, 9); - void* var_1 = ConvLayer_PROMISE(var_0, -0.978641152381897, 0.9989452958106995, conv2d_2_w, -0.2095158, 0.33543423, conv2d_2_b, -0.45020863, 0.30596754, 2, 2, 1, 1, 0, 2, 0, -0.9997039437294006, 0.999930202960968, 9); - void* var_2 = ConvLayer_PROMISE(var_1, -0.9997039437294006, 0.999930202960968, conv2d_3_w, -0.1715614, 0.17037082, conv2d_3_b, -0.6519161, 0.5939945, 1, 1, 1, 1, -1, 0, 0, -0.9999336004257202, 0.999940037727356, 9); - void* var_3 = ConvLayer_PROMISE(var_2, -0.9999336004257202, 0.999940037727356, conv2d_4_w, -0.15575546, 0.14456555, conv2d_4_b, -0.55873865, 0.4704539, 1, 1, 1, 1, -1, 0, 0, -0.9999991059303284, 0.9999993443489075, 9); - void* var_4 = ConvLayer_PROMISE(var_3, -0.9999991059303284, 0.9999993443489075, conv2d_5_w, -0.16108225, 0.16864482, conv2d_5_b, -0.22135437, 0.10401678, 1, 1, 1, 1, 0, 2, 0, -0.9994344115257263, 0.9996342062950134, 9); - void* var_5 = FCLayer_PROMISE(var_4, -0.9994344115257263, 0.9996342062950134, dense_1_w, -0.18183032, 0.19018902, dense_1_b, -0.07189204, 0.106005594, -1, -15.076565380096437, 19.422585220336913, 9); - void* var_6 = tensorSoftmax(var_5); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_6); - final_accuracy += accuracy; - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_6, classConfs, predictedLabels, relative_start, relative_end); - } - - - freeBatchMemory(); - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - } - - dumpExecutionAccuracies(); - - - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} - diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/lenet_piped.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/lenet_piped.cc deleted file mode 100644 index c246822a09..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/lenet_piped.cc +++ /dev/null @@ -1,175 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> - -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - -int test_input_size = 5000; -int batch_size = 5000; -int offset = 5000; - - -bool shouldDumpClassConf = false; -float* classConfs; -int* predictedLabels; - - - -/* NOTE: Reference Architecture to use for profiling */ -void testLenetTanh(){ - - printf("********* Lenet-5 Architecture ********** \n"); - - std::string dir_prefix = std::string("../model_params/lenet_mnist/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - - // Loading Weights - void* conv1_filter = readTrainedWeights("../model_params/lenet_mnist/conv1.bin", - float_type, 32, 1, 5, 5); - void* conv1_bias = readTrainedWeights("../model_params/lenet_mnist/conv1_bias.bin", - float_type, 1, 32, 1, 1); - void* conv2_filter = readTrainedWeights("../model_params/lenet_mnist/conv2.bin", - float_type, 64, 32, 5, 5); - void* conv2_bias = readTrainedWeights("../model_params/lenet_mnist/conv2_bias.bin", - float_type, 1, 64, 1, 1); - void* fc1_weights = readTrainedWeights("../model_params/lenet_mnist/fc1.bin", - float_type, 1, 1, 7*7*64, 1024); - void* fc1_bias = readTrainedWeights("../model_params/lenet_mnist/fc1_bias.bin", - float_type, 1, 1024, 1, 1); - void* fc2_weights = readTrainedWeights("../model_params/lenet_mnist/fc2.bin", - float_type, 1, 1, 1024, 10); - void* fc2_bias = readTrainedWeights("../model_params/lenet_mnist/fc2_bias.bin", - float_type, 1, 10, 1, 1); - - clearTensorMap(); - - int missed = 0; - for(int i = 0; i < total_runs; i++){ - - // NOTE: Wait on signal from OpenTuner - stallOnOpenTunerSignal(); - - - if (missed >= to_skip){ - break; - } - - - int start = offset; - int end = batch_size + offset; - - // Loading Input Batch - void* input = readInputBatch(input_path.c_str(),0,start,end,1,28,28); - - // Loading Weights - - // DNN Operations - void* conv1_out = ConvLayer_PROMISE(input, 0,1, conv1_filter, -1,1, conv1_bias, -1,1, - 2, 2, 1, 1, 0, 2, 0, -1,1, 9); - void* conv2_out = ConvLayer_PROMISE(conv1_out, -1,1, conv2_filter, -1,1, - conv2_bias, -1,1, - 2, 2, 1, 1, 0, 2, 0, -1,1, 9); - - void* fc1_out = FCLayer_PROMISE(conv2_out, -1,1, fc1_weights, -1,1, fc1_bias, -1,1, - 0, -1,1, 9); - void* fc2_out = FCLayer_PROMISE(fc1_out, -1,1, fc2_weights, -1,1, fc2_bias, -1,1, - 0, -1,1, 9); - - void* result = tensorSoftmax(fc2_out); - - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, result); - - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(result, classConfs, predictedLabels, relative_start, relative_end); - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - - freeOutputTensors(); - - dumpFinalAccuracy(accuracy); - - if (accuracy < bench_acc) - missed += 1; - - // NOTE: Signal back to OpenTuner - signalPipeToOpenTuner(); - - } - - dumpExecutionAccuracies(); -} - - -int main(int argc, char* argv[]){ - - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - batch_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - - llvm_hpvm_initTensorRt(0); - - - testLenetTanh(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; -} - - - - diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/lenet_promise.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/lenet_promise.cc deleted file mode 100644 index e1428589c3..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/lenet_promise.cc +++ /dev/null @@ -1,167 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> - -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - -int test_input_size = 5000; -int batch_size = 5000; -int offset = 5000; - - -bool shouldDumpClassConf = false; -float* classConfs; -int* predictedLabels; - - - -/* NOTE: Reference Architecture to use for profiling */ -void testLenetTanh(){ - - printf("********* Lenet-5 Architecture ********** \n"); - - std::string dir_prefix = std::string("../model_params/lenet_mnist/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - - int missed = 0; - for(int i = 0; i < total_runs; i++){ - - if (missed >= to_skip){ - break; - } - - int start = offset; - int end = batch_size + offset; - - - startMemTracking(); - - // Loading Input Batch - void* input = readInputBatch(input_path.c_str(),0,start,end,1,28,28); - - // Loading Weights - void* conv1_filter = readTrainedWeights("../model_params/lenet_mnist/conv1.bin", - float_type, 32, 1, 5, 5); - void* conv1_bias = readTrainedWeights("../model_params/lenet_mnist/conv1_bias.bin", - float_type, 1, 32, 1, 1); - void* conv2_filter = readTrainedWeights("../model_params/lenet_mnist/conv2.bin", - float_type, 64, 32, 5, 5); - void* conv2_bias = readTrainedWeights("../model_params/lenet_mnist/conv2_bias.bin", - float_type, 1, 64, 1, 1); - void* fc1_weights = readTrainedWeights("../model_params/lenet_mnist/fc1.bin", - float_type, 1, 1, 7*7*64, 1024); - void* fc1_bias = readTrainedWeights("../model_params/lenet_mnist/fc1_bias.bin", - float_type, 1, 1024, 1, 1); - void* fc2_weights = readTrainedWeights("../model_params/lenet_mnist/fc2.bin", - float_type, 1, 1, 1024, 10); - void* fc2_bias = readTrainedWeights("../model_params/lenet_mnist/fc2_bias.bin", - float_type, 1, 10, 1, 1); - - - // DNN Operations - void* conv1_out = ConvLayer_PROMISE(input, 0,1, conv1_filter, -1,1, conv1_bias, -1,1, - 2, 2, 1, 1, 0, 2, 0, -1,1, 9); - void* conv2_out = ConvLayer_PROMISE(conv1_out, -1,1, conv2_filter, -1,1, - conv2_bias, -1,1, - 2, 2, 1, 1, 0, 2, 0, -1,1, 9); - - void* fc1_out = FCLayer_PROMISE(conv2_out, -1,1, fc1_weights, -1,1, fc1_bias, -1,1, - 0, -1,1, 9); - void* fc2_out = FCLayer_PROMISE(fc1_out, -1,1, fc2_weights, -1,1, fc2_bias, -1,1, - 0, -1,1, 9); - - void* result = tensorSoftmax(fc2_out); - - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, result); - - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(result, classConfs, predictedLabels, relative_start, relative_end); - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - - freeBatchMemory(); - - dumpFinalAccuracy(accuracy); - - - if (accuracy < bench_acc) - missed += 1; - - } - - dumpExecutionAccuracies(); -} - - -int main(int argc, char* argv[]){ - - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - batch_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - - llvm_hpvm_initTensorRt(1); - - testLenetTanh(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; -} - - - - diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_piped.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_piped.cc deleted file mode 100644 index 8444e512f5..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_piped.cc +++ /dev/null @@ -1,492 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 500; - int offset = 5000; - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - llvm_hpvm_initTensorRt(0); - - - std::string dir_prefix = std::string("../model_params/mobilenet/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,32,3,3,3); - std::string batch_normalization_1_gamma_path = dir_prefix + std::string("batch_normalization_1_gamma.bin"); - void* batch_normalization_1_gamma = readTrainedWeights(batch_normalization_1_gamma_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_1_beta_path = dir_prefix + std::string("batch_normalization_1_beta.bin"); - void* batch_normalization_1_beta = readTrainedWeights(batch_normalization_1_beta_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_1_mean_path = dir_prefix + std::string("batch_normalization_1_mean.bin"); - void* batch_normalization_1_mean = readTrainedWeights(batch_normalization_1_mean_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_1_variance_path = dir_prefix + std::string("batch_normalization_1_variance.bin"); - void* batch_normalization_1_variance = readTrainedWeights(batch_normalization_1_variance_path.c_str(), 0,1,32,1,1); - std::string depthwise_conv2d_1_w_path = dir_prefix + std::string("depthwise_conv2d_1_w.bin"); - void* depthwise_conv2d_1_w = readTrainedWeights(depthwise_conv2d_1_w_path.c_str(), 0,32,1,3,3); - std::string batch_normalization_2_gamma_path = dir_prefix + std::string("batch_normalization_2_gamma.bin"); - void* batch_normalization_2_gamma = readTrainedWeights(batch_normalization_2_gamma_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_2_beta_path = dir_prefix + std::string("batch_normalization_2_beta.bin"); - void* batch_normalization_2_beta = readTrainedWeights(batch_normalization_2_beta_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_2_mean_path = dir_prefix + std::string("batch_normalization_2_mean.bin"); - void* batch_normalization_2_mean = readTrainedWeights(batch_normalization_2_mean_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_2_variance_path = dir_prefix + std::string("batch_normalization_2_variance.bin"); - void* batch_normalization_2_variance = readTrainedWeights(batch_normalization_2_variance_path.c_str(), 0,1,32,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,32,1,1); - std::string batch_normalization_3_gamma_path = dir_prefix + std::string("batch_normalization_3_gamma.bin"); - void* batch_normalization_3_gamma = readTrainedWeights(batch_normalization_3_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_beta_path = dir_prefix + std::string("batch_normalization_3_beta.bin"); - void* batch_normalization_3_beta = readTrainedWeights(batch_normalization_3_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_mean_path = dir_prefix + std::string("batch_normalization_3_mean.bin"); - void* batch_normalization_3_mean = readTrainedWeights(batch_normalization_3_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_variance_path = dir_prefix + std::string("batch_normalization_3_variance.bin"); - void* batch_normalization_3_variance = readTrainedWeights(batch_normalization_3_variance_path.c_str(), 0,1,64,1,1); - std::string depthwise_conv2d_2_w_path = dir_prefix + std::string("depthwise_conv2d_2_w.bin"); - void* depthwise_conv2d_2_w = readTrainedWeights(depthwise_conv2d_2_w_path.c_str(), 0,64,1,3,3); - std::string batch_normalization_4_gamma_path = dir_prefix + std::string("batch_normalization_4_gamma.bin"); - void* batch_normalization_4_gamma = readTrainedWeights(batch_normalization_4_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_4_beta_path = dir_prefix + std::string("batch_normalization_4_beta.bin"); - void* batch_normalization_4_beta = readTrainedWeights(batch_normalization_4_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_4_mean_path = dir_prefix + std::string("batch_normalization_4_mean.bin"); - void* batch_normalization_4_mean = readTrainedWeights(batch_normalization_4_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_4_variance_path = dir_prefix + std::string("batch_normalization_4_variance.bin"); - void* batch_normalization_4_variance = readTrainedWeights(batch_normalization_4_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,128,64,1,1); - std::string batch_normalization_5_gamma_path = dir_prefix + std::string("batch_normalization_5_gamma.bin"); - void* batch_normalization_5_gamma = readTrainedWeights(batch_normalization_5_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_5_beta_path = dir_prefix + std::string("batch_normalization_5_beta.bin"); - void* batch_normalization_5_beta = readTrainedWeights(batch_normalization_5_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_5_mean_path = dir_prefix + std::string("batch_normalization_5_mean.bin"); - void* batch_normalization_5_mean = readTrainedWeights(batch_normalization_5_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_5_variance_path = dir_prefix + std::string("batch_normalization_5_variance.bin"); - void* batch_normalization_5_variance = readTrainedWeights(batch_normalization_5_variance_path.c_str(), 0,1,128,1,1); - std::string depthwise_conv2d_3_w_path = dir_prefix + std::string("depthwise_conv2d_3_w.bin"); - void* depthwise_conv2d_3_w = readTrainedWeights(depthwise_conv2d_3_w_path.c_str(), 0,128,1,3,3); - std::string batch_normalization_6_gamma_path = dir_prefix + std::string("batch_normalization_6_gamma.bin"); - void* batch_normalization_6_gamma = readTrainedWeights(batch_normalization_6_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_6_beta_path = dir_prefix + std::string("batch_normalization_6_beta.bin"); - void* batch_normalization_6_beta = readTrainedWeights(batch_normalization_6_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_6_mean_path = dir_prefix + std::string("batch_normalization_6_mean.bin"); - void* batch_normalization_6_mean = readTrainedWeights(batch_normalization_6_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_6_variance_path = dir_prefix + std::string("batch_normalization_6_variance.bin"); - void* batch_normalization_6_variance = readTrainedWeights(batch_normalization_6_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,128,128,1,1); - std::string batch_normalization_7_gamma_path = dir_prefix + std::string("batch_normalization_7_gamma.bin"); - void* batch_normalization_7_gamma = readTrainedWeights(batch_normalization_7_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_7_beta_path = dir_prefix + std::string("batch_normalization_7_beta.bin"); - void* batch_normalization_7_beta = readTrainedWeights(batch_normalization_7_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_7_mean_path = dir_prefix + std::string("batch_normalization_7_mean.bin"); - void* batch_normalization_7_mean = readTrainedWeights(batch_normalization_7_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_7_variance_path = dir_prefix + std::string("batch_normalization_7_variance.bin"); - void* batch_normalization_7_variance = readTrainedWeights(batch_normalization_7_variance_path.c_str(), 0,1,128,1,1); - std::string depthwise_conv2d_4_w_path = dir_prefix + std::string("depthwise_conv2d_4_w.bin"); - void* depthwise_conv2d_4_w = readTrainedWeights(depthwise_conv2d_4_w_path.c_str(), 0,128,1,3,3); - std::string batch_normalization_8_gamma_path = dir_prefix + std::string("batch_normalization_8_gamma.bin"); - void* batch_normalization_8_gamma = readTrainedWeights(batch_normalization_8_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_8_beta_path = dir_prefix + std::string("batch_normalization_8_beta.bin"); - void* batch_normalization_8_beta = readTrainedWeights(batch_normalization_8_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_8_mean_path = dir_prefix + std::string("batch_normalization_8_mean.bin"); - void* batch_normalization_8_mean = readTrainedWeights(batch_normalization_8_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_8_variance_path = dir_prefix + std::string("batch_normalization_8_variance.bin"); - void* batch_normalization_8_variance = readTrainedWeights(batch_normalization_8_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,128,1,1); - std::string batch_normalization_9_gamma_path = dir_prefix + std::string("batch_normalization_9_gamma.bin"); - void* batch_normalization_9_gamma = readTrainedWeights(batch_normalization_9_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_9_beta_path = dir_prefix + std::string("batch_normalization_9_beta.bin"); - void* batch_normalization_9_beta = readTrainedWeights(batch_normalization_9_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_9_mean_path = dir_prefix + std::string("batch_normalization_9_mean.bin"); - void* batch_normalization_9_mean = readTrainedWeights(batch_normalization_9_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_9_variance_path = dir_prefix + std::string("batch_normalization_9_variance.bin"); - void* batch_normalization_9_variance = readTrainedWeights(batch_normalization_9_variance_path.c_str(), 0,1,256,1,1); - std::string depthwise_conv2d_5_w_path = dir_prefix + std::string("depthwise_conv2d_5_w.bin"); - void* depthwise_conv2d_5_w = readTrainedWeights(depthwise_conv2d_5_w_path.c_str(), 0,256,1,3,3); - std::string batch_normalization_10_gamma_path = dir_prefix + std::string("batch_normalization_10_gamma.bin"); - void* batch_normalization_10_gamma = readTrainedWeights(batch_normalization_10_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_10_beta_path = dir_prefix + std::string("batch_normalization_10_beta.bin"); - void* batch_normalization_10_beta = readTrainedWeights(batch_normalization_10_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_10_mean_path = dir_prefix + std::string("batch_normalization_10_mean.bin"); - void* batch_normalization_10_mean = readTrainedWeights(batch_normalization_10_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_10_variance_path = dir_prefix + std::string("batch_normalization_10_variance.bin"); - void* batch_normalization_10_variance = readTrainedWeights(batch_normalization_10_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,256,256,1,1); - std::string batch_normalization_11_gamma_path = dir_prefix + std::string("batch_normalization_11_gamma.bin"); - void* batch_normalization_11_gamma = readTrainedWeights(batch_normalization_11_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_beta_path = dir_prefix + std::string("batch_normalization_11_beta.bin"); - void* batch_normalization_11_beta = readTrainedWeights(batch_normalization_11_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_mean_path = dir_prefix + std::string("batch_normalization_11_mean.bin"); - void* batch_normalization_11_mean = readTrainedWeights(batch_normalization_11_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_variance_path = dir_prefix + std::string("batch_normalization_11_variance.bin"); - void* batch_normalization_11_variance = readTrainedWeights(batch_normalization_11_variance_path.c_str(), 0,1,256,1,1); - std::string depthwise_conv2d_6_w_path = dir_prefix + std::string("depthwise_conv2d_6_w.bin"); - void* depthwise_conv2d_6_w = readTrainedWeights(depthwise_conv2d_6_w_path.c_str(), 0,256,1,3,3); - std::string batch_normalization_12_gamma_path = dir_prefix + std::string("batch_normalization_12_gamma.bin"); - void* batch_normalization_12_gamma = readTrainedWeights(batch_normalization_12_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_12_beta_path = dir_prefix + std::string("batch_normalization_12_beta.bin"); - void* batch_normalization_12_beta = readTrainedWeights(batch_normalization_12_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_12_mean_path = dir_prefix + std::string("batch_normalization_12_mean.bin"); - void* batch_normalization_12_mean = readTrainedWeights(batch_normalization_12_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_12_variance_path = dir_prefix + std::string("batch_normalization_12_variance.bin"); - void* batch_normalization_12_variance = readTrainedWeights(batch_normalization_12_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,512,256,1,1); - std::string batch_normalization_13_gamma_path = dir_prefix + std::string("batch_normalization_13_gamma.bin"); - void* batch_normalization_13_gamma = readTrainedWeights(batch_normalization_13_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_13_beta_path = dir_prefix + std::string("batch_normalization_13_beta.bin"); - void* batch_normalization_13_beta = readTrainedWeights(batch_normalization_13_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_13_mean_path = dir_prefix + std::string("batch_normalization_13_mean.bin"); - void* batch_normalization_13_mean = readTrainedWeights(batch_normalization_13_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_13_variance_path = dir_prefix + std::string("batch_normalization_13_variance.bin"); - void* batch_normalization_13_variance = readTrainedWeights(batch_normalization_13_variance_path.c_str(), 0,1,512,1,1); - std::string depthwise_conv2d_7_w_path = dir_prefix + std::string("depthwise_conv2d_7_w.bin"); - void* depthwise_conv2d_7_w = readTrainedWeights(depthwise_conv2d_7_w_path.c_str(), 0,512,1,3,3); - std::string batch_normalization_14_gamma_path = dir_prefix + std::string("batch_normalization_14_gamma.bin"); - void* batch_normalization_14_gamma = readTrainedWeights(batch_normalization_14_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_beta_path = dir_prefix + std::string("batch_normalization_14_beta.bin"); - void* batch_normalization_14_beta = readTrainedWeights(batch_normalization_14_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_mean_path = dir_prefix + std::string("batch_normalization_14_mean.bin"); - void* batch_normalization_14_mean = readTrainedWeights(batch_normalization_14_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_variance_path = dir_prefix + std::string("batch_normalization_14_variance.bin"); - void* batch_normalization_14_variance = readTrainedWeights(batch_normalization_14_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,512,512,1,1); - std::string batch_normalization_15_gamma_path = dir_prefix + std::string("batch_normalization_15_gamma.bin"); - void* batch_normalization_15_gamma = readTrainedWeights(batch_normalization_15_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_beta_path = dir_prefix + std::string("batch_normalization_15_beta.bin"); - void* batch_normalization_15_beta = readTrainedWeights(batch_normalization_15_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_mean_path = dir_prefix + std::string("batch_normalization_15_mean.bin"); - void* batch_normalization_15_mean = readTrainedWeights(batch_normalization_15_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_variance_path = dir_prefix + std::string("batch_normalization_15_variance.bin"); - void* batch_normalization_15_variance = readTrainedWeights(batch_normalization_15_variance_path.c_str(), 0,1,512,1,1); - std::string depthwise_conv2d_8_w_path = dir_prefix + std::string("depthwise_conv2d_8_w.bin"); - void* depthwise_conv2d_8_w = readTrainedWeights(depthwise_conv2d_8_w_path.c_str(), 0,512,1,3,3); - std::string batch_normalization_16_gamma_path = dir_prefix + std::string("batch_normalization_16_gamma.bin"); - void* batch_normalization_16_gamma = readTrainedWeights(batch_normalization_16_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_16_beta_path = dir_prefix + std::string("batch_normalization_16_beta.bin"); - void* batch_normalization_16_beta = readTrainedWeights(batch_normalization_16_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_16_mean_path = dir_prefix + std::string("batch_normalization_16_mean.bin"); - void* batch_normalization_16_mean = readTrainedWeights(batch_normalization_16_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_16_variance_path = dir_prefix + std::string("batch_normalization_16_variance.bin"); - void* batch_normalization_16_variance = readTrainedWeights(batch_normalization_16_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,512,512,1,1); - std::string batch_normalization_17_gamma_path = dir_prefix + std::string("batch_normalization_17_gamma.bin"); - void* batch_normalization_17_gamma = readTrainedWeights(batch_normalization_17_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_17_beta_path = dir_prefix + std::string("batch_normalization_17_beta.bin"); - void* batch_normalization_17_beta = readTrainedWeights(batch_normalization_17_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_17_mean_path = dir_prefix + std::string("batch_normalization_17_mean.bin"); - void* batch_normalization_17_mean = readTrainedWeights(batch_normalization_17_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_17_variance_path = dir_prefix + std::string("batch_normalization_17_variance.bin"); - void* batch_normalization_17_variance = readTrainedWeights(batch_normalization_17_variance_path.c_str(), 0,1,512,1,1); - std::string depthwise_conv2d_9_w_path = dir_prefix + std::string("depthwise_conv2d_9_w.bin"); - void* depthwise_conv2d_9_w = readTrainedWeights(depthwise_conv2d_9_w_path.c_str(), 0,512,1,3,3); - std::string batch_normalization_18_gamma_path = dir_prefix + std::string("batch_normalization_18_gamma.bin"); - void* batch_normalization_18_gamma = readTrainedWeights(batch_normalization_18_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_beta_path = dir_prefix + std::string("batch_normalization_18_beta.bin"); - void* batch_normalization_18_beta = readTrainedWeights(batch_normalization_18_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_mean_path = dir_prefix + std::string("batch_normalization_18_mean.bin"); - void* batch_normalization_18_mean = readTrainedWeights(batch_normalization_18_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_variance_path = dir_prefix + std::string("batch_normalization_18_variance.bin"); - void* batch_normalization_18_variance = readTrainedWeights(batch_normalization_18_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,512,512,1,1); - std::string batch_normalization_19_gamma_path = dir_prefix + std::string("batch_normalization_19_gamma.bin"); - void* batch_normalization_19_gamma = readTrainedWeights(batch_normalization_19_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_19_beta_path = dir_prefix + std::string("batch_normalization_19_beta.bin"); - void* batch_normalization_19_beta = readTrainedWeights(batch_normalization_19_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_19_mean_path = dir_prefix + std::string("batch_normalization_19_mean.bin"); - void* batch_normalization_19_mean = readTrainedWeights(batch_normalization_19_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_19_variance_path = dir_prefix + std::string("batch_normalization_19_variance.bin"); - void* batch_normalization_19_variance = readTrainedWeights(batch_normalization_19_variance_path.c_str(), 0,1,512,1,1); - std::string depthwise_conv2d_10_w_path = dir_prefix + std::string("depthwise_conv2d_10_w.bin"); - void* depthwise_conv2d_10_w = readTrainedWeights(depthwise_conv2d_10_w_path.c_str(), 0,512,1,3,3); - std::string batch_normalization_20_gamma_path = dir_prefix + std::string("batch_normalization_20_gamma.bin"); - void* batch_normalization_20_gamma = readTrainedWeights(batch_normalization_20_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_20_beta_path = dir_prefix + std::string("batch_normalization_20_beta.bin"); - void* batch_normalization_20_beta = readTrainedWeights(batch_normalization_20_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_20_mean_path = dir_prefix + std::string("batch_normalization_20_mean.bin"); - void* batch_normalization_20_mean = readTrainedWeights(batch_normalization_20_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_20_variance_path = dir_prefix + std::string("batch_normalization_20_variance.bin"); - void* batch_normalization_20_variance = readTrainedWeights(batch_normalization_20_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,512,512,1,1); - std::string batch_normalization_21_gamma_path = dir_prefix + std::string("batch_normalization_21_gamma.bin"); - void* batch_normalization_21_gamma = readTrainedWeights(batch_normalization_21_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_beta_path = dir_prefix + std::string("batch_normalization_21_beta.bin"); - void* batch_normalization_21_beta = readTrainedWeights(batch_normalization_21_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_mean_path = dir_prefix + std::string("batch_normalization_21_mean.bin"); - void* batch_normalization_21_mean = readTrainedWeights(batch_normalization_21_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_variance_path = dir_prefix + std::string("batch_normalization_21_variance.bin"); - void* batch_normalization_21_variance = readTrainedWeights(batch_normalization_21_variance_path.c_str(), 0,1,512,1,1); - std::string depthwise_conv2d_11_w_path = dir_prefix + std::string("depthwise_conv2d_11_w.bin"); - void* depthwise_conv2d_11_w = readTrainedWeights(depthwise_conv2d_11_w_path.c_str(), 0,512,1,3,3); - std::string batch_normalization_22_gamma_path = dir_prefix + std::string("batch_normalization_22_gamma.bin"); - void* batch_normalization_22_gamma = readTrainedWeights(batch_normalization_22_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_22_beta_path = dir_prefix + std::string("batch_normalization_22_beta.bin"); - void* batch_normalization_22_beta = readTrainedWeights(batch_normalization_22_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_22_mean_path = dir_prefix + std::string("batch_normalization_22_mean.bin"); - void* batch_normalization_22_mean = readTrainedWeights(batch_normalization_22_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_22_variance_path = dir_prefix + std::string("batch_normalization_22_variance.bin"); - void* batch_normalization_22_variance = readTrainedWeights(batch_normalization_22_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,512,512,1,1); - std::string batch_normalization_23_gamma_path = dir_prefix + std::string("batch_normalization_23_gamma.bin"); - void* batch_normalization_23_gamma = readTrainedWeights(batch_normalization_23_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_23_beta_path = dir_prefix + std::string("batch_normalization_23_beta.bin"); - void* batch_normalization_23_beta = readTrainedWeights(batch_normalization_23_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_23_mean_path = dir_prefix + std::string("batch_normalization_23_mean.bin"); - void* batch_normalization_23_mean = readTrainedWeights(batch_normalization_23_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_23_variance_path = dir_prefix + std::string("batch_normalization_23_variance.bin"); - void* batch_normalization_23_variance = readTrainedWeights(batch_normalization_23_variance_path.c_str(), 0,1,512,1,1); - std::string depthwise_conv2d_12_w_path = dir_prefix + std::string("depthwise_conv2d_12_w.bin"); - void* depthwise_conv2d_12_w = readTrainedWeights(depthwise_conv2d_12_w_path.c_str(), 0,512,1,3,3); - std::string batch_normalization_24_gamma_path = dir_prefix + std::string("batch_normalization_24_gamma.bin"); - void* batch_normalization_24_gamma = readTrainedWeights(batch_normalization_24_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_beta_path = dir_prefix + std::string("batch_normalization_24_beta.bin"); - void* batch_normalization_24_beta = readTrainedWeights(batch_normalization_24_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_mean_path = dir_prefix + std::string("batch_normalization_24_mean.bin"); - void* batch_normalization_24_mean = readTrainedWeights(batch_normalization_24_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_variance_path = dir_prefix + std::string("batch_normalization_24_variance.bin"); - void* batch_normalization_24_variance = readTrainedWeights(batch_normalization_24_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,1024,512,1,1); - std::string batch_normalization_25_gamma_path = dir_prefix + std::string("batch_normalization_25_gamma.bin"); - void* batch_normalization_25_gamma = readTrainedWeights(batch_normalization_25_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_25_beta_path = dir_prefix + std::string("batch_normalization_25_beta.bin"); - void* batch_normalization_25_beta = readTrainedWeights(batch_normalization_25_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_25_mean_path = dir_prefix + std::string("batch_normalization_25_mean.bin"); - void* batch_normalization_25_mean = readTrainedWeights(batch_normalization_25_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_25_variance_path = dir_prefix + std::string("batch_normalization_25_variance.bin"); - void* batch_normalization_25_variance = readTrainedWeights(batch_normalization_25_variance_path.c_str(), 0,1,1024,1,1); - std::string depthwise_conv2d_13_w_path = dir_prefix + std::string("depthwise_conv2d_13_w.bin"); - void* depthwise_conv2d_13_w = readTrainedWeights(depthwise_conv2d_13_w_path.c_str(), 0,1024,1,3,3); - std::string batch_normalization_26_gamma_path = dir_prefix + std::string("batch_normalization_26_gamma.bin"); - void* batch_normalization_26_gamma = readTrainedWeights(batch_normalization_26_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_26_beta_path = dir_prefix + std::string("batch_normalization_26_beta.bin"); - void* batch_normalization_26_beta = readTrainedWeights(batch_normalization_26_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_26_mean_path = dir_prefix + std::string("batch_normalization_26_mean.bin"); - void* batch_normalization_26_mean = readTrainedWeights(batch_normalization_26_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_26_variance_path = dir_prefix + std::string("batch_normalization_26_variance.bin"); - void* batch_normalization_26_variance = readTrainedWeights(batch_normalization_26_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_14_w_path = dir_prefix + std::string("conv2d_14_w.bin"); - void* conv2d_14_w = readTrainedWeights(conv2d_14_w_path.c_str(), 0,1024,1024,1,1); - std::string batch_normalization_27_gamma_path = dir_prefix + std::string("batch_normalization_27_gamma.bin"); - void* batch_normalization_27_gamma = readTrainedWeights(batch_normalization_27_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_beta_path = dir_prefix + std::string("batch_normalization_27_beta.bin"); - void* batch_normalization_27_beta = readTrainedWeights(batch_normalization_27_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_mean_path = dir_prefix + std::string("batch_normalization_27_mean.bin"); - void* batch_normalization_27_mean = readTrainedWeights(batch_normalization_27_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_variance_path = dir_prefix + std::string("batch_normalization_27_variance.bin"); - void* batch_normalization_27_variance = readTrainedWeights(batch_normalization_27_variance_path.c_str(), 0,1,1024,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,1024,10); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,10,1,1); - - - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - // NOTE: Wait on signal from OpenTuner - stallOnOpenTunerSignal(); - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - for(int i = 0; i < batch_count; i++){ - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.9892114, 2.126797, conv2d_1_w, -2.196306920051575, 1.347581704139706, NULL, 0, 0, 1, 1, 1, 1, -1, 0, -1, -60.89275047302246, 51.99256916046146, 9); - void* var_1 = tensorHalfBatchNorm(var_0, batch_normalization_1_gamma, batch_normalization_1_beta, batch_normalization_1_mean, batch_normalization_1_variance, 0.001); - void* var_2 = tensorRelu(var_1); - void* var_3 = tensorConvolution(var_2, depthwise_conv2d_1_w, 1, 1, 1, 1, 1, 32); - void* var_4 = tensorHalfBatchNorm(var_3, batch_normalization_2_gamma, batch_normalization_2_beta, batch_normalization_2_mean, batch_normalization_2_variance, 0.001); - void* var_5 = tensorRelu(var_4); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 5.713541553974245, conv2d_2_w, -0.9317721160650253, 1.0774258937835774, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -6.518589503288269, 6.810842518806449, 9); - void* var_7 = tensorHalfBatchNorm(var_6, batch_normalization_3_gamma, batch_normalization_3_beta, batch_normalization_3_mean, batch_normalization_3_variance, 0.001); - void* var_8 = tensorRelu(var_7); - void* var_9 = tensorConvolution(var_8, depthwise_conv2d_2_w, 1, 1, 2, 2, 1, 64); - void* var_10 = tensorHalfBatchNorm(var_9, batch_normalization_4_gamma, batch_normalization_4_beta, batch_normalization_4_mean, batch_normalization_4_variance, 0.001); - void* var_11 = tensorRelu(var_10); - void* var_12 = ConvLayer_PROMISE(var_11, 0.0, 4.932139402866376, conv2d_3_w, -0.5316544661521911, 0.5753790403604531, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.482631235122681, 3.96730119752885, 9); - void* var_13 = tensorHalfBatchNorm(var_12, batch_normalization_5_gamma, batch_normalization_5_beta, batch_normalization_5_mean, batch_normalization_5_variance, 0.001); - void* var_14 = tensorRelu(var_13); - void* var_15 = tensorConvolution(var_14, depthwise_conv2d_3_w, 1, 1, 1, 1, 1, 128); - void* var_16 = tensorHalfBatchNorm(var_15, batch_normalization_6_gamma, batch_normalization_6_beta, batch_normalization_6_mean, batch_normalization_6_variance, 0.001); - void* var_17 = tensorRelu(var_16); - void* var_18 = ConvLayer_PROMISE(var_17, 0.0, 4.103263397693674, conv2d_4_w, -0.36234098821878435, 0.4076913900375366, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.04261828327179, 3.88677932929993, 9); - void* var_19 = tensorHalfBatchNorm(var_18, batch_normalization_7_gamma, batch_normalization_7_beta, batch_normalization_7_mean, batch_normalization_7_variance, 0.001); - void* var_20 = tensorRelu(var_19); - void* var_21 = tensorConvolution(var_20, depthwise_conv2d_4_w, 1, 1, 2, 2, 1, 128); - void* var_22 = tensorHalfBatchNorm(var_21, batch_normalization_8_gamma, batch_normalization_8_beta, batch_normalization_8_mean, batch_normalization_8_variance, 0.001); - void* var_23 = tensorRelu(var_22); - void* var_24 = ConvLayer_PROMISE(var_23, 0.0, 5.383221302509475, conv2d_5_w, -0.3131200549006462, 0.29357679939270065, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -5.921469215393066, 4.338679324150087, 9); - void* var_25 = tensorHalfBatchNorm(var_24, batch_normalization_9_gamma, batch_normalization_9_beta, batch_normalization_9_mean, batch_normalization_9_variance, 0.001); - void* var_26 = tensorRelu(var_25); - void* var_27 = tensorConvolution(var_26, depthwise_conv2d_5_w, 1, 1, 1, 1, 1, 256); - void* var_28 = tensorHalfBatchNorm(var_27, batch_normalization_10_gamma, batch_normalization_10_beta, batch_normalization_10_mean, batch_normalization_10_variance, 0.001); - void* var_29 = tensorRelu(var_28); - void* var_30 = ConvLayer_PROMISE(var_29, 0.0, 4.316738154411368, conv2d_6_w, -0.23299247801303866, 0.2580290257930756, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.207789947509766, 3.932436970710759, 9); - void* var_31 = tensorHalfBatchNorm(var_30, batch_normalization_11_gamma, batch_normalization_11_beta, batch_normalization_11_mean, batch_normalization_11_variance, 0.001); - void* var_32 = tensorRelu(var_31); - void* var_33 = tensorConvolution(var_32, depthwise_conv2d_6_w, 1, 1, 2, 2, 1, 256); - void* var_34 = tensorHalfBatchNorm(var_33, batch_normalization_12_gamma, batch_normalization_12_beta, batch_normalization_12_mean, batch_normalization_12_variance, 0.001); - void* var_35 = tensorRelu(var_34); - void* var_36 = ConvLayer_PROMISE(var_35, 0.0, 5.830408106803901, conv2d_7_w, -0.20233777219057084, 0.18998308175802117, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -6.298286915779113, 4.848135117530843, 9); - void* var_37 = tensorHalfBatchNorm(var_36, batch_normalization_13_gamma, batch_normalization_13_beta, batch_normalization_13_mean, batch_normalization_13_variance, 0.001); - void* var_38 = tensorRelu(var_37); - void* var_39 = tensorConvolution(var_38, depthwise_conv2d_7_w, 1, 1, 1, 1, 1, 512); - void* var_40 = tensorHalfBatchNorm(var_39, batch_normalization_14_gamma, batch_normalization_14_beta, batch_normalization_14_mean, batch_normalization_14_variance, 0.001); - void* var_41 = tensorRelu(var_40); - void* var_42 = ConvLayer_PROMISE(var_41, 0.0, 4.446417809963227, conv2d_8_w, -0.17442735651135444, 0.17695830866694454, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.347910885810852, 3.6144364695549145, 9); - void* var_43 = tensorHalfBatchNorm(var_42, batch_normalization_15_gamma, batch_normalization_15_beta, batch_normalization_15_mean, batch_normalization_15_variance, 0.001); - void* var_44 = tensorRelu(var_43); - void* var_45 = tensorConvolution(var_44, depthwise_conv2d_8_w, 1, 1, 1, 1, 1, 512); - void* var_46 = tensorHalfBatchNorm(var_45, batch_normalization_16_gamma, batch_normalization_16_beta, batch_normalization_16_mean, batch_normalization_16_variance, 0.001); - void* var_47 = tensorRelu(var_46); - void* var_48 = ConvLayer_PROMISE(var_47, 0.0, 4.518095604896667, conv2d_9_w, -0.14546796187758446, 0.15256431668996823, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -3.0287702755928043, 2.9487365779876953, 9); - void* var_49 = tensorHalfBatchNorm(var_48, batch_normalization_17_gamma, batch_normalization_17_beta, batch_normalization_17_mean, batch_normalization_17_variance, 0.001); - void* var_50 = tensorRelu(var_49); - void* var_51 = tensorConvolution(var_50, depthwise_conv2d_9_w, 1, 1, 1, 1, 1, 512); - void* var_52 = tensorHalfBatchNorm(var_51, batch_normalization_18_gamma, batch_normalization_18_beta, batch_normalization_18_mean, batch_normalization_18_variance, 0.001); - void* var_53 = tensorRelu(var_52); - void* var_54 = ConvLayer_PROMISE(var_53, 0.0, 6.348575634956407, conv2d_10_w, -0.13025874522328376, 0.13558243343234128, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.2293100805282595, 3.5315046372413645, 9); - void* var_55 = tensorHalfBatchNorm(var_54, batch_normalization_19_gamma, batch_normalization_19_beta, batch_normalization_19_mean, batch_normalization_19_variance, 0.001); - void* var_56 = tensorRelu(var_55); - void* var_57 = tensorConvolution(var_56, depthwise_conv2d_10_w, 1, 1, 1, 1, 1, 512); - void* var_58 = tensorHalfBatchNorm(var_57, batch_normalization_20_gamma, batch_normalization_20_beta, batch_normalization_20_mean, batch_normalization_20_variance, 0.001); - void* var_59 = tensorRelu(var_58); - void* var_60 = ConvLayer_PROMISE(var_59, 0.0, 5.221003110408843, conv2d_11_w, -0.11900172759592534, 0.12536374783515936, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.038203780174255, 4.004009407043483, 9); - void* var_61 = tensorHalfBatchNorm(var_60, batch_normalization_21_gamma, batch_normalization_21_beta, batch_normalization_21_mean, batch_normalization_21_variance, 0.001); - void* var_62 = tensorRelu(var_61); - void* var_63 = tensorConvolution(var_62, depthwise_conv2d_11_w, 1, 1, 1, 1, 1, 512); - void* var_64 = tensorHalfBatchNorm(var_63, batch_normalization_22_gamma, batch_normalization_22_beta, batch_normalization_22_mean, batch_normalization_22_variance, 0.001); - void* var_65 = tensorRelu(var_64); - void* var_66 = ConvLayer_PROMISE(var_65, 0.0, 5.732498347759442, conv2d_12_w, -0.10839721685647964, 0.11625668607652187, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -3.3111015114784244, 4.462933233261136, 9); - void* var_67 = tensorHalfBatchNorm(var_66, batch_normalization_23_gamma, batch_normalization_23_beta, batch_normalization_23_mean, batch_normalization_23_variance, 0.001); - void* var_68 = tensorRelu(var_67); - void* var_69 = tensorConvolution(var_68, depthwise_conv2d_12_w, 1, 1, 2, 2, 1, 512); - void* var_70 = tensorHalfBatchNorm(var_69, batch_normalization_24_gamma, batch_normalization_24_beta, batch_normalization_24_mean, batch_normalization_24_variance, 0.001); - void* var_71 = tensorHalfRelu(var_70); - void* var_72 = ConvLayer_PROMISE(var_71, 0.0, 7.240498211860681, conv2d_13_w, -0.08623744961619377, 0.08859449951350662, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.175431394577027, 6.2043294754027345, 9); - void* var_73 = tensorHalfBatchNorm(var_72, batch_normalization_25_gamma, batch_normalization_25_beta, batch_normalization_25_mean, batch_normalization_25_variance, 0.001); - void* var_74 = tensorHalfRelu(var_73); - void* var_75 = tensorConvolution(var_74, depthwise_conv2d_13_w, 1, 1, 1, 1, 1, 1024); - void* var_76 = tensorHalfBatchNorm(var_75, batch_normalization_26_gamma, batch_normalization_26_beta, batch_normalization_26_mean, batch_normalization_26_variance, 0.001); - void* var_77 = tensorRelu(var_76); - void* var_78 = ConvLayer_PROMISE(var_77, 0.0, 7.813958834648251, conv2d_14_w, -0.06813025139272214, 0.07002027779817581, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -10.920566423416137, 2.6442912578582534, 9); - void* var_79 = tensorHalfBatchNorm(var_78, batch_normalization_27_gamma, batch_normalization_27_beta, batch_normalization_27_mean, batch_normalization_27_variance, 0.001); - void* var_80 = tensorHalfRelu(var_79); - void* var_81 = tensorHalfPooling(var_80,1,2,2,0,0,2,2); - void* var_82 = FCLayer_PROMISE(var_81, 0.0, 2.8692066650391013, dense_1_w, -0.22301019695401192, 0.1442659378200768, dense_1_b, -0.1654396, 0.23336112, -1, -12.245949958801269, 23.80532513427739, 9); - void* var_83 = tensorSoftmax(var_82); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_83); - final_accuracy += accuracy; - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_83, classConfs, predictedLabels, relative_start, relative_end); - } - - - freeBatchMemory(); - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - - // NOTE: Signal back to OpenTuner - signalPipeToOpenTuner(); - } - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_promise.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_promise.cc deleted file mode 100644 index 697cc5f141..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_promise.cc +++ /dev/null @@ -1,487 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 1000; - int offset = 5000; - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - - llvm_hpvm_initTensorRt(0); - - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - - std::string dir_prefix = std::string("../model_params/mobilenet/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - for(int i = 0; i < batch_count; i++){ - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,32,3,3,3); - std::string batch_normalization_1_gamma_path = dir_prefix + std::string("batch_normalization_1_gamma.bin"); - void* batch_normalization_1_gamma = readTrainedWeights(batch_normalization_1_gamma_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_1_beta_path = dir_prefix + std::string("batch_normalization_1_beta.bin"); - void* batch_normalization_1_beta = readTrainedWeights(batch_normalization_1_beta_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_1_mean_path = dir_prefix + std::string("batch_normalization_1_mean.bin"); - void* batch_normalization_1_mean = readTrainedWeights(batch_normalization_1_mean_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_1_variance_path = dir_prefix + std::string("batch_normalization_1_variance.bin"); - void* batch_normalization_1_variance = readTrainedWeights(batch_normalization_1_variance_path.c_str(), 0,1,32,1,1); - std::string depthwise_conv2d_1_w_path = dir_prefix + std::string("depthwise_conv2d_1_w.bin"); - void* depthwise_conv2d_1_w = readTrainedWeights(depthwise_conv2d_1_w_path.c_str(), 0,32,1,3,3); - std::string batch_normalization_2_gamma_path = dir_prefix + std::string("batch_normalization_2_gamma.bin"); - void* batch_normalization_2_gamma = readTrainedWeights(batch_normalization_2_gamma_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_2_beta_path = dir_prefix + std::string("batch_normalization_2_beta.bin"); - void* batch_normalization_2_beta = readTrainedWeights(batch_normalization_2_beta_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_2_mean_path = dir_prefix + std::string("batch_normalization_2_mean.bin"); - void* batch_normalization_2_mean = readTrainedWeights(batch_normalization_2_mean_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_2_variance_path = dir_prefix + std::string("batch_normalization_2_variance.bin"); - void* batch_normalization_2_variance = readTrainedWeights(batch_normalization_2_variance_path.c_str(), 0,1,32,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,32,1,1); - std::string batch_normalization_3_gamma_path = dir_prefix + std::string("batch_normalization_3_gamma.bin"); - void* batch_normalization_3_gamma = readTrainedWeights(batch_normalization_3_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_beta_path = dir_prefix + std::string("batch_normalization_3_beta.bin"); - void* batch_normalization_3_beta = readTrainedWeights(batch_normalization_3_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_mean_path = dir_prefix + std::string("batch_normalization_3_mean.bin"); - void* batch_normalization_3_mean = readTrainedWeights(batch_normalization_3_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_variance_path = dir_prefix + std::string("batch_normalization_3_variance.bin"); - void* batch_normalization_3_variance = readTrainedWeights(batch_normalization_3_variance_path.c_str(), 0,1,64,1,1); - std::string depthwise_conv2d_2_w_path = dir_prefix + std::string("depthwise_conv2d_2_w.bin"); - void* depthwise_conv2d_2_w = readTrainedWeights(depthwise_conv2d_2_w_path.c_str(), 0,64,1,3,3); - std::string batch_normalization_4_gamma_path = dir_prefix + std::string("batch_normalization_4_gamma.bin"); - void* batch_normalization_4_gamma = readTrainedWeights(batch_normalization_4_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_4_beta_path = dir_prefix + std::string("batch_normalization_4_beta.bin"); - void* batch_normalization_4_beta = readTrainedWeights(batch_normalization_4_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_4_mean_path = dir_prefix + std::string("batch_normalization_4_mean.bin"); - void* batch_normalization_4_mean = readTrainedWeights(batch_normalization_4_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_4_variance_path = dir_prefix + std::string("batch_normalization_4_variance.bin"); - void* batch_normalization_4_variance = readTrainedWeights(batch_normalization_4_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,128,64,1,1); - std::string batch_normalization_5_gamma_path = dir_prefix + std::string("batch_normalization_5_gamma.bin"); - void* batch_normalization_5_gamma = readTrainedWeights(batch_normalization_5_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_5_beta_path = dir_prefix + std::string("batch_normalization_5_beta.bin"); - void* batch_normalization_5_beta = readTrainedWeights(batch_normalization_5_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_5_mean_path = dir_prefix + std::string("batch_normalization_5_mean.bin"); - void* batch_normalization_5_mean = readTrainedWeights(batch_normalization_5_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_5_variance_path = dir_prefix + std::string("batch_normalization_5_variance.bin"); - void* batch_normalization_5_variance = readTrainedWeights(batch_normalization_5_variance_path.c_str(), 0,1,128,1,1); - std::string depthwise_conv2d_3_w_path = dir_prefix + std::string("depthwise_conv2d_3_w.bin"); - void* depthwise_conv2d_3_w = readTrainedWeights(depthwise_conv2d_3_w_path.c_str(), 0,128,1,3,3); - std::string batch_normalization_6_gamma_path = dir_prefix + std::string("batch_normalization_6_gamma.bin"); - void* batch_normalization_6_gamma = readTrainedWeights(batch_normalization_6_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_6_beta_path = dir_prefix + std::string("batch_normalization_6_beta.bin"); - void* batch_normalization_6_beta = readTrainedWeights(batch_normalization_6_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_6_mean_path = dir_prefix + std::string("batch_normalization_6_mean.bin"); - void* batch_normalization_6_mean = readTrainedWeights(batch_normalization_6_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_6_variance_path = dir_prefix + std::string("batch_normalization_6_variance.bin"); - void* batch_normalization_6_variance = readTrainedWeights(batch_normalization_6_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,128,128,1,1); - std::string batch_normalization_7_gamma_path = dir_prefix + std::string("batch_normalization_7_gamma.bin"); - void* batch_normalization_7_gamma = readTrainedWeights(batch_normalization_7_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_7_beta_path = dir_prefix + std::string("batch_normalization_7_beta.bin"); - void* batch_normalization_7_beta = readTrainedWeights(batch_normalization_7_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_7_mean_path = dir_prefix + std::string("batch_normalization_7_mean.bin"); - void* batch_normalization_7_mean = readTrainedWeights(batch_normalization_7_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_7_variance_path = dir_prefix + std::string("batch_normalization_7_variance.bin"); - void* batch_normalization_7_variance = readTrainedWeights(batch_normalization_7_variance_path.c_str(), 0,1,128,1,1); - std::string depthwise_conv2d_4_w_path = dir_prefix + std::string("depthwise_conv2d_4_w.bin"); - void* depthwise_conv2d_4_w = readTrainedWeights(depthwise_conv2d_4_w_path.c_str(), 0,128,1,3,3); - std::string batch_normalization_8_gamma_path = dir_prefix + std::string("batch_normalization_8_gamma.bin"); - void* batch_normalization_8_gamma = readTrainedWeights(batch_normalization_8_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_8_beta_path = dir_prefix + std::string("batch_normalization_8_beta.bin"); - void* batch_normalization_8_beta = readTrainedWeights(batch_normalization_8_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_8_mean_path = dir_prefix + std::string("batch_normalization_8_mean.bin"); - void* batch_normalization_8_mean = readTrainedWeights(batch_normalization_8_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_8_variance_path = dir_prefix + std::string("batch_normalization_8_variance.bin"); - void* batch_normalization_8_variance = readTrainedWeights(batch_normalization_8_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,128,1,1); - std::string batch_normalization_9_gamma_path = dir_prefix + std::string("batch_normalization_9_gamma.bin"); - void* batch_normalization_9_gamma = readTrainedWeights(batch_normalization_9_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_9_beta_path = dir_prefix + std::string("batch_normalization_9_beta.bin"); - void* batch_normalization_9_beta = readTrainedWeights(batch_normalization_9_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_9_mean_path = dir_prefix + std::string("batch_normalization_9_mean.bin"); - void* batch_normalization_9_mean = readTrainedWeights(batch_normalization_9_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_9_variance_path = dir_prefix + std::string("batch_normalization_9_variance.bin"); - void* batch_normalization_9_variance = readTrainedWeights(batch_normalization_9_variance_path.c_str(), 0,1,256,1,1); - std::string depthwise_conv2d_5_w_path = dir_prefix + std::string("depthwise_conv2d_5_w.bin"); - void* depthwise_conv2d_5_w = readTrainedWeights(depthwise_conv2d_5_w_path.c_str(), 0,256,1,3,3); - std::string batch_normalization_10_gamma_path = dir_prefix + std::string("batch_normalization_10_gamma.bin"); - void* batch_normalization_10_gamma = readTrainedWeights(batch_normalization_10_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_10_beta_path = dir_prefix + std::string("batch_normalization_10_beta.bin"); - void* batch_normalization_10_beta = readTrainedWeights(batch_normalization_10_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_10_mean_path = dir_prefix + std::string("batch_normalization_10_mean.bin"); - void* batch_normalization_10_mean = readTrainedWeights(batch_normalization_10_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_10_variance_path = dir_prefix + std::string("batch_normalization_10_variance.bin"); - void* batch_normalization_10_variance = readTrainedWeights(batch_normalization_10_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,256,256,1,1); - std::string batch_normalization_11_gamma_path = dir_prefix + std::string("batch_normalization_11_gamma.bin"); - void* batch_normalization_11_gamma = readTrainedWeights(batch_normalization_11_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_beta_path = dir_prefix + std::string("batch_normalization_11_beta.bin"); - void* batch_normalization_11_beta = readTrainedWeights(batch_normalization_11_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_mean_path = dir_prefix + std::string("batch_normalization_11_mean.bin"); - void* batch_normalization_11_mean = readTrainedWeights(batch_normalization_11_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_variance_path = dir_prefix + std::string("batch_normalization_11_variance.bin"); - void* batch_normalization_11_variance = readTrainedWeights(batch_normalization_11_variance_path.c_str(), 0,1,256,1,1); - std::string depthwise_conv2d_6_w_path = dir_prefix + std::string("depthwise_conv2d_6_w.bin"); - void* depthwise_conv2d_6_w = readTrainedWeights(depthwise_conv2d_6_w_path.c_str(), 0,256,1,3,3); - std::string batch_normalization_12_gamma_path = dir_prefix + std::string("batch_normalization_12_gamma.bin"); - void* batch_normalization_12_gamma = readTrainedWeights(batch_normalization_12_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_12_beta_path = dir_prefix + std::string("batch_normalization_12_beta.bin"); - void* batch_normalization_12_beta = readTrainedWeights(batch_normalization_12_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_12_mean_path = dir_prefix + std::string("batch_normalization_12_mean.bin"); - void* batch_normalization_12_mean = readTrainedWeights(batch_normalization_12_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_12_variance_path = dir_prefix + std::string("batch_normalization_12_variance.bin"); - void* batch_normalization_12_variance = readTrainedWeights(batch_normalization_12_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,512,256,1,1); - std::string batch_normalization_13_gamma_path = dir_prefix + std::string("batch_normalization_13_gamma.bin"); - void* batch_normalization_13_gamma = readTrainedWeights(batch_normalization_13_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_13_beta_path = dir_prefix + std::string("batch_normalization_13_beta.bin"); - void* batch_normalization_13_beta = readTrainedWeights(batch_normalization_13_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_13_mean_path = dir_prefix + std::string("batch_normalization_13_mean.bin"); - void* batch_normalization_13_mean = readTrainedWeights(batch_normalization_13_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_13_variance_path = dir_prefix + std::string("batch_normalization_13_variance.bin"); - void* batch_normalization_13_variance = readTrainedWeights(batch_normalization_13_variance_path.c_str(), 0,1,512,1,1); - std::string depthwise_conv2d_7_w_path = dir_prefix + std::string("depthwise_conv2d_7_w.bin"); - void* depthwise_conv2d_7_w = readTrainedWeights(depthwise_conv2d_7_w_path.c_str(), 0,512,1,3,3); - std::string batch_normalization_14_gamma_path = dir_prefix + std::string("batch_normalization_14_gamma.bin"); - void* batch_normalization_14_gamma = readTrainedWeights(batch_normalization_14_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_beta_path = dir_prefix + std::string("batch_normalization_14_beta.bin"); - void* batch_normalization_14_beta = readTrainedWeights(batch_normalization_14_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_mean_path = dir_prefix + std::string("batch_normalization_14_mean.bin"); - void* batch_normalization_14_mean = readTrainedWeights(batch_normalization_14_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_variance_path = dir_prefix + std::string("batch_normalization_14_variance.bin"); - void* batch_normalization_14_variance = readTrainedWeights(batch_normalization_14_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,512,512,1,1); - std::string batch_normalization_15_gamma_path = dir_prefix + std::string("batch_normalization_15_gamma.bin"); - void* batch_normalization_15_gamma = readTrainedWeights(batch_normalization_15_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_beta_path = dir_prefix + std::string("batch_normalization_15_beta.bin"); - void* batch_normalization_15_beta = readTrainedWeights(batch_normalization_15_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_mean_path = dir_prefix + std::string("batch_normalization_15_mean.bin"); - void* batch_normalization_15_mean = readTrainedWeights(batch_normalization_15_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_variance_path = dir_prefix + std::string("batch_normalization_15_variance.bin"); - void* batch_normalization_15_variance = readTrainedWeights(batch_normalization_15_variance_path.c_str(), 0,1,512,1,1); - std::string depthwise_conv2d_8_w_path = dir_prefix + std::string("depthwise_conv2d_8_w.bin"); - void* depthwise_conv2d_8_w = readTrainedWeights(depthwise_conv2d_8_w_path.c_str(), 0,512,1,3,3); - std::string batch_normalization_16_gamma_path = dir_prefix + std::string("batch_normalization_16_gamma.bin"); - void* batch_normalization_16_gamma = readTrainedWeights(batch_normalization_16_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_16_beta_path = dir_prefix + std::string("batch_normalization_16_beta.bin"); - void* batch_normalization_16_beta = readTrainedWeights(batch_normalization_16_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_16_mean_path = dir_prefix + std::string("batch_normalization_16_mean.bin"); - void* batch_normalization_16_mean = readTrainedWeights(batch_normalization_16_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_16_variance_path = dir_prefix + std::string("batch_normalization_16_variance.bin"); - void* batch_normalization_16_variance = readTrainedWeights(batch_normalization_16_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,512,512,1,1); - std::string batch_normalization_17_gamma_path = dir_prefix + std::string("batch_normalization_17_gamma.bin"); - void* batch_normalization_17_gamma = readTrainedWeights(batch_normalization_17_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_17_beta_path = dir_prefix + std::string("batch_normalization_17_beta.bin"); - void* batch_normalization_17_beta = readTrainedWeights(batch_normalization_17_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_17_mean_path = dir_prefix + std::string("batch_normalization_17_mean.bin"); - void* batch_normalization_17_mean = readTrainedWeights(batch_normalization_17_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_17_variance_path = dir_prefix + std::string("batch_normalization_17_variance.bin"); - void* batch_normalization_17_variance = readTrainedWeights(batch_normalization_17_variance_path.c_str(), 0,1,512,1,1); - std::string depthwise_conv2d_9_w_path = dir_prefix + std::string("depthwise_conv2d_9_w.bin"); - void* depthwise_conv2d_9_w = readTrainedWeights(depthwise_conv2d_9_w_path.c_str(), 0,512,1,3,3); - std::string batch_normalization_18_gamma_path = dir_prefix + std::string("batch_normalization_18_gamma.bin"); - void* batch_normalization_18_gamma = readTrainedWeights(batch_normalization_18_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_beta_path = dir_prefix + std::string("batch_normalization_18_beta.bin"); - void* batch_normalization_18_beta = readTrainedWeights(batch_normalization_18_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_mean_path = dir_prefix + std::string("batch_normalization_18_mean.bin"); - void* batch_normalization_18_mean = readTrainedWeights(batch_normalization_18_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_variance_path = dir_prefix + std::string("batch_normalization_18_variance.bin"); - void* batch_normalization_18_variance = readTrainedWeights(batch_normalization_18_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,512,512,1,1); - std::string batch_normalization_19_gamma_path = dir_prefix + std::string("batch_normalization_19_gamma.bin"); - void* batch_normalization_19_gamma = readTrainedWeights(batch_normalization_19_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_19_beta_path = dir_prefix + std::string("batch_normalization_19_beta.bin"); - void* batch_normalization_19_beta = readTrainedWeights(batch_normalization_19_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_19_mean_path = dir_prefix + std::string("batch_normalization_19_mean.bin"); - void* batch_normalization_19_mean = readTrainedWeights(batch_normalization_19_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_19_variance_path = dir_prefix + std::string("batch_normalization_19_variance.bin"); - void* batch_normalization_19_variance = readTrainedWeights(batch_normalization_19_variance_path.c_str(), 0,1,512,1,1); - std::string depthwise_conv2d_10_w_path = dir_prefix + std::string("depthwise_conv2d_10_w.bin"); - void* depthwise_conv2d_10_w = readTrainedWeights(depthwise_conv2d_10_w_path.c_str(), 0,512,1,3,3); - std::string batch_normalization_20_gamma_path = dir_prefix + std::string("batch_normalization_20_gamma.bin"); - void* batch_normalization_20_gamma = readTrainedWeights(batch_normalization_20_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_20_beta_path = dir_prefix + std::string("batch_normalization_20_beta.bin"); - void* batch_normalization_20_beta = readTrainedWeights(batch_normalization_20_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_20_mean_path = dir_prefix + std::string("batch_normalization_20_mean.bin"); - void* batch_normalization_20_mean = readTrainedWeights(batch_normalization_20_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_20_variance_path = dir_prefix + std::string("batch_normalization_20_variance.bin"); - void* batch_normalization_20_variance = readTrainedWeights(batch_normalization_20_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,512,512,1,1); - std::string batch_normalization_21_gamma_path = dir_prefix + std::string("batch_normalization_21_gamma.bin"); - void* batch_normalization_21_gamma = readTrainedWeights(batch_normalization_21_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_beta_path = dir_prefix + std::string("batch_normalization_21_beta.bin"); - void* batch_normalization_21_beta = readTrainedWeights(batch_normalization_21_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_mean_path = dir_prefix + std::string("batch_normalization_21_mean.bin"); - void* batch_normalization_21_mean = readTrainedWeights(batch_normalization_21_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_variance_path = dir_prefix + std::string("batch_normalization_21_variance.bin"); - void* batch_normalization_21_variance = readTrainedWeights(batch_normalization_21_variance_path.c_str(), 0,1,512,1,1); - std::string depthwise_conv2d_11_w_path = dir_prefix + std::string("depthwise_conv2d_11_w.bin"); - void* depthwise_conv2d_11_w = readTrainedWeights(depthwise_conv2d_11_w_path.c_str(), 0,512,1,3,3); - std::string batch_normalization_22_gamma_path = dir_prefix + std::string("batch_normalization_22_gamma.bin"); - void* batch_normalization_22_gamma = readTrainedWeights(batch_normalization_22_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_22_beta_path = dir_prefix + std::string("batch_normalization_22_beta.bin"); - void* batch_normalization_22_beta = readTrainedWeights(batch_normalization_22_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_22_mean_path = dir_prefix + std::string("batch_normalization_22_mean.bin"); - void* batch_normalization_22_mean = readTrainedWeights(batch_normalization_22_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_22_variance_path = dir_prefix + std::string("batch_normalization_22_variance.bin"); - void* batch_normalization_22_variance = readTrainedWeights(batch_normalization_22_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,512,512,1,1); - std::string batch_normalization_23_gamma_path = dir_prefix + std::string("batch_normalization_23_gamma.bin"); - void* batch_normalization_23_gamma = readTrainedWeights(batch_normalization_23_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_23_beta_path = dir_prefix + std::string("batch_normalization_23_beta.bin"); - void* batch_normalization_23_beta = readTrainedWeights(batch_normalization_23_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_23_mean_path = dir_prefix + std::string("batch_normalization_23_mean.bin"); - void* batch_normalization_23_mean = readTrainedWeights(batch_normalization_23_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_23_variance_path = dir_prefix + std::string("batch_normalization_23_variance.bin"); - void* batch_normalization_23_variance = readTrainedWeights(batch_normalization_23_variance_path.c_str(), 0,1,512,1,1); - std::string depthwise_conv2d_12_w_path = dir_prefix + std::string("depthwise_conv2d_12_w.bin"); - void* depthwise_conv2d_12_w = readTrainedWeights(depthwise_conv2d_12_w_path.c_str(), 0,512,1,3,3); - std::string batch_normalization_24_gamma_path = dir_prefix + std::string("batch_normalization_24_gamma.bin"); - void* batch_normalization_24_gamma = readTrainedWeights(batch_normalization_24_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_beta_path = dir_prefix + std::string("batch_normalization_24_beta.bin"); - void* batch_normalization_24_beta = readTrainedWeights(batch_normalization_24_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_mean_path = dir_prefix + std::string("batch_normalization_24_mean.bin"); - void* batch_normalization_24_mean = readTrainedWeights(batch_normalization_24_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_variance_path = dir_prefix + std::string("batch_normalization_24_variance.bin"); - void* batch_normalization_24_variance = readTrainedWeights(batch_normalization_24_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,1024,512,1,1); - std::string batch_normalization_25_gamma_path = dir_prefix + std::string("batch_normalization_25_gamma.bin"); - void* batch_normalization_25_gamma = readTrainedWeights(batch_normalization_25_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_25_beta_path = dir_prefix + std::string("batch_normalization_25_beta.bin"); - void* batch_normalization_25_beta = readTrainedWeights(batch_normalization_25_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_25_mean_path = dir_prefix + std::string("batch_normalization_25_mean.bin"); - void* batch_normalization_25_mean = readTrainedWeights(batch_normalization_25_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_25_variance_path = dir_prefix + std::string("batch_normalization_25_variance.bin"); - void* batch_normalization_25_variance = readTrainedWeights(batch_normalization_25_variance_path.c_str(), 0,1,1024,1,1); - std::string depthwise_conv2d_13_w_path = dir_prefix + std::string("depthwise_conv2d_13_w.bin"); - void* depthwise_conv2d_13_w = readTrainedWeights(depthwise_conv2d_13_w_path.c_str(), 0,1024,1,3,3); - std::string batch_normalization_26_gamma_path = dir_prefix + std::string("batch_normalization_26_gamma.bin"); - void* batch_normalization_26_gamma = readTrainedWeights(batch_normalization_26_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_26_beta_path = dir_prefix + std::string("batch_normalization_26_beta.bin"); - void* batch_normalization_26_beta = readTrainedWeights(batch_normalization_26_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_26_mean_path = dir_prefix + std::string("batch_normalization_26_mean.bin"); - void* batch_normalization_26_mean = readTrainedWeights(batch_normalization_26_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_26_variance_path = dir_prefix + std::string("batch_normalization_26_variance.bin"); - void* batch_normalization_26_variance = readTrainedWeights(batch_normalization_26_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_14_w_path = dir_prefix + std::string("conv2d_14_w.bin"); - void* conv2d_14_w = readTrainedWeights(conv2d_14_w_path.c_str(), 0,1024,1024,1,1); - std::string batch_normalization_27_gamma_path = dir_prefix + std::string("batch_normalization_27_gamma.bin"); - void* batch_normalization_27_gamma = readTrainedWeights(batch_normalization_27_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_beta_path = dir_prefix + std::string("batch_normalization_27_beta.bin"); - void* batch_normalization_27_beta = readTrainedWeights(batch_normalization_27_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_mean_path = dir_prefix + std::string("batch_normalization_27_mean.bin"); - void* batch_normalization_27_mean = readTrainedWeights(batch_normalization_27_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_variance_path = dir_prefix + std::string("batch_normalization_27_variance.bin"); - void* batch_normalization_27_variance = readTrainedWeights(batch_normalization_27_variance_path.c_str(), 0,1,1024,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,1024,10); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,10,1,1); - - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.9892114, 2.126797, conv2d_1_w, -2.196306920051575, 1.347581704139706, NULL, 0, 0, 1, 1, 1, 1, -1, 0, -1, -60.89275047302246, 51.99256916046146, 9); - void* var_1 = tensorHalfBatchNorm(var_0, batch_normalization_1_gamma, batch_normalization_1_beta, batch_normalization_1_mean, batch_normalization_1_variance, 0.001); - void* var_2 = tensorRelu(var_1); - void* var_3 = tensorConvolution(var_2, depthwise_conv2d_1_w, 1, 1, 1, 1, 1, 32); - void* var_4 = tensorHalfBatchNorm(var_3, batch_normalization_2_gamma, batch_normalization_2_beta, batch_normalization_2_mean, batch_normalization_2_variance, 0.001); - void* var_5 = tensorRelu(var_4); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 5.713541553974245, conv2d_2_w, -0.9317721160650253, 1.0774258937835774, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -6.518589503288269, 6.810842518806449, 9); - void* var_7 = tensorHalfBatchNorm(var_6, batch_normalization_3_gamma, batch_normalization_3_beta, batch_normalization_3_mean, batch_normalization_3_variance, 0.001); - void* var_8 = tensorRelu(var_7); - void* var_9 = tensorConvolution(var_8, depthwise_conv2d_2_w, 1, 1, 2, 2, 1, 64); - void* var_10 = tensorHalfBatchNorm(var_9, batch_normalization_4_gamma, batch_normalization_4_beta, batch_normalization_4_mean, batch_normalization_4_variance, 0.001); - void* var_11 = tensorRelu(var_10); - void* var_12 = ConvLayer_PROMISE(var_11, 0.0, 4.932139402866376, conv2d_3_w, -0.5316544661521911, 0.5753790403604531, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.482631235122681, 3.96730119752885, 9); - void* var_13 = tensorHalfBatchNorm(var_12, batch_normalization_5_gamma, batch_normalization_5_beta, batch_normalization_5_mean, batch_normalization_5_variance, 0.001); - void* var_14 = tensorRelu(var_13); - void* var_15 = tensorConvolution(var_14, depthwise_conv2d_3_w, 1, 1, 1, 1, 1, 128); - void* var_16 = tensorHalfBatchNorm(var_15, batch_normalization_6_gamma, batch_normalization_6_beta, batch_normalization_6_mean, batch_normalization_6_variance, 0.001); - void* var_17 = tensorRelu(var_16); - void* var_18 = ConvLayer_PROMISE(var_17, 0.0, 4.103263397693674, conv2d_4_w, -0.36234098821878435, 0.4076913900375366, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.04261828327179, 3.88677932929993, 9); - void* var_19 = tensorHalfBatchNorm(var_18, batch_normalization_7_gamma, batch_normalization_7_beta, batch_normalization_7_mean, batch_normalization_7_variance, 0.001); - void* var_20 = tensorRelu(var_19); - void* var_21 = tensorConvolution(var_20, depthwise_conv2d_4_w, 1, 1, 2, 2, 1, 128); - void* var_22 = tensorHalfBatchNorm(var_21, batch_normalization_8_gamma, batch_normalization_8_beta, batch_normalization_8_mean, batch_normalization_8_variance, 0.001); - void* var_23 = tensorRelu(var_22); - void* var_24 = ConvLayer_PROMISE(var_23, 0.0, 5.383221302509475, conv2d_5_w, -0.3131200549006462, 0.29357679939270065, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -5.921469215393066, 4.338679324150087, 9); - void* var_25 = tensorHalfBatchNorm(var_24, batch_normalization_9_gamma, batch_normalization_9_beta, batch_normalization_9_mean, batch_normalization_9_variance, 0.001); - void* var_26 = tensorRelu(var_25); - void* var_27 = tensorConvolution(var_26, depthwise_conv2d_5_w, 1, 1, 1, 1, 1, 256); - void* var_28 = tensorHalfBatchNorm(var_27, batch_normalization_10_gamma, batch_normalization_10_beta, batch_normalization_10_mean, batch_normalization_10_variance, 0.001); - void* var_29 = tensorRelu(var_28); - void* var_30 = ConvLayer_PROMISE(var_29, 0.0, 4.316738154411368, conv2d_6_w, -0.23299247801303866, 0.2580290257930756, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.207789947509766, 3.932436970710759, 9); - void* var_31 = tensorHalfBatchNorm(var_30, batch_normalization_11_gamma, batch_normalization_11_beta, batch_normalization_11_mean, batch_normalization_11_variance, 0.001); - void* var_32 = tensorRelu(var_31); - void* var_33 = tensorConvolution(var_32, depthwise_conv2d_6_w, 1, 1, 2, 2, 1, 256); - void* var_34 = tensorHalfBatchNorm(var_33, batch_normalization_12_gamma, batch_normalization_12_beta, batch_normalization_12_mean, batch_normalization_12_variance, 0.001); - void* var_35 = tensorRelu(var_34); - void* var_36 = ConvLayer_PROMISE(var_35, 0.0, 5.830408106803901, conv2d_7_w, -0.20233777219057084, 0.18998308175802117, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -6.298286915779113, 4.848135117530843, 9); - void* var_37 = tensorHalfBatchNorm(var_36, batch_normalization_13_gamma, batch_normalization_13_beta, batch_normalization_13_mean, batch_normalization_13_variance, 0.001); - void* var_38 = tensorRelu(var_37); - void* var_39 = tensorConvolution(var_38, depthwise_conv2d_7_w, 1, 1, 1, 1, 1, 512); - void* var_40 = tensorHalfBatchNorm(var_39, batch_normalization_14_gamma, batch_normalization_14_beta, batch_normalization_14_mean, batch_normalization_14_variance, 0.001); - void* var_41 = tensorRelu(var_40); - void* var_42 = ConvLayer_PROMISE(var_41, 0.0, 4.446417809963227, conv2d_8_w, -0.17442735651135444, 0.17695830866694454, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.347910885810852, 3.6144364695549145, 9); - void* var_43 = tensorHalfBatchNorm(var_42, batch_normalization_15_gamma, batch_normalization_15_beta, batch_normalization_15_mean, batch_normalization_15_variance, 0.001); - void* var_44 = tensorRelu(var_43); - void* var_45 = tensorConvolution(var_44, depthwise_conv2d_8_w, 1, 1, 1, 1, 1, 512); - void* var_46 = tensorHalfBatchNorm(var_45, batch_normalization_16_gamma, batch_normalization_16_beta, batch_normalization_16_mean, batch_normalization_16_variance, 0.001); - void* var_47 = tensorRelu(var_46); - void* var_48 = ConvLayer_PROMISE(var_47, 0.0, 4.518095604896667, conv2d_9_w, -0.14546796187758446, 0.15256431668996823, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -3.0287702755928043, 2.9487365779876953, 9); - void* var_49 = tensorHalfBatchNorm(var_48, batch_normalization_17_gamma, batch_normalization_17_beta, batch_normalization_17_mean, batch_normalization_17_variance, 0.001); - void* var_50 = tensorRelu(var_49); - void* var_51 = tensorConvolution(var_50, depthwise_conv2d_9_w, 1, 1, 1, 1, 1, 512); - void* var_52 = tensorHalfBatchNorm(var_51, batch_normalization_18_gamma, batch_normalization_18_beta, batch_normalization_18_mean, batch_normalization_18_variance, 0.001); - void* var_53 = tensorRelu(var_52); - void* var_54 = ConvLayer_PROMISE(var_53, 0.0, 6.348575634956407, conv2d_10_w, -0.13025874522328376, 0.13558243343234128, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.2293100805282595, 3.5315046372413645, 9); - void* var_55 = tensorHalfBatchNorm(var_54, batch_normalization_19_gamma, batch_normalization_19_beta, batch_normalization_19_mean, batch_normalization_19_variance, 0.001); - void* var_56 = tensorRelu(var_55); - void* var_57 = tensorConvolution(var_56, depthwise_conv2d_10_w, 1, 1, 1, 1, 1, 512); - void* var_58 = tensorHalfBatchNorm(var_57, batch_normalization_20_gamma, batch_normalization_20_beta, batch_normalization_20_mean, batch_normalization_20_variance, 0.001); - void* var_59 = tensorRelu(var_58); - void* var_60 = ConvLayer_PROMISE(var_59, 0.0, 5.221003110408843, conv2d_11_w, -0.11900172759592534, 0.12536374783515936, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.038203780174255, 4.004009407043483, 9); - void* var_61 = tensorHalfBatchNorm(var_60, batch_normalization_21_gamma, batch_normalization_21_beta, batch_normalization_21_mean, batch_normalization_21_variance, 0.001); - void* var_62 = tensorRelu(var_61); - void* var_63 = tensorConvolution(var_62, depthwise_conv2d_11_w, 1, 1, 1, 1, 1, 512); - void* var_64 = tensorHalfBatchNorm(var_63, batch_normalization_22_gamma, batch_normalization_22_beta, batch_normalization_22_mean, batch_normalization_22_variance, 0.001); - void* var_65 = tensorRelu(var_64); - void* var_66 = ConvLayer_PROMISE(var_65, 0.0, 5.732498347759442, conv2d_12_w, -0.10839721685647964, 0.11625668607652187, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -3.3111015114784244, 4.462933233261136, 9); - void* var_67 = tensorHalfBatchNorm(var_66, batch_normalization_23_gamma, batch_normalization_23_beta, batch_normalization_23_mean, batch_normalization_23_variance, 0.001); - void* var_68 = tensorRelu(var_67); - void* var_69 = tensorConvolution(var_68, depthwise_conv2d_12_w, 1, 1, 2, 2, 1, 512); - void* var_70 = tensorHalfBatchNorm(var_69, batch_normalization_24_gamma, batch_normalization_24_beta, batch_normalization_24_mean, batch_normalization_24_variance, 0.001); - void* var_71 = tensorHalfRelu(var_70); - void* var_72 = ConvLayer_PROMISE(var_71, 0.0, 7.240498211860681, conv2d_13_w, -0.08623744961619377, 0.08859449951350662, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.175431394577027, 6.2043294754027345, 9); - void* var_73 = tensorHalfBatchNorm(var_72, batch_normalization_25_gamma, batch_normalization_25_beta, batch_normalization_25_mean, batch_normalization_25_variance, 0.001); - void* var_74 = tensorHalfRelu(var_73); - void* var_75 = tensorConvolution(var_74, depthwise_conv2d_13_w, 1, 1, 1, 1, 1, 1024); - void* var_76 = tensorHalfBatchNorm(var_75, batch_normalization_26_gamma, batch_normalization_26_beta, batch_normalization_26_mean, batch_normalization_26_variance, 0.001); - void* var_77 = tensorRelu(var_76); - void* var_78 = ConvLayer_PROMISE(var_77, 0.0, 7.813958834648251, conv2d_14_w, -0.06813025139272214, 0.07002027779817581, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -10.920566423416137, 2.6442912578582534, 9); - void* var_79 = tensorHalfBatchNorm(var_78, batch_normalization_27_gamma, batch_normalization_27_beta, batch_normalization_27_mean, batch_normalization_27_variance, 0.001); - void* var_80 = tensorHalfRelu(var_79); - void* var_81 = tensorHalfPooling(var_80,1,2,2,0,0,2,2); - void* var_82 = FCLayer_PROMISE(var_81, 0.0, 2.8692066650391013, dense_1_w, -0.22301019695401192, 0.1442659378200768, dense_1_b, -0.1654396, 0.23336112, -1, -12.245949958801269, 23.80532513427739, 9); - void* var_83 = tensorSoftmax(var_82); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_83); - final_accuracy += accuracy; - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_83, classConfs, predictedLabels, relative_start, relative_end); - } - - - freeBatchMemory(); - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - } - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_shallow_piped.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_shallow_piped.cc deleted file mode 100644 index 3dffdffcf1..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_shallow_piped.cc +++ /dev/null @@ -1,313 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 500; - int offset = 5000; - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - llvm_hpvm_initTensorRt(0); - - std::string dir_prefix = std::string("../model_params/mobilenet_shallow/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,32,3,3,3); - std::string batch_normalization_1_gamma_path = dir_prefix + std::string("batch_normalization_1_gamma.bin"); - void* batch_normalization_1_gamma = readTrainedWeights(batch_normalization_1_gamma_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_1_beta_path = dir_prefix + std::string("batch_normalization_1_beta.bin"); - void* batch_normalization_1_beta = readTrainedWeights(batch_normalization_1_beta_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_1_mean_path = dir_prefix + std::string("batch_normalization_1_mean.bin"); - void* batch_normalization_1_mean = readTrainedWeights(batch_normalization_1_mean_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_1_variance_path = dir_prefix + std::string("batch_normalization_1_variance.bin"); - void* batch_normalization_1_variance = readTrainedWeights(batch_normalization_1_variance_path.c_str(), 0,1,32,1,1); - std::string depthwise_conv2d_1_w_path = dir_prefix + std::string("depthwise_conv2d_1_w.bin"); - void* depthwise_conv2d_1_w = readTrainedWeights(depthwise_conv2d_1_w_path.c_str(), 0,32,1,3,3); - std::string batch_normalization_2_gamma_path = dir_prefix + std::string("batch_normalization_2_gamma.bin"); - void* batch_normalization_2_gamma = readTrainedWeights(batch_normalization_2_gamma_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_2_beta_path = dir_prefix + std::string("batch_normalization_2_beta.bin"); - void* batch_normalization_2_beta = readTrainedWeights(batch_normalization_2_beta_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_2_mean_path = dir_prefix + std::string("batch_normalization_2_mean.bin"); - void* batch_normalization_2_mean = readTrainedWeights(batch_normalization_2_mean_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_2_variance_path = dir_prefix + std::string("batch_normalization_2_variance.bin"); - void* batch_normalization_2_variance = readTrainedWeights(batch_normalization_2_variance_path.c_str(), 0,1,32,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,32,1,1); - std::string batch_normalization_3_gamma_path = dir_prefix + std::string("batch_normalization_3_gamma.bin"); - void* batch_normalization_3_gamma = readTrainedWeights(batch_normalization_3_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_beta_path = dir_prefix + std::string("batch_normalization_3_beta.bin"); - void* batch_normalization_3_beta = readTrainedWeights(batch_normalization_3_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_mean_path = dir_prefix + std::string("batch_normalization_3_mean.bin"); - void* batch_normalization_3_mean = readTrainedWeights(batch_normalization_3_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_variance_path = dir_prefix + std::string("batch_normalization_3_variance.bin"); - void* batch_normalization_3_variance = readTrainedWeights(batch_normalization_3_variance_path.c_str(), 0,1,64,1,1); - std::string depthwise_conv2d_2_w_path = dir_prefix + std::string("depthwise_conv2d_2_w.bin"); - void* depthwise_conv2d_2_w = readTrainedWeights(depthwise_conv2d_2_w_path.c_str(), 0,64,1,3,3); - std::string batch_normalization_4_gamma_path = dir_prefix + std::string("batch_normalization_4_gamma.bin"); - void* batch_normalization_4_gamma = readTrainedWeights(batch_normalization_4_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_4_beta_path = dir_prefix + std::string("batch_normalization_4_beta.bin"); - void* batch_normalization_4_beta = readTrainedWeights(batch_normalization_4_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_4_mean_path = dir_prefix + std::string("batch_normalization_4_mean.bin"); - void* batch_normalization_4_mean = readTrainedWeights(batch_normalization_4_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_4_variance_path = dir_prefix + std::string("batch_normalization_4_variance.bin"); - void* batch_normalization_4_variance = readTrainedWeights(batch_normalization_4_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,128,64,1,1); - std::string batch_normalization_5_gamma_path = dir_prefix + std::string("batch_normalization_5_gamma.bin"); - void* batch_normalization_5_gamma = readTrainedWeights(batch_normalization_5_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_5_beta_path = dir_prefix + std::string("batch_normalization_5_beta.bin"); - void* batch_normalization_5_beta = readTrainedWeights(batch_normalization_5_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_5_mean_path = dir_prefix + std::string("batch_normalization_5_mean.bin"); - void* batch_normalization_5_mean = readTrainedWeights(batch_normalization_5_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_5_variance_path = dir_prefix + std::string("batch_normalization_5_variance.bin"); - void* batch_normalization_5_variance = readTrainedWeights(batch_normalization_5_variance_path.c_str(), 0,1,128,1,1); - std::string depthwise_conv2d_3_w_path = dir_prefix + std::string("depthwise_conv2d_3_w.bin"); - void* depthwise_conv2d_3_w = readTrainedWeights(depthwise_conv2d_3_w_path.c_str(), 0,128,1,3,3); - std::string batch_normalization_6_gamma_path = dir_prefix + std::string("batch_normalization_6_gamma.bin"); - void* batch_normalization_6_gamma = readTrainedWeights(batch_normalization_6_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_6_beta_path = dir_prefix + std::string("batch_normalization_6_beta.bin"); - void* batch_normalization_6_beta = readTrainedWeights(batch_normalization_6_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_6_mean_path = dir_prefix + std::string("batch_normalization_6_mean.bin"); - void* batch_normalization_6_mean = readTrainedWeights(batch_normalization_6_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_6_variance_path = dir_prefix + std::string("batch_normalization_6_variance.bin"); - void* batch_normalization_6_variance = readTrainedWeights(batch_normalization_6_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,128,128,1,1); - std::string batch_normalization_7_gamma_path = dir_prefix + std::string("batch_normalization_7_gamma.bin"); - void* batch_normalization_7_gamma = readTrainedWeights(batch_normalization_7_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_7_beta_path = dir_prefix + std::string("batch_normalization_7_beta.bin"); - void* batch_normalization_7_beta = readTrainedWeights(batch_normalization_7_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_7_mean_path = dir_prefix + std::string("batch_normalization_7_mean.bin"); - void* batch_normalization_7_mean = readTrainedWeights(batch_normalization_7_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_7_variance_path = dir_prefix + std::string("batch_normalization_7_variance.bin"); - void* batch_normalization_7_variance = readTrainedWeights(batch_normalization_7_variance_path.c_str(), 0,1,128,1,1); - std::string depthwise_conv2d_4_w_path = dir_prefix + std::string("depthwise_conv2d_4_w.bin"); - void* depthwise_conv2d_4_w = readTrainedWeights(depthwise_conv2d_4_w_path.c_str(), 0,128,1,3,3); - std::string batch_normalization_8_gamma_path = dir_prefix + std::string("batch_normalization_8_gamma.bin"); - void* batch_normalization_8_gamma = readTrainedWeights(batch_normalization_8_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_8_beta_path = dir_prefix + std::string("batch_normalization_8_beta.bin"); - void* batch_normalization_8_beta = readTrainedWeights(batch_normalization_8_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_8_mean_path = dir_prefix + std::string("batch_normalization_8_mean.bin"); - void* batch_normalization_8_mean = readTrainedWeights(batch_normalization_8_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_8_variance_path = dir_prefix + std::string("batch_normalization_8_variance.bin"); - void* batch_normalization_8_variance = readTrainedWeights(batch_normalization_8_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,128,1,1); - std::string batch_normalization_9_gamma_path = dir_prefix + std::string("batch_normalization_9_gamma.bin"); - void* batch_normalization_9_gamma = readTrainedWeights(batch_normalization_9_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_9_beta_path = dir_prefix + std::string("batch_normalization_9_beta.bin"); - void* batch_normalization_9_beta = readTrainedWeights(batch_normalization_9_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_9_mean_path = dir_prefix + std::string("batch_normalization_9_mean.bin"); - void* batch_normalization_9_mean = readTrainedWeights(batch_normalization_9_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_9_variance_path = dir_prefix + std::string("batch_normalization_9_variance.bin"); - void* batch_normalization_9_variance = readTrainedWeights(batch_normalization_9_variance_path.c_str(), 0,1,256,1,1); - std::string depthwise_conv2d_5_w_path = dir_prefix + std::string("depthwise_conv2d_5_w.bin"); - void* depthwise_conv2d_5_w = readTrainedWeights(depthwise_conv2d_5_w_path.c_str(), 0,256,1,3,3); - std::string batch_normalization_10_gamma_path = dir_prefix + std::string("batch_normalization_10_gamma.bin"); - void* batch_normalization_10_gamma = readTrainedWeights(batch_normalization_10_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_10_beta_path = dir_prefix + std::string("batch_normalization_10_beta.bin"); - void* batch_normalization_10_beta = readTrainedWeights(batch_normalization_10_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_10_mean_path = dir_prefix + std::string("batch_normalization_10_mean.bin"); - void* batch_normalization_10_mean = readTrainedWeights(batch_normalization_10_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_10_variance_path = dir_prefix + std::string("batch_normalization_10_variance.bin"); - - void* batch_normalization_10_variance = readTrainedWeights(batch_normalization_10_variance_path.c_str(), 0,1,256,1,1); - - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,256,256,1,1); - std::string batch_normalization_11_gamma_path = dir_prefix + std::string("batch_normalization_11_gamma.bin"); - void* batch_normalization_11_gamma = readTrainedWeights(batch_normalization_11_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_beta_path = dir_prefix + std::string("batch_normalization_11_beta.bin"); - void* batch_normalization_11_beta = readTrainedWeights(batch_normalization_11_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_mean_path = dir_prefix + std::string("batch_normalization_11_mean.bin"); - void* batch_normalization_11_mean = readTrainedWeights(batch_normalization_11_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_variance_path = dir_prefix + std::string("batch_normalization_11_variance.bin"); - void* batch_normalization_11_variance = readTrainedWeights(batch_normalization_11_variance_path.c_str(), 0,1,256,1,1); - std::string depthwise_conv2d_6_w_path = dir_prefix + std::string("depthwise_conv2d_6_w.bin"); - void* depthwise_conv2d_6_w = readTrainedWeights(depthwise_conv2d_6_w_path.c_str(), 0,256,1,3,3); - std::string batch_normalization_12_gamma_path = dir_prefix + std::string("batch_normalization_12_gamma.bin"); - void* batch_normalization_12_gamma = readTrainedWeights(batch_normalization_12_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_12_beta_path = dir_prefix + std::string("batch_normalization_12_beta.bin"); - void* batch_normalization_12_beta = readTrainedWeights(batch_normalization_12_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_12_mean_path = dir_prefix + std::string("batch_normalization_12_mean.bin"); - void* batch_normalization_12_mean = readTrainedWeights(batch_normalization_12_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_12_variance_path = dir_prefix + std::string("batch_normalization_12_variance.bin"); - void* batch_normalization_12_variance = readTrainedWeights(batch_normalization_12_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,512,256,1,1); - std::string batch_normalization_13_gamma_path = dir_prefix + std::string("batch_normalization_13_gamma.bin"); - void* batch_normalization_13_gamma = readTrainedWeights(batch_normalization_13_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_13_beta_path = dir_prefix + std::string("batch_normalization_13_beta.bin"); - void* batch_normalization_13_beta = readTrainedWeights(batch_normalization_13_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_13_mean_path = dir_prefix + std::string("batch_normalization_13_mean.bin"); - void* batch_normalization_13_mean = readTrainedWeights(batch_normalization_13_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_13_variance_path = dir_prefix + std::string("batch_normalization_13_variance.bin"); - void* batch_normalization_13_variance = readTrainedWeights(batch_normalization_13_variance_path.c_str(), 0,1,512,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,2048,10); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,10,1,1); - - - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - // NOTE: Wait on signal from OpenTuner - stallOnOpenTunerSignal(); - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - for(int i = 0; i < batch_count; i++){ - - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.9892114, 2.126797, conv2d_1_w, -1.5164621164798737, 1.6472081774473288, NULL, 0, 0, 1, 1, 1, 1, -1, 0, -1, -9.868980642318725, 10.560956018447879, 9); - void* var_1 = tensorBatchNorm(var_0, batch_normalization_1_gamma, batch_normalization_1_beta, batch_normalization_1_mean, batch_normalization_1_variance, 0.001); - void* var_2 = tensorRelu(var_1); - void* var_3 = tensorConvolution(var_2, depthwise_conv2d_1_w, 1, 1, 1, 1, 1, 32); - void* var_4 = tensorBatchNorm(var_3, batch_normalization_2_gamma, batch_normalization_2_beta, batch_normalization_2_mean, batch_normalization_2_variance, 0.001); - void* var_5 = tensorRelu(var_4); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 6.821381127357554, conv2d_2_w, -1.1834390873908995, 1.2731596627235617, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -9.875998497009277, 7.51305247974393, 9); - void* var_7 = tensorBatchNorm(var_6, batch_normalization_3_gamma, batch_normalization_3_beta, batch_normalization_3_mean, batch_normalization_3_variance, 0.001); - void* var_8 = tensorRelu(var_7); - void* var_9 = tensorConvolution(var_8, depthwise_conv2d_2_w, 1, 1, 2, 2, 1, 64); - void* var_10 = tensorBatchNorm(var_9, batch_normalization_4_gamma, batch_normalization_4_beta, batch_normalization_4_mean, batch_normalization_4_variance, 0.001); - void* var_11 = tensorRelu(var_10); - void* var_12 = ConvLayer_PROMISE(var_11, 0.0, 4.826067455768602, conv2d_3_w, -0.599876856982708, 0.6812073457241064, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -5.633289833068848, 5.177892235755925, 9); - void* var_13 = tensorBatchNorm(var_12, batch_normalization_5_gamma, batch_normalization_5_beta, batch_normalization_5_mean, batch_normalization_5_variance, 0.001); - void* var_14 = tensorRelu(var_13); - void* var_15 = tensorConvolution(var_14, depthwise_conv2d_3_w, 1, 1, 1, 1, 1, 128); - void* var_16 = tensorBatchNorm(var_15, batch_normalization_6_gamma, batch_normalization_6_beta, batch_normalization_6_mean, batch_normalization_6_variance, 0.001); - void* var_17 = tensorRelu(var_16); - void* var_18 = ConvLayer_PROMISE(var_17, 0.0, 4.02646304416659, conv2d_4_w, -0.4555967862010002, 0.4942613914608956, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -5.316803941726685, 4.605850250244146, 9); - void* var_19 = tensorBatchNorm(var_18, batch_normalization_7_gamma, batch_normalization_7_beta, batch_normalization_7_mean, batch_normalization_7_variance, 0.001); - void* var_20 = tensorRelu(var_19); - void* var_21 = tensorConvolution(var_20, depthwise_conv2d_4_w, 1, 1, 2, 2, 1, 128); - void* var_22 = tensorBatchNorm(var_21, batch_normalization_8_gamma, batch_normalization_8_beta, batch_normalization_8_mean, batch_normalization_8_variance, 0.001); - void* var_23 = tensorRelu(var_22); - void* var_24 = ConvLayer_PROMISE(var_23, 0.0, 4.532649063110355, conv2d_5_w, -0.35657615590095515, 0.3382165088057521, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -6.1012511816024775, 4.3630500688553, 9); - void* var_25 = tensorBatchNorm(var_24, batch_normalization_9_gamma, batch_normalization_9_beta, batch_normalization_9_mean, batch_normalization_9_variance, 0.001); - void* var_26 = tensorRelu(var_25); - void* var_27 = tensorConvolution(var_26, depthwise_conv2d_5_w, 1, 1, 1, 1, 1, 256); - void* var_28 = tensorBatchNorm(var_27, batch_normalization_10_gamma, batch_normalization_10_beta, batch_normalization_10_mean, batch_normalization_10_variance, 0.001); - void* var_29 = tensorRelu(var_28); - void* var_30 = ConvLayer_PROMISE(var_29, 0.0, 3.9874704387188977, conv2d_6_w, -0.28502783328294756, 0.28604640334844594, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.243851703643799, 3.486250406742097, 9); - void* var_31 = tensorBatchNorm(var_30, batch_normalization_11_gamma, batch_normalization_11_beta, batch_normalization_11_mean, batch_normalization_11_variance, 0.001); - void* var_32 = tensorRelu(var_31); - void* var_33 = tensorConvolution(var_32, depthwise_conv2d_6_w, 1, 1, 2, 2, 1, 256); - void* var_34 = tensorBatchNorm(var_33, batch_normalization_12_gamma, batch_normalization_12_beta, batch_normalization_12_mean, batch_normalization_12_variance, 0.001); - void* var_35 = tensorRelu(var_34); - void* var_36 = ConvLayer_PROMISE(var_35, 0.0, 6.563065901756522, conv2d_7_w, -0.18946402323246003, 0.19012390717864017, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.938115713119507, 3.538363476753238, 9); - void* var_37 = tensorBatchNorm(var_36, batch_normalization_13_gamma, batch_normalization_13_beta, batch_normalization_13_mean, batch_normalization_13_variance, 0.001); - void* var_38 = tensorRelu(var_37); - void* var_39 = tensorPooling(var_38,1,2,2,0,0,2,2); - void* var_40 = FCLayer_PROMISE(var_39, 0.0, 1.8908388000727185, dense_1_w, -0.35140394401550296, 0.422872786462307, dense_1_b, -0.23878151, 0.26507422, -1, -14.630816223144532, 27.27252123260504, 9); - void* var_41 = tensorSoftmax(var_40); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_41); - final_accuracy += accuracy; - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_41, classConfs, predictedLabels, relative_start, relative_end); - } - - - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - - // NOTE: Signal back to OpenTuner - signalPipeToOpenTuner(); - } - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_shallow_promise.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_shallow_promise.cc deleted file mode 100644 index 757f950249..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/mobilenet_shallow_promise.cc +++ /dev/null @@ -1,304 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 1000; - int offset = 5000; - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - - llvm_hpvm_initTensorRt(0); - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - std::string dir_prefix = std::string("../model_params/mobilenet_shallow/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - for(int i = 0; i < batch_count; i++){ - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,32,3,3,3); - std::string batch_normalization_1_gamma_path = dir_prefix + std::string("batch_normalization_1_gamma.bin"); - void* batch_normalization_1_gamma = readTrainedWeights(batch_normalization_1_gamma_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_1_beta_path = dir_prefix + std::string("batch_normalization_1_beta.bin"); - void* batch_normalization_1_beta = readTrainedWeights(batch_normalization_1_beta_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_1_mean_path = dir_prefix + std::string("batch_normalization_1_mean.bin"); - void* batch_normalization_1_mean = readTrainedWeights(batch_normalization_1_mean_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_1_variance_path = dir_prefix + std::string("batch_normalization_1_variance.bin"); - void* batch_normalization_1_variance = readTrainedWeights(batch_normalization_1_variance_path.c_str(), 0,1,32,1,1); - std::string depthwise_conv2d_1_w_path = dir_prefix + std::string("depthwise_conv2d_1_w.bin"); - void* depthwise_conv2d_1_w = readTrainedWeights(depthwise_conv2d_1_w_path.c_str(), 0,32,1,3,3); - std::string batch_normalization_2_gamma_path = dir_prefix + std::string("batch_normalization_2_gamma.bin"); - void* batch_normalization_2_gamma = readTrainedWeights(batch_normalization_2_gamma_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_2_beta_path = dir_prefix + std::string("batch_normalization_2_beta.bin"); - void* batch_normalization_2_beta = readTrainedWeights(batch_normalization_2_beta_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_2_mean_path = dir_prefix + std::string("batch_normalization_2_mean.bin"); - void* batch_normalization_2_mean = readTrainedWeights(batch_normalization_2_mean_path.c_str(), 0,1,32,1,1); - std::string batch_normalization_2_variance_path = dir_prefix + std::string("batch_normalization_2_variance.bin"); - void* batch_normalization_2_variance = readTrainedWeights(batch_normalization_2_variance_path.c_str(), 0,1,32,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,32,1,1); - std::string batch_normalization_3_gamma_path = dir_prefix + std::string("batch_normalization_3_gamma.bin"); - void* batch_normalization_3_gamma = readTrainedWeights(batch_normalization_3_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_beta_path = dir_prefix + std::string("batch_normalization_3_beta.bin"); - void* batch_normalization_3_beta = readTrainedWeights(batch_normalization_3_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_mean_path = dir_prefix + std::string("batch_normalization_3_mean.bin"); - void* batch_normalization_3_mean = readTrainedWeights(batch_normalization_3_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_variance_path = dir_prefix + std::string("batch_normalization_3_variance.bin"); - void* batch_normalization_3_variance = readTrainedWeights(batch_normalization_3_variance_path.c_str(), 0,1,64,1,1); - std::string depthwise_conv2d_2_w_path = dir_prefix + std::string("depthwise_conv2d_2_w.bin"); - void* depthwise_conv2d_2_w = readTrainedWeights(depthwise_conv2d_2_w_path.c_str(), 0,64,1,3,3); - std::string batch_normalization_4_gamma_path = dir_prefix + std::string("batch_normalization_4_gamma.bin"); - void* batch_normalization_4_gamma = readTrainedWeights(batch_normalization_4_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_4_beta_path = dir_prefix + std::string("batch_normalization_4_beta.bin"); - void* batch_normalization_4_beta = readTrainedWeights(batch_normalization_4_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_4_mean_path = dir_prefix + std::string("batch_normalization_4_mean.bin"); - void* batch_normalization_4_mean = readTrainedWeights(batch_normalization_4_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_4_variance_path = dir_prefix + std::string("batch_normalization_4_variance.bin"); - void* batch_normalization_4_variance = readTrainedWeights(batch_normalization_4_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,128,64,1,1); - std::string batch_normalization_5_gamma_path = dir_prefix + std::string("batch_normalization_5_gamma.bin"); - void* batch_normalization_5_gamma = readTrainedWeights(batch_normalization_5_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_5_beta_path = dir_prefix + std::string("batch_normalization_5_beta.bin"); - void* batch_normalization_5_beta = readTrainedWeights(batch_normalization_5_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_5_mean_path = dir_prefix + std::string("batch_normalization_5_mean.bin"); - void* batch_normalization_5_mean = readTrainedWeights(batch_normalization_5_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_5_variance_path = dir_prefix + std::string("batch_normalization_5_variance.bin"); - void* batch_normalization_5_variance = readTrainedWeights(batch_normalization_5_variance_path.c_str(), 0,1,128,1,1); - std::string depthwise_conv2d_3_w_path = dir_prefix + std::string("depthwise_conv2d_3_w.bin"); - void* depthwise_conv2d_3_w = readTrainedWeights(depthwise_conv2d_3_w_path.c_str(), 0,128,1,3,3); - std::string batch_normalization_6_gamma_path = dir_prefix + std::string("batch_normalization_6_gamma.bin"); - void* batch_normalization_6_gamma = readTrainedWeights(batch_normalization_6_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_6_beta_path = dir_prefix + std::string("batch_normalization_6_beta.bin"); - void* batch_normalization_6_beta = readTrainedWeights(batch_normalization_6_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_6_mean_path = dir_prefix + std::string("batch_normalization_6_mean.bin"); - void* batch_normalization_6_mean = readTrainedWeights(batch_normalization_6_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_6_variance_path = dir_prefix + std::string("batch_normalization_6_variance.bin"); - void* batch_normalization_6_variance = readTrainedWeights(batch_normalization_6_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,128,128,1,1); - std::string batch_normalization_7_gamma_path = dir_prefix + std::string("batch_normalization_7_gamma.bin"); - void* batch_normalization_7_gamma = readTrainedWeights(batch_normalization_7_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_7_beta_path = dir_prefix + std::string("batch_normalization_7_beta.bin"); - void* batch_normalization_7_beta = readTrainedWeights(batch_normalization_7_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_7_mean_path = dir_prefix + std::string("batch_normalization_7_mean.bin"); - void* batch_normalization_7_mean = readTrainedWeights(batch_normalization_7_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_7_variance_path = dir_prefix + std::string("batch_normalization_7_variance.bin"); - void* batch_normalization_7_variance = readTrainedWeights(batch_normalization_7_variance_path.c_str(), 0,1,128,1,1); - std::string depthwise_conv2d_4_w_path = dir_prefix + std::string("depthwise_conv2d_4_w.bin"); - void* depthwise_conv2d_4_w = readTrainedWeights(depthwise_conv2d_4_w_path.c_str(), 0,128,1,3,3); - std::string batch_normalization_8_gamma_path = dir_prefix + std::string("batch_normalization_8_gamma.bin"); - void* batch_normalization_8_gamma = readTrainedWeights(batch_normalization_8_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_8_beta_path = dir_prefix + std::string("batch_normalization_8_beta.bin"); - void* batch_normalization_8_beta = readTrainedWeights(batch_normalization_8_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_8_mean_path = dir_prefix + std::string("batch_normalization_8_mean.bin"); - void* batch_normalization_8_mean = readTrainedWeights(batch_normalization_8_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_8_variance_path = dir_prefix + std::string("batch_normalization_8_variance.bin"); - void* batch_normalization_8_variance = readTrainedWeights(batch_normalization_8_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,128,1,1); - std::string batch_normalization_9_gamma_path = dir_prefix + std::string("batch_normalization_9_gamma.bin"); - void* batch_normalization_9_gamma = readTrainedWeights(batch_normalization_9_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_9_beta_path = dir_prefix + std::string("batch_normalization_9_beta.bin"); - void* batch_normalization_9_beta = readTrainedWeights(batch_normalization_9_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_9_mean_path = dir_prefix + std::string("batch_normalization_9_mean.bin"); - void* batch_normalization_9_mean = readTrainedWeights(batch_normalization_9_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_9_variance_path = dir_prefix + std::string("batch_normalization_9_variance.bin"); - void* batch_normalization_9_variance = readTrainedWeights(batch_normalization_9_variance_path.c_str(), 0,1,256,1,1); - std::string depthwise_conv2d_5_w_path = dir_prefix + std::string("depthwise_conv2d_5_w.bin"); - void* depthwise_conv2d_5_w = readTrainedWeights(depthwise_conv2d_5_w_path.c_str(), 0,256,1,3,3); - std::string batch_normalization_10_gamma_path = dir_prefix + std::string("batch_normalization_10_gamma.bin"); - void* batch_normalization_10_gamma = readTrainedWeights(batch_normalization_10_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_10_beta_path = dir_prefix + std::string("batch_normalization_10_beta.bin"); - void* batch_normalization_10_beta = readTrainedWeights(batch_normalization_10_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_10_mean_path = dir_prefix + std::string("batch_normalization_10_mean.bin"); - void* batch_normalization_10_mean = readTrainedWeights(batch_normalization_10_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_10_variance_path = dir_prefix + std::string("batch_normalization_10_variance.bin"); - void* batch_normalization_10_variance = readTrainedWeights(batch_normalization_10_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,256,256,1,1); - std::string batch_normalization_11_gamma_path = dir_prefix + std::string("batch_normalization_11_gamma.bin"); - void* batch_normalization_11_gamma = readTrainedWeights(batch_normalization_11_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_beta_path = dir_prefix + std::string("batch_normalization_11_beta.bin"); - void* batch_normalization_11_beta = readTrainedWeights(batch_normalization_11_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_mean_path = dir_prefix + std::string("batch_normalization_11_mean.bin"); - void* batch_normalization_11_mean = readTrainedWeights(batch_normalization_11_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_variance_path = dir_prefix + std::string("batch_normalization_11_variance.bin"); - void* batch_normalization_11_variance = readTrainedWeights(batch_normalization_11_variance_path.c_str(), 0,1,256,1,1); - std::string depthwise_conv2d_6_w_path = dir_prefix + std::string("depthwise_conv2d_6_w.bin"); - void* depthwise_conv2d_6_w = readTrainedWeights(depthwise_conv2d_6_w_path.c_str(), 0,256,1,3,3); - std::string batch_normalization_12_gamma_path = dir_prefix + std::string("batch_normalization_12_gamma.bin"); - void* batch_normalization_12_gamma = readTrainedWeights(batch_normalization_12_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_12_beta_path = dir_prefix + std::string("batch_normalization_12_beta.bin"); - void* batch_normalization_12_beta = readTrainedWeights(batch_normalization_12_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_12_mean_path = dir_prefix + std::string("batch_normalization_12_mean.bin"); - void* batch_normalization_12_mean = readTrainedWeights(batch_normalization_12_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_12_variance_path = dir_prefix + std::string("batch_normalization_12_variance.bin"); - void* batch_normalization_12_variance = readTrainedWeights(batch_normalization_12_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,512,256,1,1); - std::string batch_normalization_13_gamma_path = dir_prefix + std::string("batch_normalization_13_gamma.bin"); - void* batch_normalization_13_gamma = readTrainedWeights(batch_normalization_13_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_13_beta_path = dir_prefix + std::string("batch_normalization_13_beta.bin"); - void* batch_normalization_13_beta = readTrainedWeights(batch_normalization_13_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_13_mean_path = dir_prefix + std::string("batch_normalization_13_mean.bin"); - void* batch_normalization_13_mean = readTrainedWeights(batch_normalization_13_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_13_variance_path = dir_prefix + std::string("batch_normalization_13_variance.bin"); - void* batch_normalization_13_variance = readTrainedWeights(batch_normalization_13_variance_path.c_str(), 0,1,512,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,2048,10); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,10,1,1); - - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.9892114, 2.126797, conv2d_1_w, -1.5164621164798737, 1.6472081774473288, NULL, 0, 0, 1, 1, 1, 1, -1, 0, -1, -9.868980642318725, 10.560956018447879, 9); - void* var_1 = tensorBatchNorm(var_0, batch_normalization_1_gamma, batch_normalization_1_beta, batch_normalization_1_mean, batch_normalization_1_variance, 0.001); - void* var_2 = tensorRelu(var_1); - void* var_3 = tensorConvolution(var_2, depthwise_conv2d_1_w, 1, 1, 1, 1, 1, 32); - void* var_4 = tensorBatchNorm(var_3, batch_normalization_2_gamma, batch_normalization_2_beta, batch_normalization_2_mean, batch_normalization_2_variance, 0.001); - void* var_5 = tensorRelu(var_4); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 6.821381127357554, conv2d_2_w, -1.1834390873908995, 1.2731596627235617, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -9.875998497009277, 7.51305247974393, 9); - void* var_7 = tensorBatchNorm(var_6, batch_normalization_3_gamma, batch_normalization_3_beta, batch_normalization_3_mean, batch_normalization_3_variance, 0.001); - void* var_8 = tensorRelu(var_7); - void* var_9 = tensorConvolution(var_8, depthwise_conv2d_2_w, 1, 1, 2, 2, 1, 64); - void* var_10 = tensorBatchNorm(var_9, batch_normalization_4_gamma, batch_normalization_4_beta, batch_normalization_4_mean, batch_normalization_4_variance, 0.001); - void* var_11 = tensorRelu(var_10); - void* var_12 = ConvLayer_PROMISE(var_11, 0.0, 4.826067455768602, conv2d_3_w, -0.599876856982708, 0.6812073457241064, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -5.633289833068848, 5.177892235755925, 9); - void* var_13 = tensorBatchNorm(var_12, batch_normalization_5_gamma, batch_normalization_5_beta, batch_normalization_5_mean, batch_normalization_5_variance, 0.001); - void* var_14 = tensorRelu(var_13); - void* var_15 = tensorConvolution(var_14, depthwise_conv2d_3_w, 1, 1, 1, 1, 1, 128); - void* var_16 = tensorBatchNorm(var_15, batch_normalization_6_gamma, batch_normalization_6_beta, batch_normalization_6_mean, batch_normalization_6_variance, 0.001); - void* var_17 = tensorRelu(var_16); - void* var_18 = ConvLayer_PROMISE(var_17, 0.0, 4.02646304416659, conv2d_4_w, -0.4555967862010002, 0.4942613914608956, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -5.316803941726685, 4.605850250244146, 9); - void* var_19 = tensorBatchNorm(var_18, batch_normalization_7_gamma, batch_normalization_7_beta, batch_normalization_7_mean, batch_normalization_7_variance, 0.001); - void* var_20 = tensorRelu(var_19); - void* var_21 = tensorConvolution(var_20, depthwise_conv2d_4_w, 1, 1, 2, 2, 1, 128); - void* var_22 = tensorBatchNorm(var_21, batch_normalization_8_gamma, batch_normalization_8_beta, batch_normalization_8_mean, batch_normalization_8_variance, 0.001); - void* var_23 = tensorRelu(var_22); - void* var_24 = ConvLayer_PROMISE(var_23, 0.0, 4.532649063110355, conv2d_5_w, -0.35657615590095515, 0.3382165088057521, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -6.1012511816024775, 4.3630500688553, 9); - void* var_25 = tensorBatchNorm(var_24, batch_normalization_9_gamma, batch_normalization_9_beta, batch_normalization_9_mean, batch_normalization_9_variance, 0.001); - void* var_26 = tensorRelu(var_25); - void* var_27 = tensorConvolution(var_26, depthwise_conv2d_5_w, 1, 1, 1, 1, 1, 256); - void* var_28 = tensorBatchNorm(var_27, batch_normalization_10_gamma, batch_normalization_10_beta, batch_normalization_10_mean, batch_normalization_10_variance, 0.001); - void* var_29 = tensorRelu(var_28); - void* var_30 = ConvLayer_PROMISE(var_29, 0.0, 3.9874704387188977, conv2d_6_w, -0.28502783328294756, 0.28604640334844594, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.243851703643799, 3.486250406742097, 9); - void* var_31 = tensorBatchNorm(var_30, batch_normalization_11_gamma, batch_normalization_11_beta, batch_normalization_11_mean, batch_normalization_11_variance, 0.001); - void* var_32 = tensorRelu(var_31); - void* var_33 = tensorConvolution(var_32, depthwise_conv2d_6_w, 1, 1, 2, 2, 1, 256); - void* var_34 = tensorBatchNorm(var_33, batch_normalization_12_gamma, batch_normalization_12_beta, batch_normalization_12_mean, batch_normalization_12_variance, 0.001); - void* var_35 = tensorRelu(var_34); - void* var_36 = ConvLayer_PROMISE(var_35, 0.0, 6.563065901756522, conv2d_7_w, -0.18946402323246003, 0.19012390717864017, NULL, 0, 0, 0, 0, 1, 1, -1, 0, -1, -4.938115713119507, 3.538363476753238, 9); - void* var_37 = tensorBatchNorm(var_36, batch_normalization_13_gamma, batch_normalization_13_beta, batch_normalization_13_mean, batch_normalization_13_variance, 0.001); - void* var_38 = tensorRelu(var_37); - void* var_39 = tensorPooling(var_38,1,2,2,0,0,2,2); - void* var_40 = FCLayer_PROMISE(var_39, 0.0, 1.8908388000727185, dense_1_w, -0.35140394401550296, 0.422872786462307, dense_1_b, -0.23878151, 0.26507422, -1, -14.630816223144532, 27.27252123260504, 9); - void* var_41 = tensorSoftmax(var_40); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_41); - final_accuracy += accuracy; - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_41, classConfs, predictedLabels, relative_start, relative_end); - } - - - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - } - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet18_piped.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet18_piped.cc deleted file mode 100644 index 8446e1f258..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet18_piped.cc +++ /dev/null @@ -1,265 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 250; - int offset = 5000; - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - llvm_hpvm_initTensorRt(0); - - - std::string dir_prefix = std::string("../model_params/resnet18_cifar10/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,16,3,3,3); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,16,16,3,3); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,16,16,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,16,16,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,16,16,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,16,16,3,3); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,16,16,3,3); - std::string conv2d_7_b_path = dir_prefix + std::string("conv2d_7_b.bin"); - void* conv2d_7_b = readTrainedWeights(conv2d_7_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,32,16,3,3); - std::string conv2d_8_b_path = dir_prefix + std::string("conv2d_8_b.bin"); - void* conv2d_8_b = readTrainedWeights(conv2d_8_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,32,16,1,1); - std::string conv2d_10_b_path = dir_prefix + std::string("conv2d_10_b.bin"); - void* conv2d_10_b = readTrainedWeights(conv2d_10_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,32,32,3,3); - std::string conv2d_9_b_path = dir_prefix + std::string("conv2d_9_b.bin"); - void* conv2d_9_b = readTrainedWeights(conv2d_9_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,32,32,3,3); - std::string conv2d_11_b_path = dir_prefix + std::string("conv2d_11_b.bin"); - void* conv2d_11_b = readTrainedWeights(conv2d_11_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,32,32,3,3); - std::string conv2d_12_b_path = dir_prefix + std::string("conv2d_12_b.bin"); - void* conv2d_12_b = readTrainedWeights(conv2d_12_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,32,32,3,3); - std::string conv2d_13_b_path = dir_prefix + std::string("conv2d_13_b.bin"); - void* conv2d_13_b = readTrainedWeights(conv2d_13_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_14_w_path = dir_prefix + std::string("conv2d_14_w.bin"); - void* conv2d_14_w = readTrainedWeights(conv2d_14_w_path.c_str(), 0,32,32,3,3); - std::string conv2d_14_b_path = dir_prefix + std::string("conv2d_14_b.bin"); - void* conv2d_14_b = readTrainedWeights(conv2d_14_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_15_w_path = dir_prefix + std::string("conv2d_15_w.bin"); - void* conv2d_15_w = readTrainedWeights(conv2d_15_w_path.c_str(), 0,64,32,3,3); - std::string conv2d_15_b_path = dir_prefix + std::string("conv2d_15_b.bin"); - void* conv2d_15_b = readTrainedWeights(conv2d_15_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_17_w_path = dir_prefix + std::string("conv2d_17_w.bin"); - void* conv2d_17_w = readTrainedWeights(conv2d_17_w_path.c_str(), 0,64,32,1,1); - std::string conv2d_17_b_path = dir_prefix + std::string("conv2d_17_b.bin"); - void* conv2d_17_b = readTrainedWeights(conv2d_17_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_16_w_path = dir_prefix + std::string("conv2d_16_w.bin"); - void* conv2d_16_w = readTrainedWeights(conv2d_16_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_16_b_path = dir_prefix + std::string("conv2d_16_b.bin"); - void* conv2d_16_b = readTrainedWeights(conv2d_16_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_18_w_path = dir_prefix + std::string("conv2d_18_w.bin"); - void* conv2d_18_w = readTrainedWeights(conv2d_18_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_18_b_path = dir_prefix + std::string("conv2d_18_b.bin"); - void* conv2d_18_b = readTrainedWeights(conv2d_18_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_19_w_path = dir_prefix + std::string("conv2d_19_w.bin"); - void* conv2d_19_w = readTrainedWeights(conv2d_19_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_19_b_path = dir_prefix + std::string("conv2d_19_b.bin"); - void* conv2d_19_b = readTrainedWeights(conv2d_19_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_20_w_path = dir_prefix + std::string("conv2d_20_w.bin"); - void* conv2d_20_w = readTrainedWeights(conv2d_20_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_20_b_path = dir_prefix + std::string("conv2d_20_b.bin"); - void* conv2d_20_b = readTrainedWeights(conv2d_20_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_21_w_path = dir_prefix + std::string("conv2d_21_w.bin"); - void* conv2d_21_w = readTrainedWeights(conv2d_21_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_21_b_path = dir_prefix + std::string("conv2d_21_b.bin"); - void* conv2d_21_b = readTrainedWeights(conv2d_21_b_path.c_str(), 0,1,64,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,64,10); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,10,1,1); - - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - // NOTE: Wait on signal from OpenTuner - stallOnOpenTunerSignal(); - - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - for(int i = 0; i < batch_count; i++){ - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -0.5500815, 0.60786617, conv2d_1_w, -1.0248864, 1.2929907, conv2d_1_b, -0.36291853, 0.2533059, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.8791630274057383, 9); - void* var_1 = ConvLayer_PROMISE(var_0, 0.0, 0.8791630274057383, conv2d_2_w, -0.69884616, 0.71849966, conv2d_2_b, -0.2781147, 0.45571187, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.1859495645761484, 9); - void* var_2 = ConvLayer_PROMISE(var_1, 0.0, 1.1859495645761484, conv2d_3_w, -0.59568167, 0.7714691, conv2d_3_b, -0.8602873, 0.19743633, 1, 1, 1, 1, -1, 0, -1, -2.2316832554340365, 2.266301159858699, 9); - void* var_3 = tensorAdd(var_0, var_2); - void* var_4 = tensorRelu(var_3); - void* var_5 = ConvLayer_PROMISE(var_4, 0.0, 2.789569139480591, conv2d_4_w, -0.41976976, 0.43748936, conv2d_4_b, -0.7021962, 0.3033103, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.3341254055499974, 9); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 1.3341254055499974, conv2d_5_w, -0.46757826, 0.4635873, conv2d_5_b, -0.20662616, 0.1778044, 1, 1, 1, 1, -1, 0, -1, -0.9912706619501114, 1.0245310074090952, 9); - void* var_7 = tensorAdd(var_4, var_6); - void* var_8 = tensorRelu(var_7); - void* var_9 = ConvLayer_PROMISE(var_8, 0.0, 2.998989346027372, conv2d_6_w, -0.64404047, 0.45383143, conv2d_6_b, -0.819547, 0.38550296, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.2850778144597967, 9); - void* var_10 = ConvLayer_PROMISE(var_9, 0.0, 1.2850778144597967, conv2d_7_w, -0.41986948, 0.33654243, conv2d_7_b, -0.3563013, 0.22371122, 1, 1, 1, 1, -1, 0, -1, -1.2940701305866242, 0.7332147359848022, 9); - void* var_11 = tensorAdd(var_8, var_10); - void* var_12 = tensorRelu(var_11); - void* var_13 = ConvLayer_PROMISE(var_12, 0.0, 2.8626382386684384, conv2d_8_w, -0.4805263, 0.50655717, conv2d_8_b, -0.296758, 0.7742441, 1, 1, 2, 2, -1, 0, 1, 0.0, 3.6232483506202584, 9); - void* var_14 = ConvLayer_PROMISE(var_13, 0.0, 3.6232483506202584, conv2d_9_w, -0.52083415, 0.45517674, conv2d_9_b, -0.20242067, 0.8236838, 1, 1, 1, 1, -1, 0, -1, -6.319877154827118, 6.882811555862418, 9); - void* var_15 = ConvLayer_PROMISE(var_12, 0.0, 2.8626382386684384, conv2d_10_w, -0.5338656, 1.3395424, conv2d_10_b, -0.20242067, 0.8236838, 0, 0, 2, 2, -1, 0, -1, -0.9930689406394959, 2.8721754658222096, 9); - void* var_16 = tensorAdd(var_15, var_14); - void* var_17 = tensorRelu(var_16); - void* var_18 = ConvLayer_PROMISE(var_17, 0.0, 8.315858840942383, conv2d_11_w, -0.34429058, 0.43629733, conv2d_11_b, -1.0744808, 0.056708273, 1, 1, 1, 1, -1, 0, 1, 0.0, 2.6893706333637226, 9); - void* var_19 = ConvLayer_PROMISE(var_18, 0.0, 2.6893706333637226, conv2d_12_w, -0.30342352, 0.39493486, conv2d_12_b, -0.44630566, 0.6492069, 1, 1, 1, 1, -1, 0, -1, -1.8801953810453416, 1.714934362173068, 9); - void* var_20 = tensorAdd(var_17, var_19); - void* var_21 = tensorRelu(var_20); - void* var_22 = ConvLayer_PROMISE(var_21, 0.0, 8.381670951843262, conv2d_13_w, -0.38351893, 0.45775774, conv2d_13_b, -1.4733055, -0.014426912, 1, 1, 1, 1, -1, 0, 1, 0.0, 2.569231034517287, 9); - void* var_23 = ConvLayer_PROMISE(var_22, 0.0, 2.569231034517287, conv2d_14_w, -0.25695276, 0.45372736, conv2d_14_b, -0.5259744, 0.26591402, 1, 1, 1, 1, -1, 0, -1, -1.9701244848966597, 1.4661400413513093, 9); - void* var_24 = tensorAdd(var_21, var_23); - void* var_25 = tensorRelu(var_24); - void* var_26 = ConvLayer_PROMISE(var_25, 0.0, 8.188224797248836, conv2d_15_w, -0.55299705, 0.5443531, conv2d_15_b, -0.71790683, 1.2730768, 1, 1, 2, 2, -1, 0, 1, 0.0, 12.411911067962677, 9); - void* var_27 = ConvLayer_PROMISE(var_26, 0.0, 12.411911067962677, conv2d_16_w, -0.4203967, 0.48641303, conv2d_16_b, -0.90653443, 1.3546854, 1, 1, 1, 1, -1, 0, -1, -25.407194147109987, 20.519153985977383, 9); - void* var_28 = ConvLayer_PROMISE(var_25, 0.0, 8.188224797248836, conv2d_17_w, -0.4365755, 0.84913826, conv2d_17_b, -0.90653443, 1.3546851, 0, 0, 2, 2, -1, 0, -1, -4.256520752906799, 5.730506427288059, 9); - void* var_29 = tensorAdd(var_28, var_27); - void* var_30 = tensorRelu(var_29); - void* var_31 = ConvLayer_PROMISE(var_30, 0.0, 22.350475664138983, conv2d_18_w, -0.38657624, 0.5228989, conv2d_18_b, -1.2083547, 0.76361173, 1, 1, 1, 1, -1, 0, 1, 0.0, 23.93387042045599, 9); - void* var_32 = ConvLayer_PROMISE(var_31, 0.0, 23.93387042045599, conv2d_19_w, -0.40857902, 0.575035, conv2d_19_b, -1.8731614, 1.0960501, 1, 1, 1, 1, -1, 0, -1, -35.37134181976318, 19.209569931030273, 9); - void* var_33 = tensorAdd(var_30, var_32); - void* var_34 = tensorRelu(var_33); - void* var_35 = ConvLayer_PROMISE(var_34, 0.0, 29.434949998855657, conv2d_20_w, -0.33079496, 0.5893278, conv2d_20_b, -1.0234511, 1.0016295, 1, 1, 1, 1, -1, 0, 1, 0.0, 27.216757345199866, 9); - void* var_36 = ConvLayer_PROMISE(var_35, 0.0, 27.216757345199866, conv2d_21_w, -0.27897888, 0.38280907, conv2d_21_b, -2.2086356, 1.0066502, 1, 1, 1, 1, -1, 0, -1, -42.31447326660156, 29.365212144852038, 9); - void* var_37 = tensorAdd(var_34, var_36); - void* var_38 = tensorRelu(var_37); - void* var_39 = tensorPooling(var_38,1,8,8,0,0,8,8); - void* var_40 = FCLayer_PROMISE(var_39, 0.0, 13.736315393447876, dense_1_w, -1.5092047, 1.0279838, dense_1_b, -0.49379802, 0.61032647, -1, -45.52749088287353, 31.64324799537669, 9); - void* var_41 = tensorSoftmax(var_40); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_41); - final_accuracy += accuracy; - - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_41, classConfs, predictedLabels, relative_start, relative_end); - } - - - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - - // NOTE: Signal back to OpenTuner - signalPipeToOpenTuner(); - } - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet18_promise.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet18_promise.cc deleted file mode 100644 index 2ade8b6090..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet18_promise.cc +++ /dev/null @@ -1,259 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 1000; - int offset = 5000; - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - llvm_hpvm_initTensorRt(0); - - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - - std::string dir_prefix = std::string("../model_params/resnet18_cifar10/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - for(int i = 0; i < batch_count; i++){ - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,16,3,3,3); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,16,16,3,3); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,16,16,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,16,16,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,16,16,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,16,16,3,3); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,16,16,3,3); - std::string conv2d_7_b_path = dir_prefix + std::string("conv2d_7_b.bin"); - void* conv2d_7_b = readTrainedWeights(conv2d_7_b_path.c_str(), 0,1,16,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,32,16,3,3); - std::string conv2d_8_b_path = dir_prefix + std::string("conv2d_8_b.bin"); - void* conv2d_8_b = readTrainedWeights(conv2d_8_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,32,16,1,1); - std::string conv2d_10_b_path = dir_prefix + std::string("conv2d_10_b.bin"); - void* conv2d_10_b = readTrainedWeights(conv2d_10_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,32,32,3,3); - std::string conv2d_9_b_path = dir_prefix + std::string("conv2d_9_b.bin"); - void* conv2d_9_b = readTrainedWeights(conv2d_9_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,32,32,3,3); - std::string conv2d_11_b_path = dir_prefix + std::string("conv2d_11_b.bin"); - void* conv2d_11_b = readTrainedWeights(conv2d_11_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,32,32,3,3); - std::string conv2d_12_b_path = dir_prefix + std::string("conv2d_12_b.bin"); - void* conv2d_12_b = readTrainedWeights(conv2d_12_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,32,32,3,3); - std::string conv2d_13_b_path = dir_prefix + std::string("conv2d_13_b.bin"); - void* conv2d_13_b = readTrainedWeights(conv2d_13_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_14_w_path = dir_prefix + std::string("conv2d_14_w.bin"); - void* conv2d_14_w = readTrainedWeights(conv2d_14_w_path.c_str(), 0,32,32,3,3); - std::string conv2d_14_b_path = dir_prefix + std::string("conv2d_14_b.bin"); - void* conv2d_14_b = readTrainedWeights(conv2d_14_b_path.c_str(), 0,1,32,1,1); - std::string conv2d_15_w_path = dir_prefix + std::string("conv2d_15_w.bin"); - void* conv2d_15_w = readTrainedWeights(conv2d_15_w_path.c_str(), 0,64,32,3,3); - std::string conv2d_15_b_path = dir_prefix + std::string("conv2d_15_b.bin"); - void* conv2d_15_b = readTrainedWeights(conv2d_15_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_17_w_path = dir_prefix + std::string("conv2d_17_w.bin"); - void* conv2d_17_w = readTrainedWeights(conv2d_17_w_path.c_str(), 0,64,32,1,1); - std::string conv2d_17_b_path = dir_prefix + std::string("conv2d_17_b.bin"); - void* conv2d_17_b = readTrainedWeights(conv2d_17_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_16_w_path = dir_prefix + std::string("conv2d_16_w.bin"); - void* conv2d_16_w = readTrainedWeights(conv2d_16_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_16_b_path = dir_prefix + std::string("conv2d_16_b.bin"); - void* conv2d_16_b = readTrainedWeights(conv2d_16_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_18_w_path = dir_prefix + std::string("conv2d_18_w.bin"); - void* conv2d_18_w = readTrainedWeights(conv2d_18_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_18_b_path = dir_prefix + std::string("conv2d_18_b.bin"); - void* conv2d_18_b = readTrainedWeights(conv2d_18_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_19_w_path = dir_prefix + std::string("conv2d_19_w.bin"); - void* conv2d_19_w = readTrainedWeights(conv2d_19_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_19_b_path = dir_prefix + std::string("conv2d_19_b.bin"); - void* conv2d_19_b = readTrainedWeights(conv2d_19_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_20_w_path = dir_prefix + std::string("conv2d_20_w.bin"); - void* conv2d_20_w = readTrainedWeights(conv2d_20_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_20_b_path = dir_prefix + std::string("conv2d_20_b.bin"); - void* conv2d_20_b = readTrainedWeights(conv2d_20_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_21_w_path = dir_prefix + std::string("conv2d_21_w.bin"); - void* conv2d_21_w = readTrainedWeights(conv2d_21_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_21_b_path = dir_prefix + std::string("conv2d_21_b.bin"); - void* conv2d_21_b = readTrainedWeights(conv2d_21_b_path.c_str(), 0,1,64,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,64,10); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,10,1,1); - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -0.5500815, 0.60786617, conv2d_1_w, -1.0248864, 1.2929907, conv2d_1_b, -0.36291853, 0.2533059, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.8791630274057383, 9); - void* var_1 = ConvLayer_PROMISE(var_0, 0.0, 0.8791630274057383, conv2d_2_w, -0.69884616, 0.71849966, conv2d_2_b, -0.2781147, 0.45571187, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.1859495645761484, 9); - void* var_2 = ConvLayer_PROMISE(var_1, 0.0, 1.1859495645761484, conv2d_3_w, -0.59568167, 0.7714691, conv2d_3_b, -0.8602873, 0.19743633, 1, 1, 1, 1, -1, 0, -1, -2.2316832554340365, 2.266301159858699, 9); - void* var_3 = tensorAdd(var_0, var_2); - void* var_4 = tensorRelu(var_3); - void* var_5 = ConvLayer_PROMISE(var_4, 0.0, 2.789569139480591, conv2d_4_w, -0.41976976, 0.43748936, conv2d_4_b, -0.7021962, 0.3033103, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.3341254055499974, 9); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 1.3341254055499974, conv2d_5_w, -0.46757826, 0.4635873, conv2d_5_b, -0.20662616, 0.1778044, 1, 1, 1, 1, -1, 0, -1, -0.9912706619501114, 1.0245310074090952, 9); - void* var_7 = tensorAdd(var_4, var_6); - void* var_8 = tensorRelu(var_7); - void* var_9 = ConvLayer_PROMISE(var_8, 0.0, 2.998989346027372, conv2d_6_w, -0.64404047, 0.45383143, conv2d_6_b, -0.819547, 0.38550296, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.2850778144597967, 9); - void* var_10 = ConvLayer_PROMISE(var_9, 0.0, 1.2850778144597967, conv2d_7_w, -0.41986948, 0.33654243, conv2d_7_b, -0.3563013, 0.22371122, 1, 1, 1, 1, -1, 0, -1, -1.2940701305866242, 0.7332147359848022, 9); - void* var_11 = tensorAdd(var_8, var_10); - void* var_12 = tensorRelu(var_11); - void* var_13 = ConvLayer_PROMISE(var_12, 0.0, 2.8626382386684384, conv2d_8_w, -0.4805263, 0.50655717, conv2d_8_b, -0.296758, 0.7742441, 1, 1, 2, 2, -1, 0, 1, 0.0, 3.6232483506202584, 9); - void* var_14 = ConvLayer_PROMISE(var_13, 0.0, 3.6232483506202584, conv2d_9_w, -0.52083415, 0.45517674, conv2d_9_b, -0.20242067, 0.8236838, 1, 1, 1, 1, -1, 0, -1, -6.319877154827118, 6.882811555862418, 9); - void* var_15 = ConvLayer_PROMISE(var_12, 0.0, 2.8626382386684384, conv2d_10_w, -0.5338656, 1.3395424, conv2d_10_b, -0.20242067, 0.8236838, 0, 0, 2, 2, -1, 0, -1, -0.9930689406394959, 2.8721754658222096, 9); - void* var_16 = tensorAdd(var_15, var_14); - void* var_17 = tensorRelu(var_16); - void* var_18 = ConvLayer_PROMISE(var_17, 0.0, 8.315858840942383, conv2d_11_w, -0.34429058, 0.43629733, conv2d_11_b, -1.0744808, 0.056708273, 1, 1, 1, 1, -1, 0, 1, 0.0, 2.6893706333637226, 9); - void* var_19 = ConvLayer_PROMISE(var_18, 0.0, 2.6893706333637226, conv2d_12_w, -0.30342352, 0.39493486, conv2d_12_b, -0.44630566, 0.6492069, 1, 1, 1, 1, -1, 0, -1, -1.8801953810453416, 1.714934362173068, 9); - void* var_20 = tensorAdd(var_17, var_19); - void* var_21 = tensorRelu(var_20); - void* var_22 = ConvLayer_PROMISE(var_21, 0.0, 8.381670951843262, conv2d_13_w, -0.38351893, 0.45775774, conv2d_13_b, -1.4733055, -0.014426912, 1, 1, 1, 1, -1, 0, 1, 0.0, 2.569231034517287, 9); - void* var_23 = ConvLayer_PROMISE(var_22, 0.0, 2.569231034517287, conv2d_14_w, -0.25695276, 0.45372736, conv2d_14_b, -0.5259744, 0.26591402, 1, 1, 1, 1, -1, 0, -1, -1.9701244848966597, 1.4661400413513093, 9); - void* var_24 = tensorAdd(var_21, var_23); - void* var_25 = tensorRelu(var_24); - void* var_26 = ConvLayer_PROMISE(var_25, 0.0, 8.188224797248836, conv2d_15_w, -0.55299705, 0.5443531, conv2d_15_b, -0.71790683, 1.2730768, 1, 1, 2, 2, -1, 0, 1, 0.0, 12.411911067962677, 9); - void* var_27 = ConvLayer_PROMISE(var_26, 0.0, 12.411911067962677, conv2d_16_w, -0.4203967, 0.48641303, conv2d_16_b, -0.90653443, 1.3546854, 1, 1, 1, 1, -1, 0, -1, -25.407194147109987, 20.519153985977383, 9); - void* var_28 = ConvLayer_PROMISE(var_25, 0.0, 8.188224797248836, conv2d_17_w, -0.4365755, 0.84913826, conv2d_17_b, -0.90653443, 1.3546851, 0, 0, 2, 2, -1, 0, -1, -4.256520752906799, 5.730506427288059, 9); - void* var_29 = tensorAdd(var_28, var_27); - void* var_30 = tensorRelu(var_29); - void* var_31 = ConvLayer_PROMISE(var_30, 0.0, 22.350475664138983, conv2d_18_w, -0.38657624, 0.5228989, conv2d_18_b, -1.2083547, 0.76361173, 1, 1, 1, 1, -1, 0, 1, 0.0, 23.93387042045599, 9); - void* var_32 = ConvLayer_PROMISE(var_31, 0.0, 23.93387042045599, conv2d_19_w, -0.40857902, 0.575035, conv2d_19_b, -1.8731614, 1.0960501, 1, 1, 1, 1, -1, 0, -1, -35.37134181976318, 19.209569931030273, 9); - void* var_33 = tensorAdd(var_30, var_32); - void* var_34 = tensorRelu(var_33); - void* var_35 = ConvLayer_PROMISE(var_34, 0.0, 29.434949998855657, conv2d_20_w, -0.33079496, 0.5893278, conv2d_20_b, -1.0234511, 1.0016295, 1, 1, 1, 1, -1, 0, 1, 0.0, 27.216757345199866, 9); - void* var_36 = ConvLayer_PROMISE(var_35, 0.0, 27.216757345199866, conv2d_21_w, -0.27897888, 0.38280907, conv2d_21_b, -2.2086356, 1.0066502, 1, 1, 1, 1, -1, 0, -1, -42.31447326660156, 29.365212144852038, 9); - void* var_37 = tensorAdd(var_34, var_36); - void* var_38 = tensorRelu(var_37); - void* var_39 = tensorPooling(var_38,1,8,8,0,0,8,8); - void* var_40 = FCLayer_PROMISE(var_39, 0.0, 13.736315393447876, dense_1_w, -1.5092047, 1.0279838, dense_1_b, -0.49379802, 0.61032647, -1, -45.52749088287353, 31.64324799537669, 9); - void* var_41 = tensorSoftmax(var_40); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_41); - final_accuracy += accuracy; - - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_41, classConfs, predictedLabels, relative_start, relative_end); - } - - - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - } - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet50_imagenet_piped.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet50_imagenet_piped.cc deleted file mode 100644 index 1e61f9e993..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet50_imagenet_piped.cc +++ /dev/null @@ -1,925 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - -int main(int argc, char* argv[]){ - - llvm_hpvm_initTensorRt(0); - - - int total_runs = 1; - int offset = 0; - - int test_input_size = 2000; - int batch_size = 50; - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - - - - std::string dir_prefix = std::string("/shared/hsharif3/resnet50_imagenet/"); - std::string input_path = dir_prefix + std::string("test_input.bin"); - std::string labels_path = dir_prefix + std::string("test_labels.bin"); - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,7,7); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_1_gamma_path = dir_prefix + std::string("batch_normalization_1_gamma.bin"); - void* batch_normalization_1_gamma = readTrainedWeights(batch_normalization_1_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_1_beta_path = dir_prefix + std::string("batch_normalization_1_beta.bin"); - void* batch_normalization_1_beta = readTrainedWeights(batch_normalization_1_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_1_mean_path = dir_prefix + std::string("batch_normalization_1_mean.bin"); - void* batch_normalization_1_mean = readTrainedWeights(batch_normalization_1_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_1_variance_path = dir_prefix + std::string("batch_normalization_1_variance.bin"); - void* batch_normalization_1_variance = readTrainedWeights(batch_normalization_1_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,64,1,1); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_2_gamma_path = dir_prefix + std::string("batch_normalization_2_gamma.bin"); - void* batch_normalization_2_gamma = readTrainedWeights(batch_normalization_2_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_2_beta_path = dir_prefix + std::string("batch_normalization_2_beta.bin"); - void* batch_normalization_2_beta = readTrainedWeights(batch_normalization_2_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_2_mean_path = dir_prefix + std::string("batch_normalization_2_mean.bin"); - void* batch_normalization_2_mean = readTrainedWeights(batch_normalization_2_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_2_variance_path = dir_prefix + std::string("batch_normalization_2_variance.bin"); - void* batch_normalization_2_variance = readTrainedWeights(batch_normalization_2_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_gamma_path = dir_prefix + std::string("batch_normalization_3_gamma.bin"); - void* batch_normalization_3_gamma = readTrainedWeights(batch_normalization_3_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_beta_path = dir_prefix + std::string("batch_normalization_3_beta.bin"); - void* batch_normalization_3_beta = readTrainedWeights(batch_normalization_3_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_mean_path = dir_prefix + std::string("batch_normalization_3_mean.bin"); - void* batch_normalization_3_mean = readTrainedWeights(batch_normalization_3_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_variance_path = dir_prefix + std::string("batch_normalization_3_variance.bin"); - void* batch_normalization_3_variance = readTrainedWeights(batch_normalization_3_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,256,64,1,1); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,64,1,1); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_4_gamma_path = dir_prefix + std::string("batch_normalization_4_gamma.bin"); - void* batch_normalization_4_gamma = readTrainedWeights(batch_normalization_4_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_4_beta_path = dir_prefix + std::string("batch_normalization_4_beta.bin"); - void* batch_normalization_4_beta = readTrainedWeights(batch_normalization_4_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_4_mean_path = dir_prefix + std::string("batch_normalization_4_mean.bin"); - void* batch_normalization_4_mean = readTrainedWeights(batch_normalization_4_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_4_variance_path = dir_prefix + std::string("batch_normalization_4_variance.bin"); - void* batch_normalization_4_variance = readTrainedWeights(batch_normalization_4_variance_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_5_gamma_path = dir_prefix + std::string("batch_normalization_5_gamma.bin"); - void* batch_normalization_5_gamma = readTrainedWeights(batch_normalization_5_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_5_beta_path = dir_prefix + std::string("batch_normalization_5_beta.bin"); - void* batch_normalization_5_beta = readTrainedWeights(batch_normalization_5_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_5_mean_path = dir_prefix + std::string("batch_normalization_5_mean.bin"); - void* batch_normalization_5_mean = readTrainedWeights(batch_normalization_5_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_5_variance_path = dir_prefix + std::string("batch_normalization_5_variance.bin"); - void* batch_normalization_5_variance = readTrainedWeights(batch_normalization_5_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,64,256,1,1); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_6_gamma_path = dir_prefix + std::string("batch_normalization_6_gamma.bin"); - void* batch_normalization_6_gamma = readTrainedWeights(batch_normalization_6_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_6_beta_path = dir_prefix + std::string("batch_normalization_6_beta.bin"); - void* batch_normalization_6_beta = readTrainedWeights(batch_normalization_6_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_6_mean_path = dir_prefix + std::string("batch_normalization_6_mean.bin"); - void* batch_normalization_6_mean = readTrainedWeights(batch_normalization_6_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_6_variance_path = dir_prefix + std::string("batch_normalization_6_variance.bin"); - void* batch_normalization_6_variance = readTrainedWeights(batch_normalization_6_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_7_b_path = dir_prefix + std::string("conv2d_7_b.bin"); - void* conv2d_7_b = readTrainedWeights(conv2d_7_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_7_gamma_path = dir_prefix + std::string("batch_normalization_7_gamma.bin"); - void* batch_normalization_7_gamma = readTrainedWeights(batch_normalization_7_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_7_beta_path = dir_prefix + std::string("batch_normalization_7_beta.bin"); - void* batch_normalization_7_beta = readTrainedWeights(batch_normalization_7_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_7_mean_path = dir_prefix + std::string("batch_normalization_7_mean.bin"); - void* batch_normalization_7_mean = readTrainedWeights(batch_normalization_7_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_7_variance_path = dir_prefix + std::string("batch_normalization_7_variance.bin"); - void* batch_normalization_7_variance = readTrainedWeights(batch_normalization_7_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,256,64,1,1); - std::string conv2d_8_b_path = dir_prefix + std::string("conv2d_8_b.bin"); - void* conv2d_8_b = readTrainedWeights(conv2d_8_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_8_gamma_path = dir_prefix + std::string("batch_normalization_8_gamma.bin"); - void* batch_normalization_8_gamma = readTrainedWeights(batch_normalization_8_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_8_beta_path = dir_prefix + std::string("batch_normalization_8_beta.bin"); - void* batch_normalization_8_beta = readTrainedWeights(batch_normalization_8_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_8_mean_path = dir_prefix + std::string("batch_normalization_8_mean.bin"); - void* batch_normalization_8_mean = readTrainedWeights(batch_normalization_8_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_8_variance_path = dir_prefix + std::string("batch_normalization_8_variance.bin"); - void* batch_normalization_8_variance = readTrainedWeights(batch_normalization_8_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,64,256,1,1); - std::string conv2d_9_b_path = dir_prefix + std::string("conv2d_9_b.bin"); - void* conv2d_9_b = readTrainedWeights(conv2d_9_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_9_gamma_path = dir_prefix + std::string("batch_normalization_9_gamma.bin"); - void* batch_normalization_9_gamma = readTrainedWeights(batch_normalization_9_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_9_beta_path = dir_prefix + std::string("batch_normalization_9_beta.bin"); - void* batch_normalization_9_beta = readTrainedWeights(batch_normalization_9_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_9_mean_path = dir_prefix + std::string("batch_normalization_9_mean.bin"); - void* batch_normalization_9_mean = readTrainedWeights(batch_normalization_9_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_9_variance_path = dir_prefix + std::string("batch_normalization_9_variance.bin"); - void* batch_normalization_9_variance = readTrainedWeights(batch_normalization_9_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_10_b_path = dir_prefix + std::string("conv2d_10_b.bin"); - void* conv2d_10_b = readTrainedWeights(conv2d_10_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_10_gamma_path = dir_prefix + std::string("batch_normalization_10_gamma.bin"); - void* batch_normalization_10_gamma = readTrainedWeights(batch_normalization_10_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_10_beta_path = dir_prefix + std::string("batch_normalization_10_beta.bin"); - void* batch_normalization_10_beta = readTrainedWeights(batch_normalization_10_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_10_mean_path = dir_prefix + std::string("batch_normalization_10_mean.bin"); - void* batch_normalization_10_mean = readTrainedWeights(batch_normalization_10_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_10_variance_path = dir_prefix + std::string("batch_normalization_10_variance.bin"); - void* batch_normalization_10_variance = readTrainedWeights(batch_normalization_10_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,256,64,1,1); - std::string conv2d_11_b_path = dir_prefix + std::string("conv2d_11_b.bin"); - void* conv2d_11_b = readTrainedWeights(conv2d_11_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_gamma_path = dir_prefix + std::string("batch_normalization_11_gamma.bin"); - void* batch_normalization_11_gamma = readTrainedWeights(batch_normalization_11_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_beta_path = dir_prefix + std::string("batch_normalization_11_beta.bin"); - void* batch_normalization_11_beta = readTrainedWeights(batch_normalization_11_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_mean_path = dir_prefix + std::string("batch_normalization_11_mean.bin"); - void* batch_normalization_11_mean = readTrainedWeights(batch_normalization_11_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_variance_path = dir_prefix + std::string("batch_normalization_11_variance.bin"); - void* batch_normalization_11_variance = readTrainedWeights(batch_normalization_11_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,128,256,1,1); - std::string conv2d_12_b_path = dir_prefix + std::string("conv2d_12_b.bin"); - void* conv2d_12_b = readTrainedWeights(conv2d_12_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_12_gamma_path = dir_prefix + std::string("batch_normalization_12_gamma.bin"); - void* batch_normalization_12_gamma = readTrainedWeights(batch_normalization_12_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_12_beta_path = dir_prefix + std::string("batch_normalization_12_beta.bin"); - void* batch_normalization_12_beta = readTrainedWeights(batch_normalization_12_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_12_mean_path = dir_prefix + std::string("batch_normalization_12_mean.bin"); - void* batch_normalization_12_mean = readTrainedWeights(batch_normalization_12_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_12_variance_path = dir_prefix + std::string("batch_normalization_12_variance.bin"); - void* batch_normalization_12_variance = readTrainedWeights(batch_normalization_12_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_13_b_path = dir_prefix + std::string("conv2d_13_b.bin"); - void* conv2d_13_b = readTrainedWeights(conv2d_13_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_13_gamma_path = dir_prefix + std::string("batch_normalization_13_gamma.bin"); - void* batch_normalization_13_gamma = readTrainedWeights(batch_normalization_13_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_13_beta_path = dir_prefix + std::string("batch_normalization_13_beta.bin"); - void* batch_normalization_13_beta = readTrainedWeights(batch_normalization_13_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_13_mean_path = dir_prefix + std::string("batch_normalization_13_mean.bin"); - void* batch_normalization_13_mean = readTrainedWeights(batch_normalization_13_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_13_variance_path = dir_prefix + std::string("batch_normalization_13_variance.bin"); - void* batch_normalization_13_variance = readTrainedWeights(batch_normalization_13_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_14_w_path = dir_prefix + std::string("conv2d_14_w.bin"); - void* conv2d_14_w = readTrainedWeights(conv2d_14_w_path.c_str(), 0,512,128,1,1); - std::string conv2d_14_b_path = dir_prefix + std::string("conv2d_14_b.bin"); - void* conv2d_14_b = readTrainedWeights(conv2d_14_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_15_w_path = dir_prefix + std::string("conv2d_15_w.bin"); - void* conv2d_15_w = readTrainedWeights(conv2d_15_w_path.c_str(), 0,512,256,1,1); - std::string conv2d_15_b_path = dir_prefix + std::string("conv2d_15_b.bin"); - void* conv2d_15_b = readTrainedWeights(conv2d_15_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_gamma_path = dir_prefix + std::string("batch_normalization_14_gamma.bin"); - void* batch_normalization_14_gamma = readTrainedWeights(batch_normalization_14_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_beta_path = dir_prefix + std::string("batch_normalization_14_beta.bin"); - void* batch_normalization_14_beta = readTrainedWeights(batch_normalization_14_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_mean_path = dir_prefix + std::string("batch_normalization_14_mean.bin"); - void* batch_normalization_14_mean = readTrainedWeights(batch_normalization_14_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_variance_path = dir_prefix + std::string("batch_normalization_14_variance.bin"); - void* batch_normalization_14_variance = readTrainedWeights(batch_normalization_14_variance_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_gamma_path = dir_prefix + std::string("batch_normalization_15_gamma.bin"); - void* batch_normalization_15_gamma = readTrainedWeights(batch_normalization_15_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_beta_path = dir_prefix + std::string("batch_normalization_15_beta.bin"); - void* batch_normalization_15_beta = readTrainedWeights(batch_normalization_15_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_mean_path = dir_prefix + std::string("batch_normalization_15_mean.bin"); - void* batch_normalization_15_mean = readTrainedWeights(batch_normalization_15_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_variance_path = dir_prefix + std::string("batch_normalization_15_variance.bin"); - void* batch_normalization_15_variance = readTrainedWeights(batch_normalization_15_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_16_w_path = dir_prefix + std::string("conv2d_16_w.bin"); - void* conv2d_16_w = readTrainedWeights(conv2d_16_w_path.c_str(), 0,128,512,1,1); - std::string conv2d_16_b_path = dir_prefix + std::string("conv2d_16_b.bin"); - void* conv2d_16_b = readTrainedWeights(conv2d_16_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_16_gamma_path = dir_prefix + std::string("batch_normalization_16_gamma.bin"); - void* batch_normalization_16_gamma = readTrainedWeights(batch_normalization_16_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_16_beta_path = dir_prefix + std::string("batch_normalization_16_beta.bin"); - void* batch_normalization_16_beta = readTrainedWeights(batch_normalization_16_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_16_mean_path = dir_prefix + std::string("batch_normalization_16_mean.bin"); - void* batch_normalization_16_mean = readTrainedWeights(batch_normalization_16_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_16_variance_path = dir_prefix + std::string("batch_normalization_16_variance.bin"); - void* batch_normalization_16_variance = readTrainedWeights(batch_normalization_16_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_17_w_path = dir_prefix + std::string("conv2d_17_w.bin"); - void* conv2d_17_w = readTrainedWeights(conv2d_17_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_17_b_path = dir_prefix + std::string("conv2d_17_b.bin"); - void* conv2d_17_b = readTrainedWeights(conv2d_17_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_17_gamma_path = dir_prefix + std::string("batch_normalization_17_gamma.bin"); - void* batch_normalization_17_gamma = readTrainedWeights(batch_normalization_17_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_17_beta_path = dir_prefix + std::string("batch_normalization_17_beta.bin"); - void* batch_normalization_17_beta = readTrainedWeights(batch_normalization_17_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_17_mean_path = dir_prefix + std::string("batch_normalization_17_mean.bin"); - void* batch_normalization_17_mean = readTrainedWeights(batch_normalization_17_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_17_variance_path = dir_prefix + std::string("batch_normalization_17_variance.bin"); - void* batch_normalization_17_variance = readTrainedWeights(batch_normalization_17_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_18_w_path = dir_prefix + std::string("conv2d_18_w.bin"); - void* conv2d_18_w = readTrainedWeights(conv2d_18_w_path.c_str(), 0,512,128,1,1); - std::string conv2d_18_b_path = dir_prefix + std::string("conv2d_18_b.bin"); - void* conv2d_18_b = readTrainedWeights(conv2d_18_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_gamma_path = dir_prefix + std::string("batch_normalization_18_gamma.bin"); - void* batch_normalization_18_gamma = readTrainedWeights(batch_normalization_18_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_beta_path = dir_prefix + std::string("batch_normalization_18_beta.bin"); - void* batch_normalization_18_beta = readTrainedWeights(batch_normalization_18_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_mean_path = dir_prefix + std::string("batch_normalization_18_mean.bin"); - void* batch_normalization_18_mean = readTrainedWeights(batch_normalization_18_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_variance_path = dir_prefix + std::string("batch_normalization_18_variance.bin"); - void* batch_normalization_18_variance = readTrainedWeights(batch_normalization_18_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_19_w_path = dir_prefix + std::string("conv2d_19_w.bin"); - void* conv2d_19_w = readTrainedWeights(conv2d_19_w_path.c_str(), 0,128,512,1,1); - std::string conv2d_19_b_path = dir_prefix + std::string("conv2d_19_b.bin"); - void* conv2d_19_b = readTrainedWeights(conv2d_19_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_19_gamma_path = dir_prefix + std::string("batch_normalization_19_gamma.bin"); - void* batch_normalization_19_gamma = readTrainedWeights(batch_normalization_19_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_19_beta_path = dir_prefix + std::string("batch_normalization_19_beta.bin"); - void* batch_normalization_19_beta = readTrainedWeights(batch_normalization_19_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_19_mean_path = dir_prefix + std::string("batch_normalization_19_mean.bin"); - void* batch_normalization_19_mean = readTrainedWeights(batch_normalization_19_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_19_variance_path = dir_prefix + std::string("batch_normalization_19_variance.bin"); - void* batch_normalization_19_variance = readTrainedWeights(batch_normalization_19_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_20_w_path = dir_prefix + std::string("conv2d_20_w.bin"); - void* conv2d_20_w = readTrainedWeights(conv2d_20_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_20_b_path = dir_prefix + std::string("conv2d_20_b.bin"); - void* conv2d_20_b = readTrainedWeights(conv2d_20_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_20_gamma_path = dir_prefix + std::string("batch_normalization_20_gamma.bin"); - void* batch_normalization_20_gamma = readTrainedWeights(batch_normalization_20_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_20_beta_path = dir_prefix + std::string("batch_normalization_20_beta.bin"); - void* batch_normalization_20_beta = readTrainedWeights(batch_normalization_20_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_20_mean_path = dir_prefix + std::string("batch_normalization_20_mean.bin"); - void* batch_normalization_20_mean = readTrainedWeights(batch_normalization_20_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_20_variance_path = dir_prefix + std::string("batch_normalization_20_variance.bin"); - void* batch_normalization_20_variance = readTrainedWeights(batch_normalization_20_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_21_w_path = dir_prefix + std::string("conv2d_21_w.bin"); - void* conv2d_21_w = readTrainedWeights(conv2d_21_w_path.c_str(), 0,512,128,1,1); - std::string conv2d_21_b_path = dir_prefix + std::string("conv2d_21_b.bin"); - void* conv2d_21_b = readTrainedWeights(conv2d_21_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_gamma_path = dir_prefix + std::string("batch_normalization_21_gamma.bin"); - void* batch_normalization_21_gamma = readTrainedWeights(batch_normalization_21_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_beta_path = dir_prefix + std::string("batch_normalization_21_beta.bin"); - void* batch_normalization_21_beta = readTrainedWeights(batch_normalization_21_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_mean_path = dir_prefix + std::string("batch_normalization_21_mean.bin"); - void* batch_normalization_21_mean = readTrainedWeights(batch_normalization_21_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_variance_path = dir_prefix + std::string("batch_normalization_21_variance.bin"); - void* batch_normalization_21_variance = readTrainedWeights(batch_normalization_21_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_22_w_path = dir_prefix + std::string("conv2d_22_w.bin"); - void* conv2d_22_w = readTrainedWeights(conv2d_22_w_path.c_str(), 0,128,512,1,1); - std::string conv2d_22_b_path = dir_prefix + std::string("conv2d_22_b.bin"); - void* conv2d_22_b = readTrainedWeights(conv2d_22_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_22_gamma_path = dir_prefix + std::string("batch_normalization_22_gamma.bin"); - void* batch_normalization_22_gamma = readTrainedWeights(batch_normalization_22_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_22_beta_path = dir_prefix + std::string("batch_normalization_22_beta.bin"); - void* batch_normalization_22_beta = readTrainedWeights(batch_normalization_22_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_22_mean_path = dir_prefix + std::string("batch_normalization_22_mean.bin"); - void* batch_normalization_22_mean = readTrainedWeights(batch_normalization_22_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_22_variance_path = dir_prefix + std::string("batch_normalization_22_variance.bin"); - void* batch_normalization_22_variance = readTrainedWeights(batch_normalization_22_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_23_w_path = dir_prefix + std::string("conv2d_23_w.bin"); - void* conv2d_23_w = readTrainedWeights(conv2d_23_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_23_b_path = dir_prefix + std::string("conv2d_23_b.bin"); - void* conv2d_23_b = readTrainedWeights(conv2d_23_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_23_gamma_path = dir_prefix + std::string("batch_normalization_23_gamma.bin"); - void* batch_normalization_23_gamma = readTrainedWeights(batch_normalization_23_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_23_beta_path = dir_prefix + std::string("batch_normalization_23_beta.bin"); - void* batch_normalization_23_beta = readTrainedWeights(batch_normalization_23_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_23_mean_path = dir_prefix + std::string("batch_normalization_23_mean.bin"); - void* batch_normalization_23_mean = readTrainedWeights(batch_normalization_23_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_23_variance_path = dir_prefix + std::string("batch_normalization_23_variance.bin"); - void* batch_normalization_23_variance = readTrainedWeights(batch_normalization_23_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_24_w_path = dir_prefix + std::string("conv2d_24_w.bin"); - void* conv2d_24_w = readTrainedWeights(conv2d_24_w_path.c_str(), 0,512,128,1,1); - std::string conv2d_24_b_path = dir_prefix + std::string("conv2d_24_b.bin"); - void* conv2d_24_b = readTrainedWeights(conv2d_24_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_gamma_path = dir_prefix + std::string("batch_normalization_24_gamma.bin"); - void* batch_normalization_24_gamma = readTrainedWeights(batch_normalization_24_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_beta_path = dir_prefix + std::string("batch_normalization_24_beta.bin"); - void* batch_normalization_24_beta = readTrainedWeights(batch_normalization_24_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_mean_path = dir_prefix + std::string("batch_normalization_24_mean.bin"); - void* batch_normalization_24_mean = readTrainedWeights(batch_normalization_24_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_variance_path = dir_prefix + std::string("batch_normalization_24_variance.bin"); - void* batch_normalization_24_variance = readTrainedWeights(batch_normalization_24_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_25_w_path = dir_prefix + std::string("conv2d_25_w.bin"); - void* conv2d_25_w = readTrainedWeights(conv2d_25_w_path.c_str(), 0,256,512,1,1); - std::string conv2d_25_b_path = dir_prefix + std::string("conv2d_25_b.bin"); - void* conv2d_25_b = readTrainedWeights(conv2d_25_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_25_gamma_path = dir_prefix + std::string("batch_normalization_25_gamma.bin"); - void* batch_normalization_25_gamma = readTrainedWeights(batch_normalization_25_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_25_beta_path = dir_prefix + std::string("batch_normalization_25_beta.bin"); - void* batch_normalization_25_beta = readTrainedWeights(batch_normalization_25_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_25_mean_path = dir_prefix + std::string("batch_normalization_25_mean.bin"); - void* batch_normalization_25_mean = readTrainedWeights(batch_normalization_25_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_25_variance_path = dir_prefix + std::string("batch_normalization_25_variance.bin"); - void* batch_normalization_25_variance = readTrainedWeights(batch_normalization_25_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_26_w_path = dir_prefix + std::string("conv2d_26_w.bin"); - void* conv2d_26_w = readTrainedWeights(conv2d_26_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_26_b_path = dir_prefix + std::string("conv2d_26_b.bin"); - void* conv2d_26_b = readTrainedWeights(conv2d_26_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_26_gamma_path = dir_prefix + std::string("batch_normalization_26_gamma.bin"); - void* batch_normalization_26_gamma = readTrainedWeights(batch_normalization_26_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_26_beta_path = dir_prefix + std::string("batch_normalization_26_beta.bin"); - void* batch_normalization_26_beta = readTrainedWeights(batch_normalization_26_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_26_mean_path = dir_prefix + std::string("batch_normalization_26_mean.bin"); - void* batch_normalization_26_mean = readTrainedWeights(batch_normalization_26_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_26_variance_path = dir_prefix + std::string("batch_normalization_26_variance.bin"); - void* batch_normalization_26_variance = readTrainedWeights(batch_normalization_26_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_27_w_path = dir_prefix + std::string("conv2d_27_w.bin"); - void* conv2d_27_w = readTrainedWeights(conv2d_27_w_path.c_str(), 0,1024,256,1,1); - std::string conv2d_27_b_path = dir_prefix + std::string("conv2d_27_b.bin"); - void* conv2d_27_b = readTrainedWeights(conv2d_27_b_path.c_str(), 0,1,1024,1,1); - std::string conv2d_28_w_path = dir_prefix + std::string("conv2d_28_w.bin"); - void* conv2d_28_w = readTrainedWeights(conv2d_28_w_path.c_str(), 0,1024,512,1,1); - std::string conv2d_28_b_path = dir_prefix + std::string("conv2d_28_b.bin"); - void* conv2d_28_b = readTrainedWeights(conv2d_28_b_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_gamma_path = dir_prefix + std::string("batch_normalization_27_gamma.bin"); - void* batch_normalization_27_gamma = readTrainedWeights(batch_normalization_27_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_beta_path = dir_prefix + std::string("batch_normalization_27_beta.bin"); - void* batch_normalization_27_beta = readTrainedWeights(batch_normalization_27_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_mean_path = dir_prefix + std::string("batch_normalization_27_mean.bin"); - void* batch_normalization_27_mean = readTrainedWeights(batch_normalization_27_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_variance_path = dir_prefix + std::string("batch_normalization_27_variance.bin"); - void* batch_normalization_27_variance = readTrainedWeights(batch_normalization_27_variance_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_28_gamma_path = dir_prefix + std::string("batch_normalization_28_gamma.bin"); - void* batch_normalization_28_gamma = readTrainedWeights(batch_normalization_28_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_28_beta_path = dir_prefix + std::string("batch_normalization_28_beta.bin"); - void* batch_normalization_28_beta = readTrainedWeights(batch_normalization_28_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_28_mean_path = dir_prefix + std::string("batch_normalization_28_mean.bin"); - void* batch_normalization_28_mean = readTrainedWeights(batch_normalization_28_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_28_variance_path = dir_prefix + std::string("batch_normalization_28_variance.bin"); - void* batch_normalization_28_variance = readTrainedWeights(batch_normalization_28_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_29_w_path = dir_prefix + std::string("conv2d_29_w.bin"); - void* conv2d_29_w = readTrainedWeights(conv2d_29_w_path.c_str(), 0,256,1024,1,1); - std::string conv2d_29_b_path = dir_prefix + std::string("conv2d_29_b.bin"); - void* conv2d_29_b = readTrainedWeights(conv2d_29_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_29_gamma_path = dir_prefix + std::string("batch_normalization_29_gamma.bin"); - void* batch_normalization_29_gamma = readTrainedWeights(batch_normalization_29_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_29_beta_path = dir_prefix + std::string("batch_normalization_29_beta.bin"); - void* batch_normalization_29_beta = readTrainedWeights(batch_normalization_29_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_29_mean_path = dir_prefix + std::string("batch_normalization_29_mean.bin"); - void* batch_normalization_29_mean = readTrainedWeights(batch_normalization_29_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_29_variance_path = dir_prefix + std::string("batch_normalization_29_variance.bin"); - void* batch_normalization_29_variance = readTrainedWeights(batch_normalization_29_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_30_w_path = dir_prefix + std::string("conv2d_30_w.bin"); - void* conv2d_30_w = readTrainedWeights(conv2d_30_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_30_b_path = dir_prefix + std::string("conv2d_30_b.bin"); - void* conv2d_30_b = readTrainedWeights(conv2d_30_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_30_gamma_path = dir_prefix + std::string("batch_normalization_30_gamma.bin"); - void* batch_normalization_30_gamma = readTrainedWeights(batch_normalization_30_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_30_beta_path = dir_prefix + std::string("batch_normalization_30_beta.bin"); - void* batch_normalization_30_beta = readTrainedWeights(batch_normalization_30_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_30_mean_path = dir_prefix + std::string("batch_normalization_30_mean.bin"); - void* batch_normalization_30_mean = readTrainedWeights(batch_normalization_30_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_30_variance_path = dir_prefix + std::string("batch_normalization_30_variance.bin"); - void* batch_normalization_30_variance = readTrainedWeights(batch_normalization_30_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_31_w_path = dir_prefix + std::string("conv2d_31_w.bin"); - void* conv2d_31_w = readTrainedWeights(conv2d_31_w_path.c_str(), 0,1024,256,1,1); - std::string conv2d_31_b_path = dir_prefix + std::string("conv2d_31_b.bin"); - void* conv2d_31_b = readTrainedWeights(conv2d_31_b_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_31_gamma_path = dir_prefix + std::string("batch_normalization_31_gamma.bin"); - void* batch_normalization_31_gamma = readTrainedWeights(batch_normalization_31_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_31_beta_path = dir_prefix + std::string("batch_normalization_31_beta.bin"); - void* batch_normalization_31_beta = readTrainedWeights(batch_normalization_31_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_31_mean_path = dir_prefix + std::string("batch_normalization_31_mean.bin"); - void* batch_normalization_31_mean = readTrainedWeights(batch_normalization_31_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_31_variance_path = dir_prefix + std::string("batch_normalization_31_variance.bin"); - void* batch_normalization_31_variance = readTrainedWeights(batch_normalization_31_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_32_w_path = dir_prefix + std::string("conv2d_32_w.bin"); - void* conv2d_32_w = readTrainedWeights(conv2d_32_w_path.c_str(), 0,256,1024,1,1); - std::string conv2d_32_b_path = dir_prefix + std::string("conv2d_32_b.bin"); - void* conv2d_32_b = readTrainedWeights(conv2d_32_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_32_gamma_path = dir_prefix + std::string("batch_normalization_32_gamma.bin"); - void* batch_normalization_32_gamma = readTrainedWeights(batch_normalization_32_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_32_beta_path = dir_prefix + std::string("batch_normalization_32_beta.bin"); - void* batch_normalization_32_beta = readTrainedWeights(batch_normalization_32_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_32_mean_path = dir_prefix + std::string("batch_normalization_32_mean.bin"); - void* batch_normalization_32_mean = readTrainedWeights(batch_normalization_32_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_32_variance_path = dir_prefix + std::string("batch_normalization_32_variance.bin"); - void* batch_normalization_32_variance = readTrainedWeights(batch_normalization_32_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_33_w_path = dir_prefix + std::string("conv2d_33_w.bin"); - void* conv2d_33_w = readTrainedWeights(conv2d_33_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_33_b_path = dir_prefix + std::string("conv2d_33_b.bin"); - void* conv2d_33_b = readTrainedWeights(conv2d_33_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_33_gamma_path = dir_prefix + std::string("batch_normalization_33_gamma.bin"); - void* batch_normalization_33_gamma = readTrainedWeights(batch_normalization_33_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_33_beta_path = dir_prefix + std::string("batch_normalization_33_beta.bin"); - void* batch_normalization_33_beta = readTrainedWeights(batch_normalization_33_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_33_mean_path = dir_prefix + std::string("batch_normalization_33_mean.bin"); - void* batch_normalization_33_mean = readTrainedWeights(batch_normalization_33_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_33_variance_path = dir_prefix + std::string("batch_normalization_33_variance.bin"); - void* batch_normalization_33_variance = readTrainedWeights(batch_normalization_33_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_34_w_path = dir_prefix + std::string("conv2d_34_w.bin"); - void* conv2d_34_w = readTrainedWeights(conv2d_34_w_path.c_str(), 0,1024,256,1,1); - std::string conv2d_34_b_path = dir_prefix + std::string("conv2d_34_b.bin"); - void* conv2d_34_b = readTrainedWeights(conv2d_34_b_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_34_gamma_path = dir_prefix + std::string("batch_normalization_34_gamma.bin"); - void* batch_normalization_34_gamma = readTrainedWeights(batch_normalization_34_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_34_beta_path = dir_prefix + std::string("batch_normalization_34_beta.bin"); - void* batch_normalization_34_beta = readTrainedWeights(batch_normalization_34_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_34_mean_path = dir_prefix + std::string("batch_normalization_34_mean.bin"); - void* batch_normalization_34_mean = readTrainedWeights(batch_normalization_34_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_34_variance_path = dir_prefix + std::string("batch_normalization_34_variance.bin"); - void* batch_normalization_34_variance = readTrainedWeights(batch_normalization_34_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_35_w_path = dir_prefix + std::string("conv2d_35_w.bin"); - void* conv2d_35_w = readTrainedWeights(conv2d_35_w_path.c_str(), 0,256,1024,1,1); - std::string conv2d_35_b_path = dir_prefix + std::string("conv2d_35_b.bin"); - void* conv2d_35_b = readTrainedWeights(conv2d_35_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_35_gamma_path = dir_prefix + std::string("batch_normalization_35_gamma.bin"); - void* batch_normalization_35_gamma = readTrainedWeights(batch_normalization_35_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_35_beta_path = dir_prefix + std::string("batch_normalization_35_beta.bin"); - void* batch_normalization_35_beta = readTrainedWeights(batch_normalization_35_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_35_mean_path = dir_prefix + std::string("batch_normalization_35_mean.bin"); - void* batch_normalization_35_mean = readTrainedWeights(batch_normalization_35_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_35_variance_path = dir_prefix + std::string("batch_normalization_35_variance.bin"); - void* batch_normalization_35_variance = readTrainedWeights(batch_normalization_35_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_36_w_path = dir_prefix + std::string("conv2d_36_w.bin"); - void* conv2d_36_w = readTrainedWeights(conv2d_36_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_36_b_path = dir_prefix + std::string("conv2d_36_b.bin"); - void* conv2d_36_b = readTrainedWeights(conv2d_36_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_36_gamma_path = dir_prefix + std::string("batch_normalization_36_gamma.bin"); - void* batch_normalization_36_gamma = readTrainedWeights(batch_normalization_36_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_36_beta_path = dir_prefix + std::string("batch_normalization_36_beta.bin"); - void* batch_normalization_36_beta = readTrainedWeights(batch_normalization_36_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_36_mean_path = dir_prefix + std::string("batch_normalization_36_mean.bin"); - void* batch_normalization_36_mean = readTrainedWeights(batch_normalization_36_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_36_variance_path = dir_prefix + std::string("batch_normalization_36_variance.bin"); - void* batch_normalization_36_variance = readTrainedWeights(batch_normalization_36_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_37_w_path = dir_prefix + std::string("conv2d_37_w.bin"); - void* conv2d_37_w = readTrainedWeights(conv2d_37_w_path.c_str(), 0,1024,256,1,1); - std::string conv2d_37_b_path = dir_prefix + std::string("conv2d_37_b.bin"); - void* conv2d_37_b = readTrainedWeights(conv2d_37_b_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_37_gamma_path = dir_prefix + std::string("batch_normalization_37_gamma.bin"); - void* batch_normalization_37_gamma = readTrainedWeights(batch_normalization_37_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_37_beta_path = dir_prefix + std::string("batch_normalization_37_beta.bin"); - void* batch_normalization_37_beta = readTrainedWeights(batch_normalization_37_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_37_mean_path = dir_prefix + std::string("batch_normalization_37_mean.bin"); - void* batch_normalization_37_mean = readTrainedWeights(batch_normalization_37_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_37_variance_path = dir_prefix + std::string("batch_normalization_37_variance.bin"); - void* batch_normalization_37_variance = readTrainedWeights(batch_normalization_37_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_38_w_path = dir_prefix + std::string("conv2d_38_w.bin"); - void* conv2d_38_w = readTrainedWeights(conv2d_38_w_path.c_str(), 0,256,1024,1,1); - std::string conv2d_38_b_path = dir_prefix + std::string("conv2d_38_b.bin"); - void* conv2d_38_b = readTrainedWeights(conv2d_38_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_38_gamma_path = dir_prefix + std::string("batch_normalization_38_gamma.bin"); - void* batch_normalization_38_gamma = readTrainedWeights(batch_normalization_38_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_38_beta_path = dir_prefix + std::string("batch_normalization_38_beta.bin"); - void* batch_normalization_38_beta = readTrainedWeights(batch_normalization_38_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_38_mean_path = dir_prefix + std::string("batch_normalization_38_mean.bin"); - void* batch_normalization_38_mean = readTrainedWeights(batch_normalization_38_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_38_variance_path = dir_prefix + std::string("batch_normalization_38_variance.bin"); - void* batch_normalization_38_variance = readTrainedWeights(batch_normalization_38_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_39_w_path = dir_prefix + std::string("conv2d_39_w.bin"); - void* conv2d_39_w = readTrainedWeights(conv2d_39_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_39_b_path = dir_prefix + std::string("conv2d_39_b.bin"); - void* conv2d_39_b = readTrainedWeights(conv2d_39_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_39_gamma_path = dir_prefix + std::string("batch_normalization_39_gamma.bin"); - void* batch_normalization_39_gamma = readTrainedWeights(batch_normalization_39_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_39_beta_path = dir_prefix + std::string("batch_normalization_39_beta.bin"); - void* batch_normalization_39_beta = readTrainedWeights(batch_normalization_39_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_39_mean_path = dir_prefix + std::string("batch_normalization_39_mean.bin"); - void* batch_normalization_39_mean = readTrainedWeights(batch_normalization_39_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_39_variance_path = dir_prefix + std::string("batch_normalization_39_variance.bin"); - void* batch_normalization_39_variance = readTrainedWeights(batch_normalization_39_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_40_w_path = dir_prefix + std::string("conv2d_40_w.bin"); - void* conv2d_40_w = readTrainedWeights(conv2d_40_w_path.c_str(), 0,1024,256,1,1); - std::string conv2d_40_b_path = dir_prefix + std::string("conv2d_40_b.bin"); - void* conv2d_40_b = readTrainedWeights(conv2d_40_b_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_40_gamma_path = dir_prefix + std::string("batch_normalization_40_gamma.bin"); - void* batch_normalization_40_gamma = readTrainedWeights(batch_normalization_40_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_40_beta_path = dir_prefix + std::string("batch_normalization_40_beta.bin"); - void* batch_normalization_40_beta = readTrainedWeights(batch_normalization_40_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_40_mean_path = dir_prefix + std::string("batch_normalization_40_mean.bin"); - void* batch_normalization_40_mean = readTrainedWeights(batch_normalization_40_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_40_variance_path = dir_prefix + std::string("batch_normalization_40_variance.bin"); - void* batch_normalization_40_variance = readTrainedWeights(batch_normalization_40_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_41_w_path = dir_prefix + std::string("conv2d_41_w.bin"); - void* conv2d_41_w = readTrainedWeights(conv2d_41_w_path.c_str(), 0,256,1024,1,1); - std::string conv2d_41_b_path = dir_prefix + std::string("conv2d_41_b.bin"); - void* conv2d_41_b = readTrainedWeights(conv2d_41_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_41_gamma_path = dir_prefix + std::string("batch_normalization_41_gamma.bin"); - void* batch_normalization_41_gamma = readTrainedWeights(batch_normalization_41_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_41_beta_path = dir_prefix + std::string("batch_normalization_41_beta.bin"); - void* batch_normalization_41_beta = readTrainedWeights(batch_normalization_41_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_41_mean_path = dir_prefix + std::string("batch_normalization_41_mean.bin"); - void* batch_normalization_41_mean = readTrainedWeights(batch_normalization_41_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_41_variance_path = dir_prefix + std::string("batch_normalization_41_variance.bin"); - void* batch_normalization_41_variance = readTrainedWeights(batch_normalization_41_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_42_w_path = dir_prefix + std::string("conv2d_42_w.bin"); - void* conv2d_42_w = readTrainedWeights(conv2d_42_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_42_b_path = dir_prefix + std::string("conv2d_42_b.bin"); - void* conv2d_42_b = readTrainedWeights(conv2d_42_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_42_gamma_path = dir_prefix + std::string("batch_normalization_42_gamma.bin"); - void* batch_normalization_42_gamma = readTrainedWeights(batch_normalization_42_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_42_beta_path = dir_prefix + std::string("batch_normalization_42_beta.bin"); - void* batch_normalization_42_beta = readTrainedWeights(batch_normalization_42_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_42_mean_path = dir_prefix + std::string("batch_normalization_42_mean.bin"); - void* batch_normalization_42_mean = readTrainedWeights(batch_normalization_42_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_42_variance_path = dir_prefix + std::string("batch_normalization_42_variance.bin"); - void* batch_normalization_42_variance = readTrainedWeights(batch_normalization_42_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_43_w_path = dir_prefix + std::string("conv2d_43_w.bin"); - void* conv2d_43_w = readTrainedWeights(conv2d_43_w_path.c_str(), 0,1024,256,1,1); - std::string conv2d_43_b_path = dir_prefix + std::string("conv2d_43_b.bin"); - void* conv2d_43_b = readTrainedWeights(conv2d_43_b_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_43_gamma_path = dir_prefix + std::string("batch_normalization_43_gamma.bin"); - void* batch_normalization_43_gamma = readTrainedWeights(batch_normalization_43_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_43_beta_path = dir_prefix + std::string("batch_normalization_43_beta.bin"); - void* batch_normalization_43_beta = readTrainedWeights(batch_normalization_43_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_43_mean_path = dir_prefix + std::string("batch_normalization_43_mean.bin"); - void* batch_normalization_43_mean = readTrainedWeights(batch_normalization_43_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_43_variance_path = dir_prefix + std::string("batch_normalization_43_variance.bin"); - void* batch_normalization_43_variance = readTrainedWeights(batch_normalization_43_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_44_w_path = dir_prefix + std::string("conv2d_44_w.bin"); - void* conv2d_44_w = readTrainedWeights(conv2d_44_w_path.c_str(), 0,512,1024,1,1); - std::string conv2d_44_b_path = dir_prefix + std::string("conv2d_44_b.bin"); - void* conv2d_44_b = readTrainedWeights(conv2d_44_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_44_gamma_path = dir_prefix + std::string("batch_normalization_44_gamma.bin"); - void* batch_normalization_44_gamma = readTrainedWeights(batch_normalization_44_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_44_beta_path = dir_prefix + std::string("batch_normalization_44_beta.bin"); - void* batch_normalization_44_beta = readTrainedWeights(batch_normalization_44_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_44_mean_path = dir_prefix + std::string("batch_normalization_44_mean.bin"); - void* batch_normalization_44_mean = readTrainedWeights(batch_normalization_44_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_44_variance_path = dir_prefix + std::string("batch_normalization_44_variance.bin"); - void* batch_normalization_44_variance = readTrainedWeights(batch_normalization_44_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_45_w_path = dir_prefix + std::string("conv2d_45_w.bin"); - void* conv2d_45_w = readTrainedWeights(conv2d_45_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_45_b_path = dir_prefix + std::string("conv2d_45_b.bin"); - void* conv2d_45_b = readTrainedWeights(conv2d_45_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_45_gamma_path = dir_prefix + std::string("batch_normalization_45_gamma.bin"); - void* batch_normalization_45_gamma = readTrainedWeights(batch_normalization_45_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_45_beta_path = dir_prefix + std::string("batch_normalization_45_beta.bin"); - void* batch_normalization_45_beta = readTrainedWeights(batch_normalization_45_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_45_mean_path = dir_prefix + std::string("batch_normalization_45_mean.bin"); - void* batch_normalization_45_mean = readTrainedWeights(batch_normalization_45_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_45_variance_path = dir_prefix + std::string("batch_normalization_45_variance.bin"); - void* batch_normalization_45_variance = readTrainedWeights(batch_normalization_45_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_46_w_path = dir_prefix + std::string("conv2d_46_w.bin"); - void* conv2d_46_w = readTrainedWeights(conv2d_46_w_path.c_str(), 0,2048,512,1,1); - std::string conv2d_46_b_path = dir_prefix + std::string("conv2d_46_b.bin"); - void* conv2d_46_b = readTrainedWeights(conv2d_46_b_path.c_str(), 0,1,2048,1,1); - std::string conv2d_47_w_path = dir_prefix + std::string("conv2d_47_w.bin"); - void* conv2d_47_w = readTrainedWeights(conv2d_47_w_path.c_str(), 0,2048,1024,1,1); - std::string conv2d_47_b_path = dir_prefix + std::string("conv2d_47_b.bin"); - void* conv2d_47_b = readTrainedWeights(conv2d_47_b_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_46_gamma_path = dir_prefix + std::string("batch_normalization_46_gamma.bin"); - void* batch_normalization_46_gamma = readTrainedWeights(batch_normalization_46_gamma_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_46_beta_path = dir_prefix + std::string("batch_normalization_46_beta.bin"); - void* batch_normalization_46_beta = readTrainedWeights(batch_normalization_46_beta_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_46_mean_path = dir_prefix + std::string("batch_normalization_46_mean.bin"); - void* batch_normalization_46_mean = readTrainedWeights(batch_normalization_46_mean_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_46_variance_path = dir_prefix + std::string("batch_normalization_46_variance.bin"); - void* batch_normalization_46_variance = readTrainedWeights(batch_normalization_46_variance_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_47_gamma_path = dir_prefix + std::string("batch_normalization_47_gamma.bin"); - void* batch_normalization_47_gamma = readTrainedWeights(batch_normalization_47_gamma_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_47_beta_path = dir_prefix + std::string("batch_normalization_47_beta.bin"); - void* batch_normalization_47_beta = readTrainedWeights(batch_normalization_47_beta_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_47_mean_path = dir_prefix + std::string("batch_normalization_47_mean.bin"); - void* batch_normalization_47_mean = readTrainedWeights(batch_normalization_47_mean_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_47_variance_path = dir_prefix + std::string("batch_normalization_47_variance.bin"); - void* batch_normalization_47_variance = readTrainedWeights(batch_normalization_47_variance_path.c_str(), 0,1,2048,1,1); - std::string conv2d_48_w_path = dir_prefix + std::string("conv2d_48_w.bin"); - void* conv2d_48_w = readTrainedWeights(conv2d_48_w_path.c_str(), 0,512,2048,1,1); - std::string conv2d_48_b_path = dir_prefix + std::string("conv2d_48_b.bin"); - void* conv2d_48_b = readTrainedWeights(conv2d_48_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_48_gamma_path = dir_prefix + std::string("batch_normalization_48_gamma.bin"); - void* batch_normalization_48_gamma = readTrainedWeights(batch_normalization_48_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_48_beta_path = dir_prefix + std::string("batch_normalization_48_beta.bin"); - void* batch_normalization_48_beta = readTrainedWeights(batch_normalization_48_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_48_mean_path = dir_prefix + std::string("batch_normalization_48_mean.bin"); - void* batch_normalization_48_mean = readTrainedWeights(batch_normalization_48_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_48_variance_path = dir_prefix + std::string("batch_normalization_48_variance.bin"); - void* batch_normalization_48_variance = readTrainedWeights(batch_normalization_48_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_49_w_path = dir_prefix + std::string("conv2d_49_w.bin"); - void* conv2d_49_w = readTrainedWeights(conv2d_49_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_49_b_path = dir_prefix + std::string("conv2d_49_b.bin"); - void* conv2d_49_b = readTrainedWeights(conv2d_49_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_49_gamma_path = dir_prefix + std::string("batch_normalization_49_gamma.bin"); - void* batch_normalization_49_gamma = readTrainedWeights(batch_normalization_49_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_49_beta_path = dir_prefix + std::string("batch_normalization_49_beta.bin"); - void* batch_normalization_49_beta = readTrainedWeights(batch_normalization_49_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_49_mean_path = dir_prefix + std::string("batch_normalization_49_mean.bin"); - void* batch_normalization_49_mean = readTrainedWeights(batch_normalization_49_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_49_variance_path = dir_prefix + std::string("batch_normalization_49_variance.bin"); - void* batch_normalization_49_variance = readTrainedWeights(batch_normalization_49_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_50_w_path = dir_prefix + std::string("conv2d_50_w.bin"); - void* conv2d_50_w = readTrainedWeights(conv2d_50_w_path.c_str(), 0,2048,512,1,1); - std::string conv2d_50_b_path = dir_prefix + std::string("conv2d_50_b.bin"); - void* conv2d_50_b = readTrainedWeights(conv2d_50_b_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_50_gamma_path = dir_prefix + std::string("batch_normalization_50_gamma.bin"); - void* batch_normalization_50_gamma = readTrainedWeights(batch_normalization_50_gamma_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_50_beta_path = dir_prefix + std::string("batch_normalization_50_beta.bin"); - void* batch_normalization_50_beta = readTrainedWeights(batch_normalization_50_beta_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_50_mean_path = dir_prefix + std::string("batch_normalization_50_mean.bin"); - void* batch_normalization_50_mean = readTrainedWeights(batch_normalization_50_mean_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_50_variance_path = dir_prefix + std::string("batch_normalization_50_variance.bin"); - void* batch_normalization_50_variance = readTrainedWeights(batch_normalization_50_variance_path.c_str(), 0,1,2048,1,1); - std::string conv2d_51_w_path = dir_prefix + std::string("conv2d_51_w.bin"); - void* conv2d_51_w = readTrainedWeights(conv2d_51_w_path.c_str(), 0,512,2048,1,1); - std::string conv2d_51_b_path = dir_prefix + std::string("conv2d_51_b.bin"); - void* conv2d_51_b = readTrainedWeights(conv2d_51_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_51_gamma_path = dir_prefix + std::string("batch_normalization_51_gamma.bin"); - void* batch_normalization_51_gamma = readTrainedWeights(batch_normalization_51_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_51_beta_path = dir_prefix + std::string("batch_normalization_51_beta.bin"); - void* batch_normalization_51_beta = readTrainedWeights(batch_normalization_51_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_51_mean_path = dir_prefix + std::string("batch_normalization_51_mean.bin"); - void* batch_normalization_51_mean = readTrainedWeights(batch_normalization_51_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_51_variance_path = dir_prefix + std::string("batch_normalization_51_variance.bin"); - void* batch_normalization_51_variance = readTrainedWeights(batch_normalization_51_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_52_w_path = dir_prefix + std::string("conv2d_52_w.bin"); - void* conv2d_52_w = readTrainedWeights(conv2d_52_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_52_b_path = dir_prefix + std::string("conv2d_52_b.bin"); - void* conv2d_52_b = readTrainedWeights(conv2d_52_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_52_gamma_path = dir_prefix + std::string("batch_normalization_52_gamma.bin"); - void* batch_normalization_52_gamma = readTrainedWeights(batch_normalization_52_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_52_beta_path = dir_prefix + std::string("batch_normalization_52_beta.bin"); - void* batch_normalization_52_beta = readTrainedWeights(batch_normalization_52_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_52_mean_path = dir_prefix + std::string("batch_normalization_52_mean.bin"); - void* batch_normalization_52_mean = readTrainedWeights(batch_normalization_52_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_52_variance_path = dir_prefix + std::string("batch_normalization_52_variance.bin"); - void* batch_normalization_52_variance = readTrainedWeights(batch_normalization_52_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_53_w_path = dir_prefix + std::string("conv2d_53_w.bin"); - void* conv2d_53_w = readTrainedWeights(conv2d_53_w_path.c_str(), 0,2048,512,1,1); - std::string conv2d_53_b_path = dir_prefix + std::string("conv2d_53_b.bin"); - void* conv2d_53_b = readTrainedWeights(conv2d_53_b_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_53_gamma_path = dir_prefix + std::string("batch_normalization_53_gamma.bin"); - void* batch_normalization_53_gamma = readTrainedWeights(batch_normalization_53_gamma_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_53_beta_path = dir_prefix + std::string("batch_normalization_53_beta.bin"); - void* batch_normalization_53_beta = readTrainedWeights(batch_normalization_53_beta_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_53_mean_path = dir_prefix + std::string("batch_normalization_53_mean.bin"); - void* batch_normalization_53_mean = readTrainedWeights(batch_normalization_53_mean_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_53_variance_path = dir_prefix + std::string("batch_normalization_53_variance.bin"); - void* batch_normalization_53_variance = readTrainedWeights(batch_normalization_53_variance_path.c_str(), 0,1,2048,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,2048,1000); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,1000,1,1); - - - for (int i = 0 ; i < total_runs; i++){ - - // NOTE: Wait on signal from OpenTuner - stallOnOpenTunerSignal(); - - startMemTracking(); - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - for(int i = 0; i < batch_count; i++){ - - - int start = i * batch_size; - int end = (i + 1) * batch_size; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,224,224); - - // NOTE: The pooling stride is 3*3 while it should be 2*2 -- interface itself needs fixing -- fix this manually in this case - void* var_0 = ConvLayer_PROMISE2(input, -123.68, 151.061, conv2d_1_w, -0.574422012090683, 0.5646807488203113, conv2d_1_b, -0.004829655, 0.014784645, 3, 3, 2, 2, 0, 3, 2, 1, 0.0, 689.7822875976562, 9); - void* var_1 = tensorBatchNorm(var_0, batch_normalization_1_gamma, batch_normalization_1_beta, batch_normalization_1_mean, batch_normalization_1_variance, 0.001); - void* var_2 = ConvLayer_PROMISE(var_1, -4.952117443084717, 12.02118032741582, conv2d_2_w, -0.5448235973715783, 0.2447893574833928, conv2d_2_b, -0.0001412337, 0.00017318528, 0, 0, 1, 1, -1, 0, -1, -9.212617980003357, 8.107657526016425, 9); - void* var_3 = tensorBatchNorm(var_2, batch_normalization_2_gamma, batch_normalization_2_beta, batch_normalization_2_mean, batch_normalization_2_variance, 0.001); - void* var_4 = tensorRelu(var_3); - void* var_5 = ConvLayer_PROMISE(var_4, 0.0, 5.801381123542811, conv2d_3_w, -0.18028786177933215, 0.21247629988193606, conv2d_3_b, -7.8663266e-05, 0.00018541634, 1, 1, 1, 1, -1, 0, -1, -6.834556140899658, 8.541351353645396, 9); - void* var_6 = tensorBatchNorm(var_5, batch_normalization_3_gamma, batch_normalization_3_beta, batch_normalization_3_mean, batch_normalization_3_variance, 0.001); - void* var_7 = tensorRelu(var_6); - void* var_8 = ConvLayer_PROMISE(var_7, 0.0, 9.866454153060971, conv2d_4_w, -0.2255178820490837, 0.2254851074665791, conv2d_4_b, -0.00017080337, 0.00021038808, 0, 0, 1, 1, -1, 0, -1, -3.595476400852203, 3.637018930196785, 9); - void* var_9 = tensorBatchNorm(var_8, batch_normalization_4_gamma, batch_normalization_4_beta, batch_normalization_4_mean, batch_normalization_4_variance, 0.001); - void* var_10 = ConvLayer_PROMISE(var_1, -4.952117443084717, 12.02118032741582, conv2d_5_w, -0.43272915667295453, 0.29589187785983095, conv2d_5_b, -0.000107640364, 0.00013177324, 0, 0, 1, 1, -1, 0, -1, -7.581318395137787, 7.8835730876923265, 9); - void* var_11 = tensorBatchNorm(var_10, batch_normalization_5_gamma, batch_normalization_5_beta, batch_normalization_5_mean, batch_normalization_5_variance, 0.001); - void* var_12 = tensorAdd(var_9, var_11); - void* var_13 = tensorRelu(var_12); - void* var_14 = ConvLayer_PROMISE(var_13, 0.0, 5.885549548625953, conv2d_6_w, -0.17062100511789324, 0.1432653286457067, conv2d_6_b, -7.950033e-05, 0.000104833845, 0, 0, 1, 1, -1, 0, -1, -5.310503073692322, 3.8418860490322224, 9); - void* var_15 = tensorBatchNorm(var_14, batch_normalization_6_gamma, batch_normalization_6_beta, batch_normalization_6_mean, batch_normalization_6_variance, 0.001); - void* var_16 = tensorRelu(var_15); - void* var_17 = ConvLayer_PROMISE(var_16, 0.0, 4.006655237674757, conv2d_7_w, -0.15594010630249977, 0.15720265829563249, conv2d_7_b, -6.419372e-05, 6.503685e-05, 1, 1, 1, 1, -1, 0, -1, -3.4114532544612883, 3.075598966121696, 9); - void* var_18 = tensorBatchNorm(var_17, batch_normalization_7_gamma, batch_normalization_7_beta, batch_normalization_7_mean, batch_normalization_7_variance, 0.001); - void* var_19 = tensorRelu(var_18); - void* var_20 = ConvLayer_PROMISE(var_19, 0.0, 4.186545849800112, conv2d_8_w, -0.1599232355505228, 0.17352246379853484, conv2d_8_b, -8.235522e-05, 0.000105946136, 0, 0, 1, 1, -1, 0, -1, -1.5299443051815034, 1.425760628223422, 9); - void* var_21 = tensorBatchNorm(var_20, batch_normalization_8_gamma, batch_normalization_8_beta, batch_normalization_8_mean, batch_normalization_8_variance, 0.001); - void* var_22 = tensorAdd(var_21, var_13); - void* var_23 = tensorRelu(var_22); - void* var_24 = ConvLayer_PROMISE(var_23, 0.0, 6.36634494018557, conv2d_9_w, -0.14470596650242806, 0.14421831880510708, conv2d_9_b, -3.4270335e-05, 4.177745e-05, 0, 0, 1, 1, -1, 0, -1, -4.584994326114654, 3.8648653411866007, 9); - void* var_25 = tensorBatchNorm(var_24, batch_normalization_9_gamma, batch_normalization_9_beta, batch_normalization_9_mean, batch_normalization_9_variance, 0.001); - void* var_26 = tensorRelu(var_25); - void* var_27 = ConvLayer_PROMISE(var_26, 0.0, 3.3001420612335437, conv2d_10_w, -0.12276832074671984, 0.12627632835507407, conv2d_10_b, -5.8183014e-05, 3.3546e-05, 1, 1, 1, 1, -1, 0, -1, -2.828902014493942, 3.0918669717311893, 9); - void* var_28 = tensorBatchNorm(var_27, batch_normalization_10_gamma, batch_normalization_10_beta, batch_normalization_10_mean, batch_normalization_10_variance, 0.001); - void* var_29 = tensorRelu(var_28); - void* var_30 = ConvLayer_PROMISE(var_29, 0.0, 5.313344509124818, conv2d_11_w, -0.1685639199912548, 0.16309838759899448, conv2d_11_b, -5.3248757e-05, 5.70645e-05, 0, 0, 1, 1, -1, 0, -1, -1.838510752558708, 1.3678752244711045, 9); - void* var_31 = tensorBatchNorm(var_30, batch_normalization_11_gamma, batch_normalization_11_beta, batch_normalization_11_mean, batch_normalization_11_variance, 0.001); - void* var_32 = tensorAdd(var_31, var_23); - void* var_33 = tensorRelu(var_32); - void* var_34 = ConvLayer_PROMISE(var_33, 0.0, 6.605899341106429, conv2d_12_w, -0.149728477448225, 0.13948052291572155, conv2d_12_b, -2.5221272e-05, 3.551765e-05, 0, 0, 2, 2, -1, 0, -1, -5.011460402488709, 3.915426737308551, 9); - void* var_35 = tensorBatchNorm(var_34, batch_normalization_12_gamma, batch_normalization_12_beta, batch_normalization_12_mean, batch_normalization_12_variance, 0.001); - void* var_36 = tensorRelu(var_35); - void* var_37 = ConvLayer_PROMISE(var_36, 0.0, 3.794741600990312, conv2d_13_w, -0.09761696971952916, 0.11394361693412249, conv2d_13_b, -3.715329e-05, 2.9298411e-05, 1, 1, 1, 1, -1, 0, -1, -5.206686987876893, 4.520638871669791, 9); - void* var_38 = tensorBatchNorm(var_37, batch_normalization_13_gamma, batch_normalization_13_beta, batch_normalization_13_mean, batch_normalization_13_variance, 0.001); - void* var_39 = tensorRelu(var_38); - void* var_40 = ConvLayer_PROMISE(var_39, 0.0, 3.7149479997158603, conv2d_14_w, -0.14844063371419908, 0.14925702929496953, conv2d_14_b, -6.0864673e-05, 5.4444306e-05, 0, 0, 1, 1, -1, 0, -1, -1.5011818276643754, 1.40834725618366, 9); - void* var_41 = tensorBatchNorm(var_40, batch_normalization_14_gamma, batch_normalization_14_beta, batch_normalization_14_mean, batch_normalization_14_variance, 0.001); - void* var_42 = ConvLayer_PROMISE(var_33, 0.0, 6.605899341106429, conv2d_15_w, -0.1642171936035156, 0.16866817833483497, conv2d_15_b, -2.4068044e-05, 2.5504653e-05, 0, 0, 2, 2, -1, 0, -1, -4.410076716423035, 4.014970501422923, 9); - void* var_43 = tensorBatchNorm(var_42, batch_normalization_15_gamma, batch_normalization_15_beta, batch_normalization_15_mean, batch_normalization_15_variance, 0.001); - void* var_44 = tensorAdd(var_41, var_43); - void* var_45 = tensorRelu(var_44); - void* var_46 = ConvLayer_PROMISE(var_45, 0.0, 6.518892978191488, conv2d_16_w, -0.09702376063913107, 0.1054209597408773, conv2d_16_b, -1.47610735e-05, 1.7075112e-05, 0, 0, 1, 1, -1, 0, -1, -4.87446900844574, 3.7661991298198862, 9); - void* var_47 = tensorBatchNorm(var_46, batch_normalization_16_gamma, batch_normalization_16_beta, batch_normalization_16_mean, batch_normalization_16_variance, 0.001); - void* var_48 = tensorRelu(var_47); - void* var_49 = ConvLayer_PROMISE(var_48, 0.0, 3.259194364786183, conv2d_17_w, -0.08665236312896013, 0.0898308474570517, conv2d_17_b, -3.9163042e-05, 4.2771928e-05, 1, 1, 1, 1, -1, 0, -1, -2.673636848211288, 2.3574042041302774, 9); - void* var_50 = tensorBatchNorm(var_49, batch_normalization_17_gamma, batch_normalization_17_beta, batch_normalization_17_mean, batch_normalization_17_variance, 0.001); - void* var_51 = tensorRelu(var_50); - void* var_52 = ConvLayer_PROMISE(var_51, 0.0, 3.641261647939746, conv2d_18_w, -0.12198246002197266, 0.1347003544867095, conv2d_18_b, -5.3173797e-05, 4.8076203e-05, 0, 0, 1, 1, -1, 0, -1, -1.0623184064626694, 0.916913630664359, 9); - void* var_53 = tensorBatchNorm(var_52, batch_normalization_18_gamma, batch_normalization_18_beta, batch_normalization_18_mean, batch_normalization_18_variance, 0.001); - void* var_54 = tensorAdd(var_53, var_45); - void* var_55 = tensorRelu(var_54); - void* var_56 = ConvLayer_PROMISE(var_55, 0.0, 6.852215012073557, conv2d_19_w, -0.1122598509863019, 0.1435348897427337, conv2d_19_b, -1.20778e-05, 2.599136e-05, 0, 0, 1, 1, -1, 0, -1, -6.0281127138137816, 6.227049376964593, 9); - void* var_57 = tensorBatchNorm(var_56, batch_normalization_19_gamma, batch_normalization_19_beta, batch_normalization_19_mean, batch_normalization_19_variance, 0.001); - void* var_58 = tensorRelu(var_57); - void* var_59 = ConvLayer_PROMISE(var_58, 0.0, 3.397107238292711, conv2d_20_w, -0.1049889962002635, 0.1349111200869117, conv2d_20_b, -2.7412994e-05, 3.9722e-05, 1, 1, 1, 1, -1, 0, -1, -4.057081372261047, 4.329259678363884, 9); - void* var_60 = tensorBatchNorm(var_59, batch_normalization_20_gamma, batch_normalization_20_beta, batch_normalization_20_mean, batch_normalization_20_variance, 0.001); - void* var_61 = tensorRelu(var_60); - void* var_62 = ConvLayer_PROMISE(var_61, 0.0, 3.6484641625881262, conv2d_21_w, -0.1401274445652962, 0.12122062336653527, conv2d_21_b, -5.5854776e-05, 7.8164114e-05, 0, 0, 1, 1, -1, 0, -1, -1.626526164531708, 0.8401960272193048, 9); - void* var_63 = tensorBatchNorm(var_62, batch_normalization_21_gamma, batch_normalization_21_beta, batch_normalization_21_mean, batch_normalization_21_variance, 0.001); - void* var_64 = tensorAdd(var_63, var_55); - void* var_65 = tensorRelu(var_64); - void* var_66 = ConvLayer_PROMISE(var_65, 0.0, 6.820035747528095, conv2d_22_w, -0.16039140529930593, 0.18889211259782335, conv2d_22_b, -4.6078047e-05, 3.3613425e-05, 0, 0, 1, 1, -1, 0, -1, -4.6271090393066405, 4.527790556430912, 9); - void* var_67 = tensorBatchNorm(var_66, batch_normalization_22_gamma, batch_normalization_22_beta, batch_normalization_22_mean, batch_normalization_22_variance, 0.001); - void* var_68 = tensorRelu(var_67); - void* var_69 = ConvLayer_PROMISE(var_68, 0.0, 4.432856665611537, conv2d_23_w, -0.11397356178611517, 0.10787127982825667, conv2d_23_b, -3.6726604e-05, 2.4220695e-05, 1, 1, 1, 1, -1, 0, -1, -3.697339488506317, 3.1427979104519426, 9); - void* var_70 = tensorBatchNorm(var_69, batch_normalization_23_gamma, batch_normalization_23_beta, batch_normalization_23_mean, batch_normalization_23_variance, 0.001); - void* var_71 = tensorRelu(var_70); - void* var_72 = ConvLayer_PROMISE(var_71, 0.0, 4.711423307418915, conv2d_24_w, -0.11341997660696507, 0.1437816035747536, conv2d_24_b, -2.7102393e-05, 3.091236e-05, 0, 0, 1, 1, -1, 0, -1, -1.4133628906011582, 1.2987316379547167, 9); - void* var_73 = tensorBatchNorm(var_72, batch_normalization_24_gamma, batch_normalization_24_beta, batch_normalization_24_mean, batch_normalization_24_variance, 0.001); - void* var_74 = tensorAdd(var_73, var_65); - void* var_75 = tensorRelu(var_74); - void* var_76 = ConvLayer_PROMISE(var_75, 0.0, 7.624651549339404, conv2d_25_w, -0.10495923960208893, 0.12068889104576047, conv2d_25_b, -1.0208429e-05, 1.1486276e-05, 0, 0, 2, 2, -1, 0, -1, -3.87531214427948, 3.676609352588745, 9); - void* var_77 = tensorBatchNorm(var_76, batch_normalization_25_gamma, batch_normalization_25_beta, batch_normalization_25_mean, batch_normalization_25_variance, 0.001); - void* var_78 = tensorRelu(var_77); - void* var_79 = ConvLayer_PROMISE(var_78, 0.0, 4.044620439529737, conv2d_26_w, -0.07615160812437534, 0.07977425544709099, conv2d_26_b, -2.4272886e-05, 1.6434806e-05, 1, 1, 1, 1, -1, 0, -1, -6.102653044223786, 4.761939919948585, 9); - void* var_80 = tensorBatchNorm(var_79, batch_normalization_26_gamma, batch_normalization_26_beta, batch_normalization_26_mean, batch_normalization_26_variance, 0.001); - void* var_81 = tensorRelu(var_80); - void* var_82 = ConvLayer_PROMISE(var_81, 0.0, 3.4468260111809705, conv2d_27_w, -0.11533496034890414, 0.10714908299595141, conv2d_27_b, -3.225456e-05, 4.8422902e-05, 0, 0, 1, 1, -1, 0, -1, -1.319659793496132, 1.0189965035915467, 9); - void* var_83 = tensorBatchNorm(var_82, batch_normalization_27_gamma, batch_normalization_27_beta, batch_normalization_27_mean, batch_normalization_27_variance, 0.001); - void* var_84 = ConvLayer_PROMISE(var_75, 0.0, 7.624651549339404, conv2d_28_w, -0.0966497472524643, 0.10240990699082783, conv2d_28_b, -1.4815519e-05, 1.554276e-05, 0, 0, 2, 2, -1, 0, -1, -3.9412443549633025, 3.863056869030064, 9); - void* var_85 = tensorBatchNorm(var_84, batch_normalization_28_gamma, batch_normalization_28_beta, batch_normalization_28_mean, batch_normalization_28_variance, 0.001); - void* var_86 = tensorAdd(var_83, var_85); - void* var_87 = tensorRelu(var_86); - void* var_88 = ConvLayer_PROMISE(var_87, 0.0, 6.879177100658442, conv2d_29_w, -0.06468586190789938, 0.08113565444201333, conv2d_29_b, -7.4607115e-06, 6.926009e-06, 0, 0, 1, 1, -1, 0, -1, -7.112777866363525, 4.633408185959027, 9); - void* var_89 = tensorBatchNorm(var_88, batch_normalization_29_gamma, batch_normalization_29_beta, batch_normalization_29_mean, batch_normalization_29_variance, 0.001); - void* var_90 = tensorRelu(var_89); - void* var_91 = ConvLayer_PROMISE(var_90, 0.0, 3.2354076790810105, conv2d_30_w, -0.06493933162838221, 0.07104272978752861, conv2d_30_b, -1.9349398e-05, 2.0178473e-05, 1, 1, 1, 1, -1, 0, -1, -3.226332322359085, 2.5138739056587447, 9); - void* var_92 = tensorBatchNorm(var_91, batch_normalization_30_gamma, batch_normalization_30_beta, batch_normalization_30_mean, batch_normalization_30_variance, 0.001); - void* var_93 = tensorRelu(var_92); - void* var_94 = ConvLayer_PROMISE(var_93, 0.0, 3.003848925829006, conv2d_31_w, -0.0918996930718422, 0.08853508594632167, conv2d_31_b, -4.2279236e-05, 5.5378885e-05, 0, 0, 1, 1, -1, 0, -1, -0.9247466986179351, 0.572747143149404, 9); - void* var_95 = tensorBatchNorm(var_94, batch_normalization_31_gamma, batch_normalization_31_beta, batch_normalization_31_mean, batch_normalization_31_variance, 0.001); - void* var_96 = tensorAdd(var_95, var_87); - void* var_97 = tensorRelu(var_96); - void* var_98 = ConvLayer_PROMISE(var_97, 0.0, 6.566591289043519, conv2d_32_w, -0.07145480328053236, 0.09098157961666606, conv2d_32_b, -1.0478255e-05, 1.4408147e-05, 0, 0, 1, 1, -1, 0, -1, -4.183038790225982, 3.5941159300804166, 9); - void* var_99 = tensorBatchNorm(var_98, batch_normalization_32_gamma, batch_normalization_32_beta, batch_normalization_32_mean, batch_normalization_32_variance, 0.001); - void* var_100 = tensorRelu(var_99); - void* var_101 = ConvLayer_PROMISE(var_100, 0.0, 3.0348211803436556, conv2d_33_w, -0.056237234909087414, 0.06478620118647821, conv2d_33_b, -2.2639133e-05, 2.6081116e-05, 1, 1, 1, 1, -1, 0, -1, -2.098393235206604, 1.706788736581844, 9); - void* var_102 = tensorBatchNorm(var_101, batch_normalization_33_gamma, batch_normalization_33_beta, batch_normalization_33_mean, batch_normalization_33_variance, 0.001); - void* var_103 = tensorRelu(var_102); - void* var_104 = ConvLayer_PROMISE(var_103, 0.0, 3.248518852949145, conv2d_34_w, -0.07141499005258084, 0.08281665176153225, conv2d_34_b, -3.221229e-05, 4.569047e-05, 0, 0, 1, 1, -1, 0, -1, -0.8273181943893433, 0.7378616912961369, 9); - void* var_105 = tensorBatchNorm(var_104, batch_normalization_34_gamma, batch_normalization_34_beta, batch_normalization_34_mean, batch_normalization_34_variance, 0.001); - void* var_106 = tensorAdd(var_105, var_97); - void* var_107 = tensorRelu(var_106); - void* var_108 = ConvLayer_PROMISE(var_107, 0.0, 6.7038991017341765, conv2d_35_w, -0.06838216692209244, 0.09303134681284767, conv2d_35_b, -1.047402e-05, 1.0168567e-05, 0, 0, 1, 1, -1, 0, -1, -4.168091129779816, 3.5077465448380494, 9); - void* var_109 = tensorBatchNorm(var_108, batch_normalization_35_gamma, batch_normalization_35_beta, batch_normalization_35_mean, batch_normalization_35_variance, 0.001); - void* var_110 = tensorRelu(var_109); - void* var_111 = ConvLayer_PROMISE(var_110, 0.0, 2.8976624414922814, conv2d_36_w, -0.05521866928786039, 0.06331418491154919, conv2d_36_b, -3.86494e-05, 2.5999781e-05, 1, 1, 1, 1, -1, 0, -1, -2.182177306175232, 2.0366714165211324, 9); - void* var_112 = tensorBatchNorm(var_111, batch_normalization_36_gamma, batch_normalization_36_beta, batch_normalization_36_mean, batch_normalization_36_variance, 0.001); - void* var_113 = tensorRelu(var_112); - void* var_114 = ConvLayer_PROMISE(var_113, 0.0, 3.1310220296382933, conv2d_37_w, -0.07256266868114472, 0.08391195811331292, conv2d_37_b, -4.8211587e-05, 4.7546604e-05, 0, 0, 1, 1, -1, 0, -1, -1.1372777166366577, 0.5528145518899268, 9); - void* var_115 = tensorBatchNorm(var_114, batch_normalization_37_gamma, batch_normalization_37_beta, batch_normalization_37_mean, batch_normalization_37_variance, 0.001); - void* var_116 = tensorAdd(var_115, var_107); - void* var_117 = tensorRelu(var_116); - void* var_118 = ConvLayer_PROMISE(var_117, 0.0, 6.625923678875129, conv2d_38_w, -0.06549047549813986, 0.10113389839232205, conv2d_38_b, -1.2351429e-05, 9.263066e-06, 0, 0, 1, 1, -1, 0, -1, -3.846879935503006, 3.639795066118241, 9); - void* var_119 = tensorBatchNorm(var_118, batch_normalization_38_gamma, batch_normalization_38_beta, batch_normalization_38_mean, batch_normalization_38_variance, 0.001); - void* var_120 = tensorRelu(var_119); - void* var_121 = ConvLayer_PROMISE(var_120, 0.0, 3.200671393632918, conv2d_39_w, -0.05184716333821415, 0.06296417640149599, conv2d_39_b, -2.4313656e-05, 3.812053e-05, 1, 1, 1, 1, -1, 0, -1, -1.9442583957910538, 1.5269825316667864, 9); - void* var_122 = tensorBatchNorm(var_121, batch_normalization_39_gamma, batch_normalization_39_beta, batch_normalization_39_mean, batch_normalization_39_variance, 0.001); - void* var_123 = tensorRelu(var_122); - void* var_124 = ConvLayer_PROMISE(var_123, 0.0, 4.040827783107826, conv2d_40_w, -0.0670140995979309, 0.0777734544128187, conv2d_40_b, -3.378767e-05, 2.5727571e-05, 0, 0, 1, 1, -1, 0, -1, -1.3243955926895141, 0.9261298480034093, 9); - void* var_125 = tensorBatchNorm(var_124, batch_normalization_40_gamma, batch_normalization_40_beta, batch_normalization_40_mean, batch_normalization_40_variance, 0.001); - void* var_126 = tensorAdd(var_125, var_117); - void* var_127 = tensorRelu(var_126); - void* var_128 = ConvLayer_PROMISE(var_127, 0.0, 6.8198375024796505, conv2d_41_w, -0.0710306192561984, 0.10828035335987954, conv2d_41_b, -1.3110192e-05, 1.5449377e-05, 0, 0, 1, 1, -1, 0, -1, -3.2434056091308596, 5.530628140926378, 9); - void* var_129 = tensorBatchNorm(var_128, batch_normalization_41_gamma, batch_normalization_41_beta, batch_normalization_41_mean, batch_normalization_41_variance, 0.001); - void* var_130 = tensorRelu(var_129); - void* var_131 = ConvLayer_PROMISE(var_130, 0.0, 4.811174154282, conv2d_42_w, -0.056100725468248125, 0.06774817473441476, conv2d_42_b, -2.7899796e-05, 3.0695155e-05, 1, 1, 1, 1, -1, 0, -1, -3.553957043647766, 3.0058912243844595, 9); - void* var_132 = tensorBatchNorm(var_131, batch_normalization_42_gamma, batch_normalization_42_beta, batch_normalization_42_mean, batch_normalization_42_variance, 0.001); - void* var_133 = tensorRelu(var_132); - void* var_134 = ConvLayer_PROMISE(var_133, 0.0, 6.503577950477883, conv2d_43_w, -0.06820484285801648, 0.0836490480080298, conv2d_43_b, -2.2592936e-05, 2.3876093e-05, 0, 0, 1, 1, -1, 0, -1, -2.760284422159195, 1.1501846584081763, 9); - void* var_135 = tensorBatchNorm(var_134, batch_normalization_43_gamma, batch_normalization_43_beta, batch_normalization_43_mean, batch_normalization_43_variance, 0.001); - void* var_136 = tensorAdd(var_135, var_127); - void* var_137 = tensorRelu(var_136); - void* var_138 = ConvLayer_PROMISE(var_137, 0.0, 7.423539982796591, conv2d_44_w, -0.06768814034759998, 0.07900290366262253, conv2d_44_b, -1.0954906e-05, 1.2313803e-05, 0, 0, 2, 2, -1, 0, -1, -3.8250768241882325, 3.133637444972998, 9); - void* var_139 = tensorBatchNorm(var_138, batch_normalization_44_gamma, batch_normalization_44_beta, batch_normalization_44_mean, batch_normalization_44_variance, 0.001); - void* var_140 = tensorRelu(var_139); - void* var_141 = ConvLayer_PROMISE(var_140, 0.0, 3.234270730257073, conv2d_45_w, -0.04219715926796198, 0.04603923132643117, conv2d_45_b, -1.9525614e-05, 2.6300824e-05, 1, 1, 1, 1, -1, 0, -1, -3.2753402066230777, 1.8960905054807824, 9); - void* var_142 = tensorBatchNorm(var_141, batch_normalization_45_gamma, batch_normalization_45_beta, batch_normalization_45_mean, batch_normalization_45_variance, 0.001); - void* var_143 = tensorRelu(var_142); - void* var_144 = ConvLayer_PROMISE(var_143, 0.0, 2.675833512783051, conv2d_46_w, -0.051137199997901915, 0.07428906522691328, conv2d_46_b, -2.6416203e-05, 3.079251e-05, 0, 0, 1, 1, -1, 0, -1, -0.6374539139270782, 0.6678488029241574, 9); - void* var_145 = tensorBatchNorm(var_144, batch_normalization_46_gamma, batch_normalization_46_beta, batch_normalization_46_mean, batch_normalization_46_variance, 0.001); - void* var_146 = ConvLayer_PROMISE(var_137, 0.0, 7.423539982796591, conv2d_47_w, -0.047168924897909165, 0.06949675244092963, conv2d_47_b, -1.2322937e-05, 2.1868867e-05, 0, 0, 2, 2, -1, 0, -1, -1.8896190267801285, 2.387520755291127, 9); - void* var_147 = tensorBatchNorm(var_146, batch_normalization_47_gamma, batch_normalization_47_beta, batch_normalization_47_mean, batch_normalization_47_variance, 0.001); - void* var_148 = tensorAdd(var_145, var_147); - void* var_149 = tensorRelu(var_148); - void* var_150 = ConvLayer_PROMISE(var_149, 0.0, 12.392736603737378, conv2d_48_w, -0.04417608780786395, 0.06200448917225007, conv2d_48_b, -6.6323187e-06, 7.1494946e-06, 0, 0, 1, 1, -1, 0, -1, -9.068103209495545, 5.912482521057253, 9); - void* var_151 = tensorBatchNorm(var_150, batch_normalization_48_gamma, batch_normalization_48_beta, batch_normalization_48_mean, batch_normalization_48_variance, 0.001); - void* var_152 = tensorRelu(var_151); - void* var_153 = ConvLayer_PROMISE(var_152, 0.0, 2.565971518278122, conv2d_49_w, -0.036550714168697596, 0.042889032773673605, conv2d_49_b, -3.1749918e-05, 3.1403273e-05, 1, 1, 1, 1, -1, 0, -1, -2.0715825698375703, 1.4426317431927056, 9); - void* var_154 = tensorBatchNorm(var_153, batch_normalization_49_gamma, batch_normalization_49_beta, batch_normalization_49_mean, batch_normalization_49_variance, 0.001); - void* var_155 = tensorRelu(var_154); - void* var_156 = ConvLayer_PROMISE(var_155, 0.0, 2.2121606218814973, conv2d_50_w, -0.04563436089083552, 0.07235725801438761, conv2d_50_b, -5.138708e-05, 5.6959605e-05, 0, 0, 1, 1, -1, 0, -1, -0.5048498404622078, 0.4972966857850613, 9); - void* var_157 = tensorBatchNorm(var_156, batch_normalization_50_gamma, batch_normalization_50_beta, batch_normalization_50_mean, batch_normalization_50_variance, 0.001); - void* var_158 = tensorAdd(var_157, var_149); - void* var_159 = tensorRelu(var_158); - void* var_160 = ConvLayer_PROMISE(var_159, 0.0, 12.996321228027455, conv2d_51_w, -0.051894455961883065, 0.07700131461024579, conv2d_51_b, -8.893526e-06, 7.6235174e-06, 0, 0, 1, 1, -1, 0, -1, -7.534810958862305, 7.1688279371266015, 9); - void* var_161 = tensorBatchNorm(var_160, batch_normalization_51_gamma, batch_normalization_51_beta, batch_normalization_51_mean, batch_normalization_51_variance, 0.001); - void* var_162 = tensorRelu(var_161); - void* var_163 = ConvLayer_PROMISE(var_162, 0.0, 2.806837086677553, conv2d_52_w, -0.032556386385113004, 0.038920990321785316, conv2d_52_b, -3.1544037e-05, 4.5056524e-05, 1, 1, 1, 1, -1, 0, -1, -1.6795331789255141, 0.9551341712474886, 9); - void* var_164 = tensorBatchNorm(var_163, batch_normalization_52_gamma, batch_normalization_52_beta, batch_normalization_52_mean, batch_normalization_52_variance, 0.001); - void* var_165 = tensorRelu(var_164); - void* var_166 = ConvLayer_PROMISE(var_165, 0.0, 2.7935527668000724, conv2d_53_w, -0.04313115822151303, 0.0774340439587877, conv2d_53_b, -2.8713988e-05, 4.1641888e-05, 0, 0, 1, 1, -1, 0, -1, -0.5173906384706497, 0.5710835611820362, 9); - void* var_167 = tensorBatchNorm(var_166, batch_normalization_53_gamma, batch_normalization_53_beta, batch_normalization_53_mean, batch_normalization_53_variance, 0.001); - void* var_168 = tensorAdd(var_167, var_159); - void* var_169 = tensorRelu(var_168); - void* var_170 = tensorPooling(var_169,1,7,7,0,0,7,7); - void* var_171 = FCLayer_PROMISE(var_170, 0.0, 5.305631495475859, dense_1_w, -0.09220413094758988, 0.24919447432458666, dense_1_b, -0.024729362, 0.028545722, -1, -6.579668023586273, 7.794472872257277, 9); - void* var_172 = tensorSoftmax(var_171); - - uint32_t* labels = readLabelsBatch3(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy3(labels, var_172); - final_accuracy += accuracy; - - dumpAccuracyNorms(); - - - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - - // NOTE: Signal back to OpenTuner - signalPipeToOpenTuner(); - } - - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet50_imagenet_promise.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet50_imagenet_promise.cc deleted file mode 100644 index 8355c78cb5..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/resnet50_imagenet_promise.cc +++ /dev/null @@ -1,874 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int main(){ - - llvm_hpvm_initTensorRt(1); - - int total_runs = 1; - for (int i = 0 ; i < total_runs; i++){ - - startMemTracking(); - - int test_input_size = 2000; - int batch_size = 100; - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - for(int i = 0; i < batch_count; i++){ - - std::string dir_prefix = std::string("/shared/hsharif3/resnet50_imagenet/"); - std::string input_path = dir_prefix + std::string("test_input.bin"); - std::string labels_path = dir_prefix + std::string("test_labels.bin"); - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,7,7); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_1_gamma_path = dir_prefix + std::string("batch_normalization_1_gamma.bin"); - void* batch_normalization_1_gamma = readTrainedWeights(batch_normalization_1_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_1_beta_path = dir_prefix + std::string("batch_normalization_1_beta.bin"); - void* batch_normalization_1_beta = readTrainedWeights(batch_normalization_1_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_1_mean_path = dir_prefix + std::string("batch_normalization_1_mean.bin"); - void* batch_normalization_1_mean = readTrainedWeights(batch_normalization_1_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_1_variance_path = dir_prefix + std::string("batch_normalization_1_variance.bin"); - void* batch_normalization_1_variance = readTrainedWeights(batch_normalization_1_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,64,1,1); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_2_gamma_path = dir_prefix + std::string("batch_normalization_2_gamma.bin"); - void* batch_normalization_2_gamma = readTrainedWeights(batch_normalization_2_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_2_beta_path = dir_prefix + std::string("batch_normalization_2_beta.bin"); - void* batch_normalization_2_beta = readTrainedWeights(batch_normalization_2_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_2_mean_path = dir_prefix + std::string("batch_normalization_2_mean.bin"); - void* batch_normalization_2_mean = readTrainedWeights(batch_normalization_2_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_2_variance_path = dir_prefix + std::string("batch_normalization_2_variance.bin"); - void* batch_normalization_2_variance = readTrainedWeights(batch_normalization_2_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_gamma_path = dir_prefix + std::string("batch_normalization_3_gamma.bin"); - void* batch_normalization_3_gamma = readTrainedWeights(batch_normalization_3_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_beta_path = dir_prefix + std::string("batch_normalization_3_beta.bin"); - void* batch_normalization_3_beta = readTrainedWeights(batch_normalization_3_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_mean_path = dir_prefix + std::string("batch_normalization_3_mean.bin"); - void* batch_normalization_3_mean = readTrainedWeights(batch_normalization_3_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_3_variance_path = dir_prefix + std::string("batch_normalization_3_variance.bin"); - void* batch_normalization_3_variance = readTrainedWeights(batch_normalization_3_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,256,64,1,1); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,64,1,1); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_4_gamma_path = dir_prefix + std::string("batch_normalization_4_gamma.bin"); - void* batch_normalization_4_gamma = readTrainedWeights(batch_normalization_4_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_4_beta_path = dir_prefix + std::string("batch_normalization_4_beta.bin"); - void* batch_normalization_4_beta = readTrainedWeights(batch_normalization_4_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_4_mean_path = dir_prefix + std::string("batch_normalization_4_mean.bin"); - void* batch_normalization_4_mean = readTrainedWeights(batch_normalization_4_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_4_variance_path = dir_prefix + std::string("batch_normalization_4_variance.bin"); - void* batch_normalization_4_variance = readTrainedWeights(batch_normalization_4_variance_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_5_gamma_path = dir_prefix + std::string("batch_normalization_5_gamma.bin"); - void* batch_normalization_5_gamma = readTrainedWeights(batch_normalization_5_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_5_beta_path = dir_prefix + std::string("batch_normalization_5_beta.bin"); - void* batch_normalization_5_beta = readTrainedWeights(batch_normalization_5_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_5_mean_path = dir_prefix + std::string("batch_normalization_5_mean.bin"); - void* batch_normalization_5_mean = readTrainedWeights(batch_normalization_5_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_5_variance_path = dir_prefix + std::string("batch_normalization_5_variance.bin"); - void* batch_normalization_5_variance = readTrainedWeights(batch_normalization_5_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,64,256,1,1); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_6_gamma_path = dir_prefix + std::string("batch_normalization_6_gamma.bin"); - void* batch_normalization_6_gamma = readTrainedWeights(batch_normalization_6_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_6_beta_path = dir_prefix + std::string("batch_normalization_6_beta.bin"); - void* batch_normalization_6_beta = readTrainedWeights(batch_normalization_6_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_6_mean_path = dir_prefix + std::string("batch_normalization_6_mean.bin"); - void* batch_normalization_6_mean = readTrainedWeights(batch_normalization_6_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_6_variance_path = dir_prefix + std::string("batch_normalization_6_variance.bin"); - void* batch_normalization_6_variance = readTrainedWeights(batch_normalization_6_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_7_b_path = dir_prefix + std::string("conv2d_7_b.bin"); - void* conv2d_7_b = readTrainedWeights(conv2d_7_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_7_gamma_path = dir_prefix + std::string("batch_normalization_7_gamma.bin"); - void* batch_normalization_7_gamma = readTrainedWeights(batch_normalization_7_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_7_beta_path = dir_prefix + std::string("batch_normalization_7_beta.bin"); - void* batch_normalization_7_beta = readTrainedWeights(batch_normalization_7_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_7_mean_path = dir_prefix + std::string("batch_normalization_7_mean.bin"); - void* batch_normalization_7_mean = readTrainedWeights(batch_normalization_7_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_7_variance_path = dir_prefix + std::string("batch_normalization_7_variance.bin"); - void* batch_normalization_7_variance = readTrainedWeights(batch_normalization_7_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,256,64,1,1); - std::string conv2d_8_b_path = dir_prefix + std::string("conv2d_8_b.bin"); - void* conv2d_8_b = readTrainedWeights(conv2d_8_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_8_gamma_path = dir_prefix + std::string("batch_normalization_8_gamma.bin"); - void* batch_normalization_8_gamma = readTrainedWeights(batch_normalization_8_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_8_beta_path = dir_prefix + std::string("batch_normalization_8_beta.bin"); - void* batch_normalization_8_beta = readTrainedWeights(batch_normalization_8_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_8_mean_path = dir_prefix + std::string("batch_normalization_8_mean.bin"); - void* batch_normalization_8_mean = readTrainedWeights(batch_normalization_8_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_8_variance_path = dir_prefix + std::string("batch_normalization_8_variance.bin"); - void* batch_normalization_8_variance = readTrainedWeights(batch_normalization_8_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,64,256,1,1); - std::string conv2d_9_b_path = dir_prefix + std::string("conv2d_9_b.bin"); - void* conv2d_9_b = readTrainedWeights(conv2d_9_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_9_gamma_path = dir_prefix + std::string("batch_normalization_9_gamma.bin"); - void* batch_normalization_9_gamma = readTrainedWeights(batch_normalization_9_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_9_beta_path = dir_prefix + std::string("batch_normalization_9_beta.bin"); - void* batch_normalization_9_beta = readTrainedWeights(batch_normalization_9_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_9_mean_path = dir_prefix + std::string("batch_normalization_9_mean.bin"); - void* batch_normalization_9_mean = readTrainedWeights(batch_normalization_9_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_9_variance_path = dir_prefix + std::string("batch_normalization_9_variance.bin"); - void* batch_normalization_9_variance = readTrainedWeights(batch_normalization_9_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_10_b_path = dir_prefix + std::string("conv2d_10_b.bin"); - void* conv2d_10_b = readTrainedWeights(conv2d_10_b_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_10_gamma_path = dir_prefix + std::string("batch_normalization_10_gamma.bin"); - void* batch_normalization_10_gamma = readTrainedWeights(batch_normalization_10_gamma_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_10_beta_path = dir_prefix + std::string("batch_normalization_10_beta.bin"); - void* batch_normalization_10_beta = readTrainedWeights(batch_normalization_10_beta_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_10_mean_path = dir_prefix + std::string("batch_normalization_10_mean.bin"); - void* batch_normalization_10_mean = readTrainedWeights(batch_normalization_10_mean_path.c_str(), 0,1,64,1,1); - std::string batch_normalization_10_variance_path = dir_prefix + std::string("batch_normalization_10_variance.bin"); - void* batch_normalization_10_variance = readTrainedWeights(batch_normalization_10_variance_path.c_str(), 0,1,64,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,256,64,1,1); - std::string conv2d_11_b_path = dir_prefix + std::string("conv2d_11_b.bin"); - void* conv2d_11_b = readTrainedWeights(conv2d_11_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_gamma_path = dir_prefix + std::string("batch_normalization_11_gamma.bin"); - void* batch_normalization_11_gamma = readTrainedWeights(batch_normalization_11_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_beta_path = dir_prefix + std::string("batch_normalization_11_beta.bin"); - void* batch_normalization_11_beta = readTrainedWeights(batch_normalization_11_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_mean_path = dir_prefix + std::string("batch_normalization_11_mean.bin"); - void* batch_normalization_11_mean = readTrainedWeights(batch_normalization_11_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_11_variance_path = dir_prefix + std::string("batch_normalization_11_variance.bin"); - void* batch_normalization_11_variance = readTrainedWeights(batch_normalization_11_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,128,256,1,1); - std::string conv2d_12_b_path = dir_prefix + std::string("conv2d_12_b.bin"); - void* conv2d_12_b = readTrainedWeights(conv2d_12_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_12_gamma_path = dir_prefix + std::string("batch_normalization_12_gamma.bin"); - void* batch_normalization_12_gamma = readTrainedWeights(batch_normalization_12_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_12_beta_path = dir_prefix + std::string("batch_normalization_12_beta.bin"); - void* batch_normalization_12_beta = readTrainedWeights(batch_normalization_12_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_12_mean_path = dir_prefix + std::string("batch_normalization_12_mean.bin"); - void* batch_normalization_12_mean = readTrainedWeights(batch_normalization_12_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_12_variance_path = dir_prefix + std::string("batch_normalization_12_variance.bin"); - void* batch_normalization_12_variance = readTrainedWeights(batch_normalization_12_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_13_b_path = dir_prefix + std::string("conv2d_13_b.bin"); - void* conv2d_13_b = readTrainedWeights(conv2d_13_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_13_gamma_path = dir_prefix + std::string("batch_normalization_13_gamma.bin"); - void* batch_normalization_13_gamma = readTrainedWeights(batch_normalization_13_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_13_beta_path = dir_prefix + std::string("batch_normalization_13_beta.bin"); - void* batch_normalization_13_beta = readTrainedWeights(batch_normalization_13_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_13_mean_path = dir_prefix + std::string("batch_normalization_13_mean.bin"); - void* batch_normalization_13_mean = readTrainedWeights(batch_normalization_13_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_13_variance_path = dir_prefix + std::string("batch_normalization_13_variance.bin"); - void* batch_normalization_13_variance = readTrainedWeights(batch_normalization_13_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_14_w_path = dir_prefix + std::string("conv2d_14_w.bin"); - void* conv2d_14_w = readTrainedWeights(conv2d_14_w_path.c_str(), 0,512,128,1,1); - std::string conv2d_14_b_path = dir_prefix + std::string("conv2d_14_b.bin"); - void* conv2d_14_b = readTrainedWeights(conv2d_14_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_15_w_path = dir_prefix + std::string("conv2d_15_w.bin"); - void* conv2d_15_w = readTrainedWeights(conv2d_15_w_path.c_str(), 0,512,256,1,1); - std::string conv2d_15_b_path = dir_prefix + std::string("conv2d_15_b.bin"); - void* conv2d_15_b = readTrainedWeights(conv2d_15_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_gamma_path = dir_prefix + std::string("batch_normalization_14_gamma.bin"); - void* batch_normalization_14_gamma = readTrainedWeights(batch_normalization_14_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_beta_path = dir_prefix + std::string("batch_normalization_14_beta.bin"); - void* batch_normalization_14_beta = readTrainedWeights(batch_normalization_14_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_mean_path = dir_prefix + std::string("batch_normalization_14_mean.bin"); - void* batch_normalization_14_mean = readTrainedWeights(batch_normalization_14_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_14_variance_path = dir_prefix + std::string("batch_normalization_14_variance.bin"); - void* batch_normalization_14_variance = readTrainedWeights(batch_normalization_14_variance_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_gamma_path = dir_prefix + std::string("batch_normalization_15_gamma.bin"); - void* batch_normalization_15_gamma = readTrainedWeights(batch_normalization_15_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_beta_path = dir_prefix + std::string("batch_normalization_15_beta.bin"); - void* batch_normalization_15_beta = readTrainedWeights(batch_normalization_15_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_mean_path = dir_prefix + std::string("batch_normalization_15_mean.bin"); - void* batch_normalization_15_mean = readTrainedWeights(batch_normalization_15_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_15_variance_path = dir_prefix + std::string("batch_normalization_15_variance.bin"); - void* batch_normalization_15_variance = readTrainedWeights(batch_normalization_15_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_16_w_path = dir_prefix + std::string("conv2d_16_w.bin"); - void* conv2d_16_w = readTrainedWeights(conv2d_16_w_path.c_str(), 0,128,512,1,1); - std::string conv2d_16_b_path = dir_prefix + std::string("conv2d_16_b.bin"); - void* conv2d_16_b = readTrainedWeights(conv2d_16_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_16_gamma_path = dir_prefix + std::string("batch_normalization_16_gamma.bin"); - void* batch_normalization_16_gamma = readTrainedWeights(batch_normalization_16_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_16_beta_path = dir_prefix + std::string("batch_normalization_16_beta.bin"); - void* batch_normalization_16_beta = readTrainedWeights(batch_normalization_16_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_16_mean_path = dir_prefix + std::string("batch_normalization_16_mean.bin"); - void* batch_normalization_16_mean = readTrainedWeights(batch_normalization_16_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_16_variance_path = dir_prefix + std::string("batch_normalization_16_variance.bin"); - void* batch_normalization_16_variance = readTrainedWeights(batch_normalization_16_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_17_w_path = dir_prefix + std::string("conv2d_17_w.bin"); - void* conv2d_17_w = readTrainedWeights(conv2d_17_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_17_b_path = dir_prefix + std::string("conv2d_17_b.bin"); - void* conv2d_17_b = readTrainedWeights(conv2d_17_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_17_gamma_path = dir_prefix + std::string("batch_normalization_17_gamma.bin"); - void* batch_normalization_17_gamma = readTrainedWeights(batch_normalization_17_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_17_beta_path = dir_prefix + std::string("batch_normalization_17_beta.bin"); - void* batch_normalization_17_beta = readTrainedWeights(batch_normalization_17_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_17_mean_path = dir_prefix + std::string("batch_normalization_17_mean.bin"); - void* batch_normalization_17_mean = readTrainedWeights(batch_normalization_17_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_17_variance_path = dir_prefix + std::string("batch_normalization_17_variance.bin"); - void* batch_normalization_17_variance = readTrainedWeights(batch_normalization_17_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_18_w_path = dir_prefix + std::string("conv2d_18_w.bin"); - void* conv2d_18_w = readTrainedWeights(conv2d_18_w_path.c_str(), 0,512,128,1,1); - std::string conv2d_18_b_path = dir_prefix + std::string("conv2d_18_b.bin"); - void* conv2d_18_b = readTrainedWeights(conv2d_18_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_gamma_path = dir_prefix + std::string("batch_normalization_18_gamma.bin"); - void* batch_normalization_18_gamma = readTrainedWeights(batch_normalization_18_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_beta_path = dir_prefix + std::string("batch_normalization_18_beta.bin"); - void* batch_normalization_18_beta = readTrainedWeights(batch_normalization_18_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_mean_path = dir_prefix + std::string("batch_normalization_18_mean.bin"); - void* batch_normalization_18_mean = readTrainedWeights(batch_normalization_18_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_18_variance_path = dir_prefix + std::string("batch_normalization_18_variance.bin"); - void* batch_normalization_18_variance = readTrainedWeights(batch_normalization_18_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_19_w_path = dir_prefix + std::string("conv2d_19_w.bin"); - void* conv2d_19_w = readTrainedWeights(conv2d_19_w_path.c_str(), 0,128,512,1,1); - std::string conv2d_19_b_path = dir_prefix + std::string("conv2d_19_b.bin"); - void* conv2d_19_b = readTrainedWeights(conv2d_19_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_19_gamma_path = dir_prefix + std::string("batch_normalization_19_gamma.bin"); - void* batch_normalization_19_gamma = readTrainedWeights(batch_normalization_19_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_19_beta_path = dir_prefix + std::string("batch_normalization_19_beta.bin"); - void* batch_normalization_19_beta = readTrainedWeights(batch_normalization_19_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_19_mean_path = dir_prefix + std::string("batch_normalization_19_mean.bin"); - void* batch_normalization_19_mean = readTrainedWeights(batch_normalization_19_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_19_variance_path = dir_prefix + std::string("batch_normalization_19_variance.bin"); - void* batch_normalization_19_variance = readTrainedWeights(batch_normalization_19_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_20_w_path = dir_prefix + std::string("conv2d_20_w.bin"); - void* conv2d_20_w = readTrainedWeights(conv2d_20_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_20_b_path = dir_prefix + std::string("conv2d_20_b.bin"); - void* conv2d_20_b = readTrainedWeights(conv2d_20_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_20_gamma_path = dir_prefix + std::string("batch_normalization_20_gamma.bin"); - void* batch_normalization_20_gamma = readTrainedWeights(batch_normalization_20_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_20_beta_path = dir_prefix + std::string("batch_normalization_20_beta.bin"); - void* batch_normalization_20_beta = readTrainedWeights(batch_normalization_20_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_20_mean_path = dir_prefix + std::string("batch_normalization_20_mean.bin"); - void* batch_normalization_20_mean = readTrainedWeights(batch_normalization_20_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_20_variance_path = dir_prefix + std::string("batch_normalization_20_variance.bin"); - void* batch_normalization_20_variance = readTrainedWeights(batch_normalization_20_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_21_w_path = dir_prefix + std::string("conv2d_21_w.bin"); - void* conv2d_21_w = readTrainedWeights(conv2d_21_w_path.c_str(), 0,512,128,1,1); - std::string conv2d_21_b_path = dir_prefix + std::string("conv2d_21_b.bin"); - void* conv2d_21_b = readTrainedWeights(conv2d_21_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_gamma_path = dir_prefix + std::string("batch_normalization_21_gamma.bin"); - void* batch_normalization_21_gamma = readTrainedWeights(batch_normalization_21_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_beta_path = dir_prefix + std::string("batch_normalization_21_beta.bin"); - void* batch_normalization_21_beta = readTrainedWeights(batch_normalization_21_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_mean_path = dir_prefix + std::string("batch_normalization_21_mean.bin"); - void* batch_normalization_21_mean = readTrainedWeights(batch_normalization_21_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_21_variance_path = dir_prefix + std::string("batch_normalization_21_variance.bin"); - void* batch_normalization_21_variance = readTrainedWeights(batch_normalization_21_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_22_w_path = dir_prefix + std::string("conv2d_22_w.bin"); - void* conv2d_22_w = readTrainedWeights(conv2d_22_w_path.c_str(), 0,128,512,1,1); - std::string conv2d_22_b_path = dir_prefix + std::string("conv2d_22_b.bin"); - void* conv2d_22_b = readTrainedWeights(conv2d_22_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_22_gamma_path = dir_prefix + std::string("batch_normalization_22_gamma.bin"); - void* batch_normalization_22_gamma = readTrainedWeights(batch_normalization_22_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_22_beta_path = dir_prefix + std::string("batch_normalization_22_beta.bin"); - void* batch_normalization_22_beta = readTrainedWeights(batch_normalization_22_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_22_mean_path = dir_prefix + std::string("batch_normalization_22_mean.bin"); - void* batch_normalization_22_mean = readTrainedWeights(batch_normalization_22_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_22_variance_path = dir_prefix + std::string("batch_normalization_22_variance.bin"); - void* batch_normalization_22_variance = readTrainedWeights(batch_normalization_22_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_23_w_path = dir_prefix + std::string("conv2d_23_w.bin"); - void* conv2d_23_w = readTrainedWeights(conv2d_23_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_23_b_path = dir_prefix + std::string("conv2d_23_b.bin"); - void* conv2d_23_b = readTrainedWeights(conv2d_23_b_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_23_gamma_path = dir_prefix + std::string("batch_normalization_23_gamma.bin"); - void* batch_normalization_23_gamma = readTrainedWeights(batch_normalization_23_gamma_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_23_beta_path = dir_prefix + std::string("batch_normalization_23_beta.bin"); - void* batch_normalization_23_beta = readTrainedWeights(batch_normalization_23_beta_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_23_mean_path = dir_prefix + std::string("batch_normalization_23_mean.bin"); - void* batch_normalization_23_mean = readTrainedWeights(batch_normalization_23_mean_path.c_str(), 0,1,128,1,1); - std::string batch_normalization_23_variance_path = dir_prefix + std::string("batch_normalization_23_variance.bin"); - void* batch_normalization_23_variance = readTrainedWeights(batch_normalization_23_variance_path.c_str(), 0,1,128,1,1); - std::string conv2d_24_w_path = dir_prefix + std::string("conv2d_24_w.bin"); - void* conv2d_24_w = readTrainedWeights(conv2d_24_w_path.c_str(), 0,512,128,1,1); - std::string conv2d_24_b_path = dir_prefix + std::string("conv2d_24_b.bin"); - void* conv2d_24_b = readTrainedWeights(conv2d_24_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_gamma_path = dir_prefix + std::string("batch_normalization_24_gamma.bin"); - void* batch_normalization_24_gamma = readTrainedWeights(batch_normalization_24_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_beta_path = dir_prefix + std::string("batch_normalization_24_beta.bin"); - void* batch_normalization_24_beta = readTrainedWeights(batch_normalization_24_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_mean_path = dir_prefix + std::string("batch_normalization_24_mean.bin"); - void* batch_normalization_24_mean = readTrainedWeights(batch_normalization_24_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_24_variance_path = dir_prefix + std::string("batch_normalization_24_variance.bin"); - void* batch_normalization_24_variance = readTrainedWeights(batch_normalization_24_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_25_w_path = dir_prefix + std::string("conv2d_25_w.bin"); - void* conv2d_25_w = readTrainedWeights(conv2d_25_w_path.c_str(), 0,256,512,1,1); - std::string conv2d_25_b_path = dir_prefix + std::string("conv2d_25_b.bin"); - void* conv2d_25_b = readTrainedWeights(conv2d_25_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_25_gamma_path = dir_prefix + std::string("batch_normalization_25_gamma.bin"); - void* batch_normalization_25_gamma = readTrainedWeights(batch_normalization_25_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_25_beta_path = dir_prefix + std::string("batch_normalization_25_beta.bin"); - void* batch_normalization_25_beta = readTrainedWeights(batch_normalization_25_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_25_mean_path = dir_prefix + std::string("batch_normalization_25_mean.bin"); - void* batch_normalization_25_mean = readTrainedWeights(batch_normalization_25_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_25_variance_path = dir_prefix + std::string("batch_normalization_25_variance.bin"); - void* batch_normalization_25_variance = readTrainedWeights(batch_normalization_25_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_26_w_path = dir_prefix + std::string("conv2d_26_w.bin"); - void* conv2d_26_w = readTrainedWeights(conv2d_26_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_26_b_path = dir_prefix + std::string("conv2d_26_b.bin"); - void* conv2d_26_b = readTrainedWeights(conv2d_26_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_26_gamma_path = dir_prefix + std::string("batch_normalization_26_gamma.bin"); - void* batch_normalization_26_gamma = readTrainedWeights(batch_normalization_26_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_26_beta_path = dir_prefix + std::string("batch_normalization_26_beta.bin"); - void* batch_normalization_26_beta = readTrainedWeights(batch_normalization_26_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_26_mean_path = dir_prefix + std::string("batch_normalization_26_mean.bin"); - void* batch_normalization_26_mean = readTrainedWeights(batch_normalization_26_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_26_variance_path = dir_prefix + std::string("batch_normalization_26_variance.bin"); - void* batch_normalization_26_variance = readTrainedWeights(batch_normalization_26_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_27_w_path = dir_prefix + std::string("conv2d_27_w.bin"); - void* conv2d_27_w = readTrainedWeights(conv2d_27_w_path.c_str(), 0,1024,256,1,1); - std::string conv2d_27_b_path = dir_prefix + std::string("conv2d_27_b.bin"); - void* conv2d_27_b = readTrainedWeights(conv2d_27_b_path.c_str(), 0,1,1024,1,1); - std::string conv2d_28_w_path = dir_prefix + std::string("conv2d_28_w.bin"); - void* conv2d_28_w = readTrainedWeights(conv2d_28_w_path.c_str(), 0,1024,512,1,1); - std::string conv2d_28_b_path = dir_prefix + std::string("conv2d_28_b.bin"); - void* conv2d_28_b = readTrainedWeights(conv2d_28_b_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_gamma_path = dir_prefix + std::string("batch_normalization_27_gamma.bin"); - void* batch_normalization_27_gamma = readTrainedWeights(batch_normalization_27_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_beta_path = dir_prefix + std::string("batch_normalization_27_beta.bin"); - void* batch_normalization_27_beta = readTrainedWeights(batch_normalization_27_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_mean_path = dir_prefix + std::string("batch_normalization_27_mean.bin"); - void* batch_normalization_27_mean = readTrainedWeights(batch_normalization_27_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_27_variance_path = dir_prefix + std::string("batch_normalization_27_variance.bin"); - void* batch_normalization_27_variance = readTrainedWeights(batch_normalization_27_variance_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_28_gamma_path = dir_prefix + std::string("batch_normalization_28_gamma.bin"); - void* batch_normalization_28_gamma = readTrainedWeights(batch_normalization_28_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_28_beta_path = dir_prefix + std::string("batch_normalization_28_beta.bin"); - void* batch_normalization_28_beta = readTrainedWeights(batch_normalization_28_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_28_mean_path = dir_prefix + std::string("batch_normalization_28_mean.bin"); - void* batch_normalization_28_mean = readTrainedWeights(batch_normalization_28_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_28_variance_path = dir_prefix + std::string("batch_normalization_28_variance.bin"); - void* batch_normalization_28_variance = readTrainedWeights(batch_normalization_28_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_29_w_path = dir_prefix + std::string("conv2d_29_w.bin"); - void* conv2d_29_w = readTrainedWeights(conv2d_29_w_path.c_str(), 0,256,1024,1,1); - std::string conv2d_29_b_path = dir_prefix + std::string("conv2d_29_b.bin"); - void* conv2d_29_b = readTrainedWeights(conv2d_29_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_29_gamma_path = dir_prefix + std::string("batch_normalization_29_gamma.bin"); - void* batch_normalization_29_gamma = readTrainedWeights(batch_normalization_29_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_29_beta_path = dir_prefix + std::string("batch_normalization_29_beta.bin"); - void* batch_normalization_29_beta = readTrainedWeights(batch_normalization_29_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_29_mean_path = dir_prefix + std::string("batch_normalization_29_mean.bin"); - void* batch_normalization_29_mean = readTrainedWeights(batch_normalization_29_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_29_variance_path = dir_prefix + std::string("batch_normalization_29_variance.bin"); - void* batch_normalization_29_variance = readTrainedWeights(batch_normalization_29_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_30_w_path = dir_prefix + std::string("conv2d_30_w.bin"); - void* conv2d_30_w = readTrainedWeights(conv2d_30_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_30_b_path = dir_prefix + std::string("conv2d_30_b.bin"); - void* conv2d_30_b = readTrainedWeights(conv2d_30_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_30_gamma_path = dir_prefix + std::string("batch_normalization_30_gamma.bin"); - void* batch_normalization_30_gamma = readTrainedWeights(batch_normalization_30_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_30_beta_path = dir_prefix + std::string("batch_normalization_30_beta.bin"); - void* batch_normalization_30_beta = readTrainedWeights(batch_normalization_30_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_30_mean_path = dir_prefix + std::string("batch_normalization_30_mean.bin"); - void* batch_normalization_30_mean = readTrainedWeights(batch_normalization_30_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_30_variance_path = dir_prefix + std::string("batch_normalization_30_variance.bin"); - void* batch_normalization_30_variance = readTrainedWeights(batch_normalization_30_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_31_w_path = dir_prefix + std::string("conv2d_31_w.bin"); - void* conv2d_31_w = readTrainedWeights(conv2d_31_w_path.c_str(), 0,1024,256,1,1); - std::string conv2d_31_b_path = dir_prefix + std::string("conv2d_31_b.bin"); - void* conv2d_31_b = readTrainedWeights(conv2d_31_b_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_31_gamma_path = dir_prefix + std::string("batch_normalization_31_gamma.bin"); - void* batch_normalization_31_gamma = readTrainedWeights(batch_normalization_31_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_31_beta_path = dir_prefix + std::string("batch_normalization_31_beta.bin"); - void* batch_normalization_31_beta = readTrainedWeights(batch_normalization_31_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_31_mean_path = dir_prefix + std::string("batch_normalization_31_mean.bin"); - void* batch_normalization_31_mean = readTrainedWeights(batch_normalization_31_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_31_variance_path = dir_prefix + std::string("batch_normalization_31_variance.bin"); - void* batch_normalization_31_variance = readTrainedWeights(batch_normalization_31_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_32_w_path = dir_prefix + std::string("conv2d_32_w.bin"); - void* conv2d_32_w = readTrainedWeights(conv2d_32_w_path.c_str(), 0,256,1024,1,1); - std::string conv2d_32_b_path = dir_prefix + std::string("conv2d_32_b.bin"); - void* conv2d_32_b = readTrainedWeights(conv2d_32_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_32_gamma_path = dir_prefix + std::string("batch_normalization_32_gamma.bin"); - void* batch_normalization_32_gamma = readTrainedWeights(batch_normalization_32_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_32_beta_path = dir_prefix + std::string("batch_normalization_32_beta.bin"); - void* batch_normalization_32_beta = readTrainedWeights(batch_normalization_32_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_32_mean_path = dir_prefix + std::string("batch_normalization_32_mean.bin"); - void* batch_normalization_32_mean = readTrainedWeights(batch_normalization_32_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_32_variance_path = dir_prefix + std::string("batch_normalization_32_variance.bin"); - void* batch_normalization_32_variance = readTrainedWeights(batch_normalization_32_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_33_w_path = dir_prefix + std::string("conv2d_33_w.bin"); - void* conv2d_33_w = readTrainedWeights(conv2d_33_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_33_b_path = dir_prefix + std::string("conv2d_33_b.bin"); - void* conv2d_33_b = readTrainedWeights(conv2d_33_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_33_gamma_path = dir_prefix + std::string("batch_normalization_33_gamma.bin"); - void* batch_normalization_33_gamma = readTrainedWeights(batch_normalization_33_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_33_beta_path = dir_prefix + std::string("batch_normalization_33_beta.bin"); - void* batch_normalization_33_beta = readTrainedWeights(batch_normalization_33_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_33_mean_path = dir_prefix + std::string("batch_normalization_33_mean.bin"); - void* batch_normalization_33_mean = readTrainedWeights(batch_normalization_33_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_33_variance_path = dir_prefix + std::string("batch_normalization_33_variance.bin"); - void* batch_normalization_33_variance = readTrainedWeights(batch_normalization_33_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_34_w_path = dir_prefix + std::string("conv2d_34_w.bin"); - void* conv2d_34_w = readTrainedWeights(conv2d_34_w_path.c_str(), 0,1024,256,1,1); - std::string conv2d_34_b_path = dir_prefix + std::string("conv2d_34_b.bin"); - void* conv2d_34_b = readTrainedWeights(conv2d_34_b_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_34_gamma_path = dir_prefix + std::string("batch_normalization_34_gamma.bin"); - void* batch_normalization_34_gamma = readTrainedWeights(batch_normalization_34_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_34_beta_path = dir_prefix + std::string("batch_normalization_34_beta.bin"); - void* batch_normalization_34_beta = readTrainedWeights(batch_normalization_34_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_34_mean_path = dir_prefix + std::string("batch_normalization_34_mean.bin"); - void* batch_normalization_34_mean = readTrainedWeights(batch_normalization_34_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_34_variance_path = dir_prefix + std::string("batch_normalization_34_variance.bin"); - void* batch_normalization_34_variance = readTrainedWeights(batch_normalization_34_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_35_w_path = dir_prefix + std::string("conv2d_35_w.bin"); - void* conv2d_35_w = readTrainedWeights(conv2d_35_w_path.c_str(), 0,256,1024,1,1); - std::string conv2d_35_b_path = dir_prefix + std::string("conv2d_35_b.bin"); - void* conv2d_35_b = readTrainedWeights(conv2d_35_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_35_gamma_path = dir_prefix + std::string("batch_normalization_35_gamma.bin"); - void* batch_normalization_35_gamma = readTrainedWeights(batch_normalization_35_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_35_beta_path = dir_prefix + std::string("batch_normalization_35_beta.bin"); - void* batch_normalization_35_beta = readTrainedWeights(batch_normalization_35_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_35_mean_path = dir_prefix + std::string("batch_normalization_35_mean.bin"); - void* batch_normalization_35_mean = readTrainedWeights(batch_normalization_35_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_35_variance_path = dir_prefix + std::string("batch_normalization_35_variance.bin"); - void* batch_normalization_35_variance = readTrainedWeights(batch_normalization_35_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_36_w_path = dir_prefix + std::string("conv2d_36_w.bin"); - void* conv2d_36_w = readTrainedWeights(conv2d_36_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_36_b_path = dir_prefix + std::string("conv2d_36_b.bin"); - void* conv2d_36_b = readTrainedWeights(conv2d_36_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_36_gamma_path = dir_prefix + std::string("batch_normalization_36_gamma.bin"); - void* batch_normalization_36_gamma = readTrainedWeights(batch_normalization_36_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_36_beta_path = dir_prefix + std::string("batch_normalization_36_beta.bin"); - void* batch_normalization_36_beta = readTrainedWeights(batch_normalization_36_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_36_mean_path = dir_prefix + std::string("batch_normalization_36_mean.bin"); - void* batch_normalization_36_mean = readTrainedWeights(batch_normalization_36_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_36_variance_path = dir_prefix + std::string("batch_normalization_36_variance.bin"); - void* batch_normalization_36_variance = readTrainedWeights(batch_normalization_36_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_37_w_path = dir_prefix + std::string("conv2d_37_w.bin"); - void* conv2d_37_w = readTrainedWeights(conv2d_37_w_path.c_str(), 0,1024,256,1,1); - std::string conv2d_37_b_path = dir_prefix + std::string("conv2d_37_b.bin"); - void* conv2d_37_b = readTrainedWeights(conv2d_37_b_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_37_gamma_path = dir_prefix + std::string("batch_normalization_37_gamma.bin"); - void* batch_normalization_37_gamma = readTrainedWeights(batch_normalization_37_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_37_beta_path = dir_prefix + std::string("batch_normalization_37_beta.bin"); - void* batch_normalization_37_beta = readTrainedWeights(batch_normalization_37_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_37_mean_path = dir_prefix + std::string("batch_normalization_37_mean.bin"); - void* batch_normalization_37_mean = readTrainedWeights(batch_normalization_37_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_37_variance_path = dir_prefix + std::string("batch_normalization_37_variance.bin"); - void* batch_normalization_37_variance = readTrainedWeights(batch_normalization_37_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_38_w_path = dir_prefix + std::string("conv2d_38_w.bin"); - void* conv2d_38_w = readTrainedWeights(conv2d_38_w_path.c_str(), 0,256,1024,1,1); - std::string conv2d_38_b_path = dir_prefix + std::string("conv2d_38_b.bin"); - void* conv2d_38_b = readTrainedWeights(conv2d_38_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_38_gamma_path = dir_prefix + std::string("batch_normalization_38_gamma.bin"); - void* batch_normalization_38_gamma = readTrainedWeights(batch_normalization_38_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_38_beta_path = dir_prefix + std::string("batch_normalization_38_beta.bin"); - void* batch_normalization_38_beta = readTrainedWeights(batch_normalization_38_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_38_mean_path = dir_prefix + std::string("batch_normalization_38_mean.bin"); - void* batch_normalization_38_mean = readTrainedWeights(batch_normalization_38_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_38_variance_path = dir_prefix + std::string("batch_normalization_38_variance.bin"); - void* batch_normalization_38_variance = readTrainedWeights(batch_normalization_38_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_39_w_path = dir_prefix + std::string("conv2d_39_w.bin"); - void* conv2d_39_w = readTrainedWeights(conv2d_39_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_39_b_path = dir_prefix + std::string("conv2d_39_b.bin"); - void* conv2d_39_b = readTrainedWeights(conv2d_39_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_39_gamma_path = dir_prefix + std::string("batch_normalization_39_gamma.bin"); - void* batch_normalization_39_gamma = readTrainedWeights(batch_normalization_39_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_39_beta_path = dir_prefix + std::string("batch_normalization_39_beta.bin"); - void* batch_normalization_39_beta = readTrainedWeights(batch_normalization_39_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_39_mean_path = dir_prefix + std::string("batch_normalization_39_mean.bin"); - void* batch_normalization_39_mean = readTrainedWeights(batch_normalization_39_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_39_variance_path = dir_prefix + std::string("batch_normalization_39_variance.bin"); - void* batch_normalization_39_variance = readTrainedWeights(batch_normalization_39_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_40_w_path = dir_prefix + std::string("conv2d_40_w.bin"); - void* conv2d_40_w = readTrainedWeights(conv2d_40_w_path.c_str(), 0,1024,256,1,1); - std::string conv2d_40_b_path = dir_prefix + std::string("conv2d_40_b.bin"); - void* conv2d_40_b = readTrainedWeights(conv2d_40_b_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_40_gamma_path = dir_prefix + std::string("batch_normalization_40_gamma.bin"); - void* batch_normalization_40_gamma = readTrainedWeights(batch_normalization_40_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_40_beta_path = dir_prefix + std::string("batch_normalization_40_beta.bin"); - void* batch_normalization_40_beta = readTrainedWeights(batch_normalization_40_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_40_mean_path = dir_prefix + std::string("batch_normalization_40_mean.bin"); - void* batch_normalization_40_mean = readTrainedWeights(batch_normalization_40_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_40_variance_path = dir_prefix + std::string("batch_normalization_40_variance.bin"); - void* batch_normalization_40_variance = readTrainedWeights(batch_normalization_40_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_41_w_path = dir_prefix + std::string("conv2d_41_w.bin"); - void* conv2d_41_w = readTrainedWeights(conv2d_41_w_path.c_str(), 0,256,1024,1,1); - std::string conv2d_41_b_path = dir_prefix + std::string("conv2d_41_b.bin"); - void* conv2d_41_b = readTrainedWeights(conv2d_41_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_41_gamma_path = dir_prefix + std::string("batch_normalization_41_gamma.bin"); - void* batch_normalization_41_gamma = readTrainedWeights(batch_normalization_41_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_41_beta_path = dir_prefix + std::string("batch_normalization_41_beta.bin"); - void* batch_normalization_41_beta = readTrainedWeights(batch_normalization_41_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_41_mean_path = dir_prefix + std::string("batch_normalization_41_mean.bin"); - void* batch_normalization_41_mean = readTrainedWeights(batch_normalization_41_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_41_variance_path = dir_prefix + std::string("batch_normalization_41_variance.bin"); - void* batch_normalization_41_variance = readTrainedWeights(batch_normalization_41_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_42_w_path = dir_prefix + std::string("conv2d_42_w.bin"); - void* conv2d_42_w = readTrainedWeights(conv2d_42_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_42_b_path = dir_prefix + std::string("conv2d_42_b.bin"); - void* conv2d_42_b = readTrainedWeights(conv2d_42_b_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_42_gamma_path = dir_prefix + std::string("batch_normalization_42_gamma.bin"); - void* batch_normalization_42_gamma = readTrainedWeights(batch_normalization_42_gamma_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_42_beta_path = dir_prefix + std::string("batch_normalization_42_beta.bin"); - void* batch_normalization_42_beta = readTrainedWeights(batch_normalization_42_beta_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_42_mean_path = dir_prefix + std::string("batch_normalization_42_mean.bin"); - void* batch_normalization_42_mean = readTrainedWeights(batch_normalization_42_mean_path.c_str(), 0,1,256,1,1); - std::string batch_normalization_42_variance_path = dir_prefix + std::string("batch_normalization_42_variance.bin"); - void* batch_normalization_42_variance = readTrainedWeights(batch_normalization_42_variance_path.c_str(), 0,1,256,1,1); - std::string conv2d_43_w_path = dir_prefix + std::string("conv2d_43_w.bin"); - void* conv2d_43_w = readTrainedWeights(conv2d_43_w_path.c_str(), 0,1024,256,1,1); - std::string conv2d_43_b_path = dir_prefix + std::string("conv2d_43_b.bin"); - void* conv2d_43_b = readTrainedWeights(conv2d_43_b_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_43_gamma_path = dir_prefix + std::string("batch_normalization_43_gamma.bin"); - void* batch_normalization_43_gamma = readTrainedWeights(batch_normalization_43_gamma_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_43_beta_path = dir_prefix + std::string("batch_normalization_43_beta.bin"); - void* batch_normalization_43_beta = readTrainedWeights(batch_normalization_43_beta_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_43_mean_path = dir_prefix + std::string("batch_normalization_43_mean.bin"); - void* batch_normalization_43_mean = readTrainedWeights(batch_normalization_43_mean_path.c_str(), 0,1,1024,1,1); - std::string batch_normalization_43_variance_path = dir_prefix + std::string("batch_normalization_43_variance.bin"); - void* batch_normalization_43_variance = readTrainedWeights(batch_normalization_43_variance_path.c_str(), 0,1,1024,1,1); - std::string conv2d_44_w_path = dir_prefix + std::string("conv2d_44_w.bin"); - void* conv2d_44_w = readTrainedWeights(conv2d_44_w_path.c_str(), 0,512,1024,1,1); - std::string conv2d_44_b_path = dir_prefix + std::string("conv2d_44_b.bin"); - void* conv2d_44_b = readTrainedWeights(conv2d_44_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_44_gamma_path = dir_prefix + std::string("batch_normalization_44_gamma.bin"); - void* batch_normalization_44_gamma = readTrainedWeights(batch_normalization_44_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_44_beta_path = dir_prefix + std::string("batch_normalization_44_beta.bin"); - void* batch_normalization_44_beta = readTrainedWeights(batch_normalization_44_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_44_mean_path = dir_prefix + std::string("batch_normalization_44_mean.bin"); - void* batch_normalization_44_mean = readTrainedWeights(batch_normalization_44_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_44_variance_path = dir_prefix + std::string("batch_normalization_44_variance.bin"); - void* batch_normalization_44_variance = readTrainedWeights(batch_normalization_44_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_45_w_path = dir_prefix + std::string("conv2d_45_w.bin"); - void* conv2d_45_w = readTrainedWeights(conv2d_45_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_45_b_path = dir_prefix + std::string("conv2d_45_b.bin"); - void* conv2d_45_b = readTrainedWeights(conv2d_45_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_45_gamma_path = dir_prefix + std::string("batch_normalization_45_gamma.bin"); - void* batch_normalization_45_gamma = readTrainedWeights(batch_normalization_45_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_45_beta_path = dir_prefix + std::string("batch_normalization_45_beta.bin"); - void* batch_normalization_45_beta = readTrainedWeights(batch_normalization_45_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_45_mean_path = dir_prefix + std::string("batch_normalization_45_mean.bin"); - void* batch_normalization_45_mean = readTrainedWeights(batch_normalization_45_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_45_variance_path = dir_prefix + std::string("batch_normalization_45_variance.bin"); - void* batch_normalization_45_variance = readTrainedWeights(batch_normalization_45_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_46_w_path = dir_prefix + std::string("conv2d_46_w.bin"); - void* conv2d_46_w = readTrainedWeights(conv2d_46_w_path.c_str(), 0,2048,512,1,1); - std::string conv2d_46_b_path = dir_prefix + std::string("conv2d_46_b.bin"); - void* conv2d_46_b = readTrainedWeights(conv2d_46_b_path.c_str(), 0,1,2048,1,1); - std::string conv2d_47_w_path = dir_prefix + std::string("conv2d_47_w.bin"); - void* conv2d_47_w = readTrainedWeights(conv2d_47_w_path.c_str(), 0,2048,1024,1,1); - std::string conv2d_47_b_path = dir_prefix + std::string("conv2d_47_b.bin"); - void* conv2d_47_b = readTrainedWeights(conv2d_47_b_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_46_gamma_path = dir_prefix + std::string("batch_normalization_46_gamma.bin"); - void* batch_normalization_46_gamma = readTrainedWeights(batch_normalization_46_gamma_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_46_beta_path = dir_prefix + std::string("batch_normalization_46_beta.bin"); - void* batch_normalization_46_beta = readTrainedWeights(batch_normalization_46_beta_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_46_mean_path = dir_prefix + std::string("batch_normalization_46_mean.bin"); - void* batch_normalization_46_mean = readTrainedWeights(batch_normalization_46_mean_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_46_variance_path = dir_prefix + std::string("batch_normalization_46_variance.bin"); - void* batch_normalization_46_variance = readTrainedWeights(batch_normalization_46_variance_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_47_gamma_path = dir_prefix + std::string("batch_normalization_47_gamma.bin"); - void* batch_normalization_47_gamma = readTrainedWeights(batch_normalization_47_gamma_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_47_beta_path = dir_prefix + std::string("batch_normalization_47_beta.bin"); - void* batch_normalization_47_beta = readTrainedWeights(batch_normalization_47_beta_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_47_mean_path = dir_prefix + std::string("batch_normalization_47_mean.bin"); - void* batch_normalization_47_mean = readTrainedWeights(batch_normalization_47_mean_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_47_variance_path = dir_prefix + std::string("batch_normalization_47_variance.bin"); - void* batch_normalization_47_variance = readTrainedWeights(batch_normalization_47_variance_path.c_str(), 0,1,2048,1,1); - std::string conv2d_48_w_path = dir_prefix + std::string("conv2d_48_w.bin"); - void* conv2d_48_w = readTrainedWeights(conv2d_48_w_path.c_str(), 0,512,2048,1,1); - std::string conv2d_48_b_path = dir_prefix + std::string("conv2d_48_b.bin"); - void* conv2d_48_b = readTrainedWeights(conv2d_48_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_48_gamma_path = dir_prefix + std::string("batch_normalization_48_gamma.bin"); - void* batch_normalization_48_gamma = readTrainedWeights(batch_normalization_48_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_48_beta_path = dir_prefix + std::string("batch_normalization_48_beta.bin"); - void* batch_normalization_48_beta = readTrainedWeights(batch_normalization_48_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_48_mean_path = dir_prefix + std::string("batch_normalization_48_mean.bin"); - void* batch_normalization_48_mean = readTrainedWeights(batch_normalization_48_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_48_variance_path = dir_prefix + std::string("batch_normalization_48_variance.bin"); - void* batch_normalization_48_variance = readTrainedWeights(batch_normalization_48_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_49_w_path = dir_prefix + std::string("conv2d_49_w.bin"); - void* conv2d_49_w = readTrainedWeights(conv2d_49_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_49_b_path = dir_prefix + std::string("conv2d_49_b.bin"); - void* conv2d_49_b = readTrainedWeights(conv2d_49_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_49_gamma_path = dir_prefix + std::string("batch_normalization_49_gamma.bin"); - void* batch_normalization_49_gamma = readTrainedWeights(batch_normalization_49_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_49_beta_path = dir_prefix + std::string("batch_normalization_49_beta.bin"); - void* batch_normalization_49_beta = readTrainedWeights(batch_normalization_49_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_49_mean_path = dir_prefix + std::string("batch_normalization_49_mean.bin"); - void* batch_normalization_49_mean = readTrainedWeights(batch_normalization_49_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_49_variance_path = dir_prefix + std::string("batch_normalization_49_variance.bin"); - void* batch_normalization_49_variance = readTrainedWeights(batch_normalization_49_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_50_w_path = dir_prefix + std::string("conv2d_50_w.bin"); - void* conv2d_50_w = readTrainedWeights(conv2d_50_w_path.c_str(), 0,2048,512,1,1); - std::string conv2d_50_b_path = dir_prefix + std::string("conv2d_50_b.bin"); - void* conv2d_50_b = readTrainedWeights(conv2d_50_b_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_50_gamma_path = dir_prefix + std::string("batch_normalization_50_gamma.bin"); - void* batch_normalization_50_gamma = readTrainedWeights(batch_normalization_50_gamma_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_50_beta_path = dir_prefix + std::string("batch_normalization_50_beta.bin"); - void* batch_normalization_50_beta = readTrainedWeights(batch_normalization_50_beta_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_50_mean_path = dir_prefix + std::string("batch_normalization_50_mean.bin"); - void* batch_normalization_50_mean = readTrainedWeights(batch_normalization_50_mean_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_50_variance_path = dir_prefix + std::string("batch_normalization_50_variance.bin"); - void* batch_normalization_50_variance = readTrainedWeights(batch_normalization_50_variance_path.c_str(), 0,1,2048,1,1); - std::string conv2d_51_w_path = dir_prefix + std::string("conv2d_51_w.bin"); - void* conv2d_51_w = readTrainedWeights(conv2d_51_w_path.c_str(), 0,512,2048,1,1); - std::string conv2d_51_b_path = dir_prefix + std::string("conv2d_51_b.bin"); - void* conv2d_51_b = readTrainedWeights(conv2d_51_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_51_gamma_path = dir_prefix + std::string("batch_normalization_51_gamma.bin"); - void* batch_normalization_51_gamma = readTrainedWeights(batch_normalization_51_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_51_beta_path = dir_prefix + std::string("batch_normalization_51_beta.bin"); - void* batch_normalization_51_beta = readTrainedWeights(batch_normalization_51_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_51_mean_path = dir_prefix + std::string("batch_normalization_51_mean.bin"); - void* batch_normalization_51_mean = readTrainedWeights(batch_normalization_51_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_51_variance_path = dir_prefix + std::string("batch_normalization_51_variance.bin"); - void* batch_normalization_51_variance = readTrainedWeights(batch_normalization_51_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_52_w_path = dir_prefix + std::string("conv2d_52_w.bin"); - void* conv2d_52_w = readTrainedWeights(conv2d_52_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_52_b_path = dir_prefix + std::string("conv2d_52_b.bin"); - void* conv2d_52_b = readTrainedWeights(conv2d_52_b_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_52_gamma_path = dir_prefix + std::string("batch_normalization_52_gamma.bin"); - void* batch_normalization_52_gamma = readTrainedWeights(batch_normalization_52_gamma_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_52_beta_path = dir_prefix + std::string("batch_normalization_52_beta.bin"); - void* batch_normalization_52_beta = readTrainedWeights(batch_normalization_52_beta_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_52_mean_path = dir_prefix + std::string("batch_normalization_52_mean.bin"); - void* batch_normalization_52_mean = readTrainedWeights(batch_normalization_52_mean_path.c_str(), 0,1,512,1,1); - std::string batch_normalization_52_variance_path = dir_prefix + std::string("batch_normalization_52_variance.bin"); - void* batch_normalization_52_variance = readTrainedWeights(batch_normalization_52_variance_path.c_str(), 0,1,512,1,1); - std::string conv2d_53_w_path = dir_prefix + std::string("conv2d_53_w.bin"); - void* conv2d_53_w = readTrainedWeights(conv2d_53_w_path.c_str(), 0,2048,512,1,1); - std::string conv2d_53_b_path = dir_prefix + std::string("conv2d_53_b.bin"); - void* conv2d_53_b = readTrainedWeights(conv2d_53_b_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_53_gamma_path = dir_prefix + std::string("batch_normalization_53_gamma.bin"); - void* batch_normalization_53_gamma = readTrainedWeights(batch_normalization_53_gamma_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_53_beta_path = dir_prefix + std::string("batch_normalization_53_beta.bin"); - void* batch_normalization_53_beta = readTrainedWeights(batch_normalization_53_beta_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_53_mean_path = dir_prefix + std::string("batch_normalization_53_mean.bin"); - void* batch_normalization_53_mean = readTrainedWeights(batch_normalization_53_mean_path.c_str(), 0,1,2048,1,1); - std::string batch_normalization_53_variance_path = dir_prefix + std::string("batch_normalization_53_variance.bin"); - void* batch_normalization_53_variance = readTrainedWeights(batch_normalization_53_variance_path.c_str(), 0,1,2048,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,2048,1000); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,1000,1,1); - - - int start = i * batch_size; - int end = (i + 1) * batch_size; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,224,224); - - // NOTE: The pooling stride is 3*3 while it should be 2*2 -- interface itself needs fixing -- fix this manually in this case - void* var_0 = ConvLayer_PROMISE2(input, -123.68, 151.061, conv2d_1_w, -0.574422012090683, 0.5646807488203113, conv2d_1_b, -0.004829655, 0.014784645, 3, 3, 2, 2, 0, 3, 2, 1, 0.0, 689.7822875976562, 9); - void* var_1 = tensorBatchNorm(var_0, batch_normalization_1_gamma, batch_normalization_1_beta, batch_normalization_1_mean, batch_normalization_1_variance, 0.001); - void* var_2 = ConvLayer_PROMISE(var_1, -4.952117443084717, 12.02118032741582, conv2d_2_w, -0.5448235973715783, 0.2447893574833928, conv2d_2_b, -0.0001412337, 0.00017318528, 0, 0, 1, 1, -1, 0, -1, -9.212617980003357, 8.107657526016425, 9); - void* var_3 = tensorBatchNorm(var_2, batch_normalization_2_gamma, batch_normalization_2_beta, batch_normalization_2_mean, batch_normalization_2_variance, 0.001); - void* var_4 = tensorRelu(var_3); - void* var_5 = ConvLayer_PROMISE(var_4, 0.0, 5.801381123542811, conv2d_3_w, -0.18028786177933215, 0.21247629988193606, conv2d_3_b, -7.8663266e-05, 0.00018541634, 1, 1, 1, 1, -1, 0, -1, -6.834556140899658, 8.541351353645396, 9); - void* var_6 = tensorBatchNorm(var_5, batch_normalization_3_gamma, batch_normalization_3_beta, batch_normalization_3_mean, batch_normalization_3_variance, 0.001); - void* var_7 = tensorRelu(var_6); - void* var_8 = ConvLayer_PROMISE(var_7, 0.0, 9.866454153060971, conv2d_4_w, -0.2255178820490837, 0.2254851074665791, conv2d_4_b, -0.00017080337, 0.00021038808, 0, 0, 1, 1, -1, 0, -1, -3.595476400852203, 3.637018930196785, 9); - void* var_9 = tensorBatchNorm(var_8, batch_normalization_4_gamma, batch_normalization_4_beta, batch_normalization_4_mean, batch_normalization_4_variance, 0.001); - void* var_10 = ConvLayer_PROMISE(var_1, -4.952117443084717, 12.02118032741582, conv2d_5_w, -0.43272915667295453, 0.29589187785983095, conv2d_5_b, -0.000107640364, 0.00013177324, 0, 0, 1, 1, -1, 0, -1, -7.581318395137787, 7.8835730876923265, 9); - void* var_11 = tensorBatchNorm(var_10, batch_normalization_5_gamma, batch_normalization_5_beta, batch_normalization_5_mean, batch_normalization_5_variance, 0.001); - void* var_12 = tensorAdd(var_9, var_11); - void* var_13 = tensorRelu(var_12); - void* var_14 = ConvLayer_PROMISE(var_13, 0.0, 5.885549548625953, conv2d_6_w, -0.17062100511789324, 0.1432653286457067, conv2d_6_b, -7.950033e-05, 0.000104833845, 0, 0, 1, 1, -1, 0, -1, -5.310503073692322, 3.8418860490322224, 9); - void* var_15 = tensorBatchNorm(var_14, batch_normalization_6_gamma, batch_normalization_6_beta, batch_normalization_6_mean, batch_normalization_6_variance, 0.001); - void* var_16 = tensorRelu(var_15); - void* var_17 = ConvLayer_PROMISE(var_16, 0.0, 4.006655237674757, conv2d_7_w, -0.15594010630249977, 0.15720265829563249, conv2d_7_b, -6.419372e-05, 6.503685e-05, 1, 1, 1, 1, -1, 0, -1, -3.4114532544612883, 3.075598966121696, 9); - void* var_18 = tensorBatchNorm(var_17, batch_normalization_7_gamma, batch_normalization_7_beta, batch_normalization_7_mean, batch_normalization_7_variance, 0.001); - void* var_19 = tensorRelu(var_18); - void* var_20 = ConvLayer_PROMISE(var_19, 0.0, 4.186545849800112, conv2d_8_w, -0.1599232355505228, 0.17352246379853484, conv2d_8_b, -8.235522e-05, 0.000105946136, 0, 0, 1, 1, -1, 0, -1, -1.5299443051815034, 1.425760628223422, 9); - void* var_21 = tensorBatchNorm(var_20, batch_normalization_8_gamma, batch_normalization_8_beta, batch_normalization_8_mean, batch_normalization_8_variance, 0.001); - void* var_22 = tensorAdd(var_21, var_13); - void* var_23 = tensorRelu(var_22); - void* var_24 = ConvLayer_PROMISE(var_23, 0.0, 6.36634494018557, conv2d_9_w, -0.14470596650242806, 0.14421831880510708, conv2d_9_b, -3.4270335e-05, 4.177745e-05, 0, 0, 1, 1, -1, 0, -1, -4.584994326114654, 3.8648653411866007, 9); - void* var_25 = tensorBatchNorm(var_24, batch_normalization_9_gamma, batch_normalization_9_beta, batch_normalization_9_mean, batch_normalization_9_variance, 0.001); - void* var_26 = tensorRelu(var_25); - void* var_27 = ConvLayer_PROMISE(var_26, 0.0, 3.3001420612335437, conv2d_10_w, -0.12276832074671984, 0.12627632835507407, conv2d_10_b, -5.8183014e-05, 3.3546e-05, 1, 1, 1, 1, -1, 0, -1, -2.828902014493942, 3.0918669717311893, 9); - void* var_28 = tensorBatchNorm(var_27, batch_normalization_10_gamma, batch_normalization_10_beta, batch_normalization_10_mean, batch_normalization_10_variance, 0.001); - void* var_29 = tensorRelu(var_28); - void* var_30 = ConvLayer_PROMISE(var_29, 0.0, 5.313344509124818, conv2d_11_w, -0.1685639199912548, 0.16309838759899448, conv2d_11_b, -5.3248757e-05, 5.70645e-05, 0, 0, 1, 1, -1, 0, -1, -1.838510752558708, 1.3678752244711045, 9); - void* var_31 = tensorBatchNorm(var_30, batch_normalization_11_gamma, batch_normalization_11_beta, batch_normalization_11_mean, batch_normalization_11_variance, 0.001); - void* var_32 = tensorAdd(var_31, var_23); - void* var_33 = tensorRelu(var_32); - void* var_34 = ConvLayer_PROMISE(var_33, 0.0, 6.605899341106429, conv2d_12_w, -0.149728477448225, 0.13948052291572155, conv2d_12_b, -2.5221272e-05, 3.551765e-05, 0, 0, 2, 2, -1, 0, -1, -5.011460402488709, 3.915426737308551, 9); - void* var_35 = tensorBatchNorm(var_34, batch_normalization_12_gamma, batch_normalization_12_beta, batch_normalization_12_mean, batch_normalization_12_variance, 0.001); - void* var_36 = tensorRelu(var_35); - void* var_37 = ConvLayer_PROMISE(var_36, 0.0, 3.794741600990312, conv2d_13_w, -0.09761696971952916, 0.11394361693412249, conv2d_13_b, -3.715329e-05, 2.9298411e-05, 1, 1, 1, 1, -1, 0, -1, -5.206686987876893, 4.520638871669791, 9); - void* var_38 = tensorBatchNorm(var_37, batch_normalization_13_gamma, batch_normalization_13_beta, batch_normalization_13_mean, batch_normalization_13_variance, 0.001); - void* var_39 = tensorRelu(var_38); - void* var_40 = ConvLayer_PROMISE(var_39, 0.0, 3.7149479997158603, conv2d_14_w, -0.14844063371419908, 0.14925702929496953, conv2d_14_b, -6.0864673e-05, 5.4444306e-05, 0, 0, 1, 1, -1, 0, -1, -1.5011818276643754, 1.40834725618366, 9); - void* var_41 = tensorBatchNorm(var_40, batch_normalization_14_gamma, batch_normalization_14_beta, batch_normalization_14_mean, batch_normalization_14_variance, 0.001); - void* var_42 = ConvLayer_PROMISE(var_33, 0.0, 6.605899341106429, conv2d_15_w, -0.1642171936035156, 0.16866817833483497, conv2d_15_b, -2.4068044e-05, 2.5504653e-05, 0, 0, 2, 2, -1, 0, -1, -4.410076716423035, 4.014970501422923, 9); - void* var_43 = tensorBatchNorm(var_42, batch_normalization_15_gamma, batch_normalization_15_beta, batch_normalization_15_mean, batch_normalization_15_variance, 0.001); - void* var_44 = tensorAdd(var_41, var_43); - void* var_45 = tensorRelu(var_44); - void* var_46 = ConvLayer_PROMISE(var_45, 0.0, 6.518892978191488, conv2d_16_w, -0.09702376063913107, 0.1054209597408773, conv2d_16_b, -1.47610735e-05, 1.7075112e-05, 0, 0, 1, 1, -1, 0, -1, -4.87446900844574, 3.7661991298198862, 9); - void* var_47 = tensorBatchNorm(var_46, batch_normalization_16_gamma, batch_normalization_16_beta, batch_normalization_16_mean, batch_normalization_16_variance, 0.001); - void* var_48 = tensorRelu(var_47); - void* var_49 = ConvLayer_PROMISE(var_48, 0.0, 3.259194364786183, conv2d_17_w, -0.08665236312896013, 0.0898308474570517, conv2d_17_b, -3.9163042e-05, 4.2771928e-05, 1, 1, 1, 1, -1, 0, -1, -2.673636848211288, 2.3574042041302774, 9); - void* var_50 = tensorBatchNorm(var_49, batch_normalization_17_gamma, batch_normalization_17_beta, batch_normalization_17_mean, batch_normalization_17_variance, 0.001); - void* var_51 = tensorRelu(var_50); - void* var_52 = ConvLayer_PROMISE(var_51, 0.0, 3.641261647939746, conv2d_18_w, -0.12198246002197266, 0.1347003544867095, conv2d_18_b, -5.3173797e-05, 4.8076203e-05, 0, 0, 1, 1, -1, 0, -1, -1.0623184064626694, 0.916913630664359, 9); - void* var_53 = tensorBatchNorm(var_52, batch_normalization_18_gamma, batch_normalization_18_beta, batch_normalization_18_mean, batch_normalization_18_variance, 0.001); - void* var_54 = tensorAdd(var_53, var_45); - void* var_55 = tensorRelu(var_54); - void* var_56 = ConvLayer_PROMISE(var_55, 0.0, 6.852215012073557, conv2d_19_w, -0.1122598509863019, 0.1435348897427337, conv2d_19_b, -1.20778e-05, 2.599136e-05, 0, 0, 1, 1, -1, 0, -1, -6.0281127138137816, 6.227049376964593, 9); - void* var_57 = tensorBatchNorm(var_56, batch_normalization_19_gamma, batch_normalization_19_beta, batch_normalization_19_mean, batch_normalization_19_variance, 0.001); - void* var_58 = tensorRelu(var_57); - void* var_59 = ConvLayer_PROMISE(var_58, 0.0, 3.397107238292711, conv2d_20_w, -0.1049889962002635, 0.1349111200869117, conv2d_20_b, -2.7412994e-05, 3.9722e-05, 1, 1, 1, 1, -1, 0, -1, -4.057081372261047, 4.329259678363884, 9); - void* var_60 = tensorBatchNorm(var_59, batch_normalization_20_gamma, batch_normalization_20_beta, batch_normalization_20_mean, batch_normalization_20_variance, 0.001); - void* var_61 = tensorRelu(var_60); - void* var_62 = ConvLayer_PROMISE(var_61, 0.0, 3.6484641625881262, conv2d_21_w, -0.1401274445652962, 0.12122062336653527, conv2d_21_b, -5.5854776e-05, 7.8164114e-05, 0, 0, 1, 1, -1, 0, -1, -1.626526164531708, 0.8401960272193048, 9); - void* var_63 = tensorBatchNorm(var_62, batch_normalization_21_gamma, batch_normalization_21_beta, batch_normalization_21_mean, batch_normalization_21_variance, 0.001); - void* var_64 = tensorAdd(var_63, var_55); - void* var_65 = tensorRelu(var_64); - void* var_66 = ConvLayer_PROMISE(var_65, 0.0, 6.820035747528095, conv2d_22_w, -0.16039140529930593, 0.18889211259782335, conv2d_22_b, -4.6078047e-05, 3.3613425e-05, 0, 0, 1, 1, -1, 0, -1, -4.6271090393066405, 4.527790556430912, 9); - void* var_67 = tensorBatchNorm(var_66, batch_normalization_22_gamma, batch_normalization_22_beta, batch_normalization_22_mean, batch_normalization_22_variance, 0.001); - void* var_68 = tensorRelu(var_67); - void* var_69 = ConvLayer_PROMISE(var_68, 0.0, 4.432856665611537, conv2d_23_w, -0.11397356178611517, 0.10787127982825667, conv2d_23_b, -3.6726604e-05, 2.4220695e-05, 1, 1, 1, 1, -1, 0, -1, -3.697339488506317, 3.1427979104519426, 9); - void* var_70 = tensorBatchNorm(var_69, batch_normalization_23_gamma, batch_normalization_23_beta, batch_normalization_23_mean, batch_normalization_23_variance, 0.001); - void* var_71 = tensorRelu(var_70); - void* var_72 = ConvLayer_PROMISE(var_71, 0.0, 4.711423307418915, conv2d_24_w, -0.11341997660696507, 0.1437816035747536, conv2d_24_b, -2.7102393e-05, 3.091236e-05, 0, 0, 1, 1, -1, 0, -1, -1.4133628906011582, 1.2987316379547167, 9); - void* var_73 = tensorBatchNorm(var_72, batch_normalization_24_gamma, batch_normalization_24_beta, batch_normalization_24_mean, batch_normalization_24_variance, 0.001); - void* var_74 = tensorAdd(var_73, var_65); - void* var_75 = tensorRelu(var_74); - void* var_76 = ConvLayer_PROMISE(var_75, 0.0, 7.624651549339404, conv2d_25_w, -0.10495923960208893, 0.12068889104576047, conv2d_25_b, -1.0208429e-05, 1.1486276e-05, 0, 0, 2, 2, -1, 0, -1, -3.87531214427948, 3.676609352588745, 9); - void* var_77 = tensorBatchNorm(var_76, batch_normalization_25_gamma, batch_normalization_25_beta, batch_normalization_25_mean, batch_normalization_25_variance, 0.001); - void* var_78 = tensorRelu(var_77); - void* var_79 = ConvLayer_PROMISE(var_78, 0.0, 4.044620439529737, conv2d_26_w, -0.07615160812437534, 0.07977425544709099, conv2d_26_b, -2.4272886e-05, 1.6434806e-05, 1, 1, 1, 1, -1, 0, -1, -6.102653044223786, 4.761939919948585, 9); - void* var_80 = tensorBatchNorm(var_79, batch_normalization_26_gamma, batch_normalization_26_beta, batch_normalization_26_mean, batch_normalization_26_variance, 0.001); - void* var_81 = tensorRelu(var_80); - void* var_82 = ConvLayer_PROMISE(var_81, 0.0, 3.4468260111809705, conv2d_27_w, -0.11533496034890414, 0.10714908299595141, conv2d_27_b, -3.225456e-05, 4.8422902e-05, 0, 0, 1, 1, -1, 0, -1, -1.319659793496132, 1.0189965035915467, 9); - void* var_83 = tensorBatchNorm(var_82, batch_normalization_27_gamma, batch_normalization_27_beta, batch_normalization_27_mean, batch_normalization_27_variance, 0.001); - void* var_84 = ConvLayer_PROMISE(var_75, 0.0, 7.624651549339404, conv2d_28_w, -0.0966497472524643, 0.10240990699082783, conv2d_28_b, -1.4815519e-05, 1.554276e-05, 0, 0, 2, 2, -1, 0, -1, -3.9412443549633025, 3.863056869030064, 9); - void* var_85 = tensorBatchNorm(var_84, batch_normalization_28_gamma, batch_normalization_28_beta, batch_normalization_28_mean, batch_normalization_28_variance, 0.001); - void* var_86 = tensorAdd(var_83, var_85); - void* var_87 = tensorRelu(var_86); - void* var_88 = ConvLayer_PROMISE(var_87, 0.0, 6.879177100658442, conv2d_29_w, -0.06468586190789938, 0.08113565444201333, conv2d_29_b, -7.4607115e-06, 6.926009e-06, 0, 0, 1, 1, -1, 0, -1, -7.112777866363525, 4.633408185959027, 9); - void* var_89 = tensorBatchNorm(var_88, batch_normalization_29_gamma, batch_normalization_29_beta, batch_normalization_29_mean, batch_normalization_29_variance, 0.001); - void* var_90 = tensorRelu(var_89); - void* var_91 = ConvLayer_PROMISE(var_90, 0.0, 3.2354076790810105, conv2d_30_w, -0.06493933162838221, 0.07104272978752861, conv2d_30_b, -1.9349398e-05, 2.0178473e-05, 1, 1, 1, 1, -1, 0, -1, -3.226332322359085, 2.5138739056587447, 9); - void* var_92 = tensorBatchNorm(var_91, batch_normalization_30_gamma, batch_normalization_30_beta, batch_normalization_30_mean, batch_normalization_30_variance, 0.001); - void* var_93 = tensorRelu(var_92); - void* var_94 = ConvLayer_PROMISE(var_93, 0.0, 3.003848925829006, conv2d_31_w, -0.0918996930718422, 0.08853508594632167, conv2d_31_b, -4.2279236e-05, 5.5378885e-05, 0, 0, 1, 1, -1, 0, -1, -0.9247466986179351, 0.572747143149404, 9); - void* var_95 = tensorBatchNorm(var_94, batch_normalization_31_gamma, batch_normalization_31_beta, batch_normalization_31_mean, batch_normalization_31_variance, 0.001); - void* var_96 = tensorAdd(var_95, var_87); - void* var_97 = tensorRelu(var_96); - void* var_98 = ConvLayer_PROMISE(var_97, 0.0, 6.566591289043519, conv2d_32_w, -0.07145480328053236, 0.09098157961666606, conv2d_32_b, -1.0478255e-05, 1.4408147e-05, 0, 0, 1, 1, -1, 0, -1, -4.183038790225982, 3.5941159300804166, 9); - void* var_99 = tensorBatchNorm(var_98, batch_normalization_32_gamma, batch_normalization_32_beta, batch_normalization_32_mean, batch_normalization_32_variance, 0.001); - void* var_100 = tensorRelu(var_99); - void* var_101 = ConvLayer_PROMISE(var_100, 0.0, 3.0348211803436556, conv2d_33_w, -0.056237234909087414, 0.06478620118647821, conv2d_33_b, -2.2639133e-05, 2.6081116e-05, 1, 1, 1, 1, -1, 0, -1, -2.098393235206604, 1.706788736581844, 9); - void* var_102 = tensorBatchNorm(var_101, batch_normalization_33_gamma, batch_normalization_33_beta, batch_normalization_33_mean, batch_normalization_33_variance, 0.001); - void* var_103 = tensorRelu(var_102); - void* var_104 = ConvLayer_PROMISE(var_103, 0.0, 3.248518852949145, conv2d_34_w, -0.07141499005258084, 0.08281665176153225, conv2d_34_b, -3.221229e-05, 4.569047e-05, 0, 0, 1, 1, -1, 0, -1, -0.8273181943893433, 0.7378616912961369, 9); - void* var_105 = tensorBatchNorm(var_104, batch_normalization_34_gamma, batch_normalization_34_beta, batch_normalization_34_mean, batch_normalization_34_variance, 0.001); - void* var_106 = tensorAdd(var_105, var_97); - void* var_107 = tensorRelu(var_106); - void* var_108 = ConvLayer_PROMISE(var_107, 0.0, 6.7038991017341765, conv2d_35_w, -0.06838216692209244, 0.09303134681284767, conv2d_35_b, -1.047402e-05, 1.0168567e-05, 0, 0, 1, 1, -1, 0, -1, -4.168091129779816, 3.5077465448380494, 9); - void* var_109 = tensorBatchNorm(var_108, batch_normalization_35_gamma, batch_normalization_35_beta, batch_normalization_35_mean, batch_normalization_35_variance, 0.001); - void* var_110 = tensorRelu(var_109); - void* var_111 = ConvLayer_PROMISE(var_110, 0.0, 2.8976624414922814, conv2d_36_w, -0.05521866928786039, 0.06331418491154919, conv2d_36_b, -3.86494e-05, 2.5999781e-05, 1, 1, 1, 1, -1, 0, -1, -2.182177306175232, 2.0366714165211324, 9); - void* var_112 = tensorBatchNorm(var_111, batch_normalization_36_gamma, batch_normalization_36_beta, batch_normalization_36_mean, batch_normalization_36_variance, 0.001); - void* var_113 = tensorRelu(var_112); - void* var_114 = ConvLayer_PROMISE(var_113, 0.0, 3.1310220296382933, conv2d_37_w, -0.07256266868114472, 0.08391195811331292, conv2d_37_b, -4.8211587e-05, 4.7546604e-05, 0, 0, 1, 1, -1, 0, -1, -1.1372777166366577, 0.5528145518899268, 9); - void* var_115 = tensorBatchNorm(var_114, batch_normalization_37_gamma, batch_normalization_37_beta, batch_normalization_37_mean, batch_normalization_37_variance, 0.001); - void* var_116 = tensorAdd(var_115, var_107); - void* var_117 = tensorRelu(var_116); - void* var_118 = ConvLayer_PROMISE(var_117, 0.0, 6.625923678875129, conv2d_38_w, -0.06549047549813986, 0.10113389839232205, conv2d_38_b, -1.2351429e-05, 9.263066e-06, 0, 0, 1, 1, -1, 0, -1, -3.846879935503006, 3.639795066118241, 9); - void* var_119 = tensorBatchNorm(var_118, batch_normalization_38_gamma, batch_normalization_38_beta, batch_normalization_38_mean, batch_normalization_38_variance, 0.001); - void* var_120 = tensorRelu(var_119); - void* var_121 = ConvLayer_PROMISE(var_120, 0.0, 3.200671393632918, conv2d_39_w, -0.05184716333821415, 0.06296417640149599, conv2d_39_b, -2.4313656e-05, 3.812053e-05, 1, 1, 1, 1, -1, 0, -1, -1.9442583957910538, 1.5269825316667864, 9); - void* var_122 = tensorBatchNorm(var_121, batch_normalization_39_gamma, batch_normalization_39_beta, batch_normalization_39_mean, batch_normalization_39_variance, 0.001); - void* var_123 = tensorRelu(var_122); - void* var_124 = ConvLayer_PROMISE(var_123, 0.0, 4.040827783107826, conv2d_40_w, -0.0670140995979309, 0.0777734544128187, conv2d_40_b, -3.378767e-05, 2.5727571e-05, 0, 0, 1, 1, -1, 0, -1, -1.3243955926895141, 0.9261298480034093, 9); - void* var_125 = tensorBatchNorm(var_124, batch_normalization_40_gamma, batch_normalization_40_beta, batch_normalization_40_mean, batch_normalization_40_variance, 0.001); - void* var_126 = tensorAdd(var_125, var_117); - void* var_127 = tensorRelu(var_126); - void* var_128 = ConvLayer_PROMISE(var_127, 0.0, 6.8198375024796505, conv2d_41_w, -0.0710306192561984, 0.10828035335987954, conv2d_41_b, -1.3110192e-05, 1.5449377e-05, 0, 0, 1, 1, -1, 0, -1, -3.2434056091308596, 5.530628140926378, 9); - void* var_129 = tensorBatchNorm(var_128, batch_normalization_41_gamma, batch_normalization_41_beta, batch_normalization_41_mean, batch_normalization_41_variance, 0.001); - void* var_130 = tensorRelu(var_129); - void* var_131 = ConvLayer_PROMISE(var_130, 0.0, 4.811174154282, conv2d_42_w, -0.056100725468248125, 0.06774817473441476, conv2d_42_b, -2.7899796e-05, 3.0695155e-05, 1, 1, 1, 1, -1, 0, -1, -3.553957043647766, 3.0058912243844595, 9); - void* var_132 = tensorBatchNorm(var_131, batch_normalization_42_gamma, batch_normalization_42_beta, batch_normalization_42_mean, batch_normalization_42_variance, 0.001); - void* var_133 = tensorRelu(var_132); - void* var_134 = ConvLayer_PROMISE(var_133, 0.0, 6.503577950477883, conv2d_43_w, -0.06820484285801648, 0.0836490480080298, conv2d_43_b, -2.2592936e-05, 2.3876093e-05, 0, 0, 1, 1, -1, 0, -1, -2.760284422159195, 1.1501846584081763, 9); - void* var_135 = tensorBatchNorm(var_134, batch_normalization_43_gamma, batch_normalization_43_beta, batch_normalization_43_mean, batch_normalization_43_variance, 0.001); - void* var_136 = tensorAdd(var_135, var_127); - void* var_137 = tensorRelu(var_136); - void* var_138 = ConvLayer_PROMISE(var_137, 0.0, 7.423539982796591, conv2d_44_w, -0.06768814034759998, 0.07900290366262253, conv2d_44_b, -1.0954906e-05, 1.2313803e-05, 0, 0, 2, 2, -1, 0, -1, -3.8250768241882325, 3.133637444972998, 9); - void* var_139 = tensorBatchNorm(var_138, batch_normalization_44_gamma, batch_normalization_44_beta, batch_normalization_44_mean, batch_normalization_44_variance, 0.001); - void* var_140 = tensorRelu(var_139); - void* var_141 = ConvLayer_PROMISE(var_140, 0.0, 3.234270730257073, conv2d_45_w, -0.04219715926796198, 0.04603923132643117, conv2d_45_b, -1.9525614e-05, 2.6300824e-05, 1, 1, 1, 1, -1, 0, -1, -3.2753402066230777, 1.8960905054807824, 9); - void* var_142 = tensorBatchNorm(var_141, batch_normalization_45_gamma, batch_normalization_45_beta, batch_normalization_45_mean, batch_normalization_45_variance, 0.001); - void* var_143 = tensorRelu(var_142); - void* var_144 = ConvLayer_PROMISE(var_143, 0.0, 2.675833512783051, conv2d_46_w, -0.051137199997901915, 0.07428906522691328, conv2d_46_b, -2.6416203e-05, 3.079251e-05, 0, 0, 1, 1, -1, 0, -1, -0.6374539139270782, 0.6678488029241574, 9); - void* var_145 = tensorBatchNorm(var_144, batch_normalization_46_gamma, batch_normalization_46_beta, batch_normalization_46_mean, batch_normalization_46_variance, 0.001); - void* var_146 = ConvLayer_PROMISE(var_137, 0.0, 7.423539982796591, conv2d_47_w, -0.047168924897909165, 0.06949675244092963, conv2d_47_b, -1.2322937e-05, 2.1868867e-05, 0, 0, 2, 2, -1, 0, -1, -1.8896190267801285, 2.387520755291127, 9); - void* var_147 = tensorBatchNorm(var_146, batch_normalization_47_gamma, batch_normalization_47_beta, batch_normalization_47_mean, batch_normalization_47_variance, 0.001); - void* var_148 = tensorAdd(var_145, var_147); - void* var_149 = tensorRelu(var_148); - void* var_150 = ConvLayer_PROMISE(var_149, 0.0, 12.392736603737378, conv2d_48_w, -0.04417608780786395, 0.06200448917225007, conv2d_48_b, -6.6323187e-06, 7.1494946e-06, 0, 0, 1, 1, -1, 0, -1, -9.068103209495545, 5.912482521057253, 9); - void* var_151 = tensorBatchNorm(var_150, batch_normalization_48_gamma, batch_normalization_48_beta, batch_normalization_48_mean, batch_normalization_48_variance, 0.001); - void* var_152 = tensorRelu(var_151); - void* var_153 = ConvLayer_PROMISE(var_152, 0.0, 2.565971518278122, conv2d_49_w, -0.036550714168697596, 0.042889032773673605, conv2d_49_b, -3.1749918e-05, 3.1403273e-05, 1, 1, 1, 1, -1, 0, -1, -2.0715825698375703, 1.4426317431927056, 9); - void* var_154 = tensorBatchNorm(var_153, batch_normalization_49_gamma, batch_normalization_49_beta, batch_normalization_49_mean, batch_normalization_49_variance, 0.001); - void* var_155 = tensorRelu(var_154); - void* var_156 = ConvLayer_PROMISE(var_155, 0.0, 2.2121606218814973, conv2d_50_w, -0.04563436089083552, 0.07235725801438761, conv2d_50_b, -5.138708e-05, 5.6959605e-05, 0, 0, 1, 1, -1, 0, -1, -0.5048498404622078, 0.4972966857850613, 9); - void* var_157 = tensorBatchNorm(var_156, batch_normalization_50_gamma, batch_normalization_50_beta, batch_normalization_50_mean, batch_normalization_50_variance, 0.001); - void* var_158 = tensorAdd(var_157, var_149); - void* var_159 = tensorRelu(var_158); - void* var_160 = ConvLayer_PROMISE(var_159, 0.0, 12.996321228027455, conv2d_51_w, -0.051894455961883065, 0.07700131461024579, conv2d_51_b, -8.893526e-06, 7.6235174e-06, 0, 0, 1, 1, -1, 0, -1, -7.534810958862305, 7.1688279371266015, 9); - void* var_161 = tensorBatchNorm(var_160, batch_normalization_51_gamma, batch_normalization_51_beta, batch_normalization_51_mean, batch_normalization_51_variance, 0.001); - void* var_162 = tensorRelu(var_161); - void* var_163 = ConvLayer_PROMISE(var_162, 0.0, 2.806837086677553, conv2d_52_w, -0.032556386385113004, 0.038920990321785316, conv2d_52_b, -3.1544037e-05, 4.5056524e-05, 1, 1, 1, 1, -1, 0, -1, -1.6795331789255141, 0.9551341712474886, 9); - void* var_164 = tensorBatchNorm(var_163, batch_normalization_52_gamma, batch_normalization_52_beta, batch_normalization_52_mean, batch_normalization_52_variance, 0.001); - void* var_165 = tensorRelu(var_164); - void* var_166 = ConvLayer_PROMISE(var_165, 0.0, 2.7935527668000724, conv2d_53_w, -0.04313115822151303, 0.0774340439587877, conv2d_53_b, -2.8713988e-05, 4.1641888e-05, 0, 0, 1, 1, -1, 0, -1, -0.5173906384706497, 0.5710835611820362, 9); - void* var_167 = tensorBatchNorm(var_166, batch_normalization_53_gamma, batch_normalization_53_beta, batch_normalization_53_mean, batch_normalization_53_variance, 0.001); - void* var_168 = tensorAdd(var_167, var_159); - void* var_169 = tensorRelu(var_168); - void* var_170 = tensorPooling(var_169,1,7,7,0,0,7,7); - void* var_171 = FCLayer_PROMISE(var_170, 0.0, 5.305631495475859, dense_1_w, -0.09220413094758988, 0.24919447432458666, dense_1_b, -0.024729362, 0.028545722, -1, -6.579668023586273, 7.794472872257277, 9); - void* var_172 = tensorSoftmax(var_171); - - uint32_t* labels = readLabelsBatch3(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy3(labels, var_172); - final_accuracy += accuracy; - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - - } - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar100_piped.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar100_piped.cc deleted file mode 100644 index 1765f13335..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar100_piped.cc +++ /dev/null @@ -1,212 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 500; - int offset = 5000; - - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - llvm_hpvm_initTensorRt(0); - - - std::string dir_prefix = std::string("../model_params/vgg16_cifar100/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,3,3); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,128,64,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,128,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_7_b_path = dir_prefix + std::string("conv2d_7_b.bin"); - void* conv2d_7_b = readTrainedWeights(conv2d_7_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,512,256,3,3); - std::string conv2d_8_b_path = dir_prefix + std::string("conv2d_8_b.bin"); - void* conv2d_8_b = readTrainedWeights(conv2d_8_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_9_b_path = dir_prefix + std::string("conv2d_9_b.bin"); - void* conv2d_9_b = readTrainedWeights(conv2d_9_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_10_b_path = dir_prefix + std::string("conv2d_10_b.bin"); - void* conv2d_10_b = readTrainedWeights(conv2d_10_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_11_b_path = dir_prefix + std::string("conv2d_11_b.bin"); - void* conv2d_11_b = readTrainedWeights(conv2d_11_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_12_b_path = dir_prefix + std::string("conv2d_12_b.bin"); - void* conv2d_12_b = readTrainedWeights(conv2d_12_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_13_b_path = dir_prefix + std::string("conv2d_13_b.bin"); - void* conv2d_13_b = readTrainedWeights(conv2d_13_b_path.c_str(), 0,1,512,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,512,512); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,512,1,1); - std::string dense_2_w_path = dir_prefix + std::string("dense_2_w.bin"); - void* dense_2_w = readTrainedWeights(dense_2_w_path.c_str(), 0,1,1,512,100); - std::string dense_2_b_path = dir_prefix + std::string("dense_2_b.bin"); - void* dense_2_b = readTrainedWeights(dense_2_b_path.c_str(), 0,1,100,1,1); - - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - // NOTE: Wait on signal from OpenTuner - stallOnOpenTunerSignal(); - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - for(int i = 0; i < batch_count; i++){ - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.7829767, 1.9456929, conv2d_1_w, -0.7450515, 0.71249133, conv2d_1_b, -1.5885142, 0.275554, 1, 1, 1, 1, -1, 0, 1, 0.0, 8.190712, 9); - void* var_1 = ConvLayer_PROMISE(var_0, 0.0, 8.190712, conv2d_2_w, -0.30790088, 0.43504623, conv2d_2_b, -1.4242363, 1.2602744, 1, 1, 1, 1, 0, 2, 1, 0.0, 19.023172, 9); - void* var_2 = ConvLayer_PROMISE(var_1, 0.0, 19.023172, conv2d_3_w, -0.29189092, 0.26958522, conv2d_3_b, -1.0527138, 0.9075671, 1, 1, 1, 1, -1, 0, 1, 0.0, 14.428051, 9); - void* var_3 = ConvLayer_PROMISE(var_2, 0.0, 14.428051, conv2d_4_w, -0.15521508, 0.1829038, conv2d_4_b, -0.845419, 1.9358484, 1, 1, 1, 1, 0, 2, 1, 0.0, 23.065294, 9); - void* var_4 = ConvLayer_PROMISE(var_3, 0.0, 23.065294, conv2d_5_w, -0.13149762, 0.14811686, conv2d_5_b, -0.7162557, 1.0370971, 1, 1, 1, 1, -1, 0, 1, 0.0, 15.165984, 9); - void* var_5 = ConvLayer_PROMISE(var_4, 0.0, 15.165984, conv2d_6_w, -0.06236292, 0.08321518, conv2d_6_b, -0.9067523, 0.9922458, 1, 1, 1, 1, -1, 0, 1, 0.0, 13.664733, 9); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 13.664733, conv2d_7_w, -0.06471479, 0.1024472, conv2d_7_b, -0.15943134, 0.7988499, 1, 1, 1, 1, 0, 2, 1, 0.0, 19.025272, 9); - void* var_7 = ConvLayer_PROMISE(var_6, 0.0, 19.025272, conv2d_8_w, -0.06320205, 0.08291938, conv2d_8_b, -0.32540628, 0.5203079, 1, 1, 1, 1, -1, 0, 1, 0.0, 6.727217, 9); - void* var_8 = ConvLayer_PROMISE(var_7, 0.0, 6.727217, conv2d_9_w, -0.037707984, 0.051601283, conv2d_9_b, -0.25622904, 0.11251946, 1, 1, 1, 1, -1, 0, 1, 0.0, 3.2003012, 9); - void* var_9 = ConvLayer_PROMISE(var_8, 0.0, 3.2003012, conv2d_10_w, -0.056007143, 0.09549151, conv2d_10_b, -0.11591503, 0.06267536, 1, 1, 1, 1, 0, 2, 1, 0.0, 4.321189, 9); - void* var_10 = ConvLayer_PROMISE(var_9, 0.0, 4.321189, conv2d_11_w, -0.060094673, 0.10868926, conv2d_11_b, -0.105962686, 0.09584572, 1, 1, 1, 1, -1, 0, 1, 0.0, 2.936297, 9); - void* var_11 = ConvLayer_PROMISE(var_10, 0.0, 2.936297, conv2d_12_w, -0.034618977, 0.05792674, conv2d_12_b, -0.4237576, 0.11035452, 1, 1, 1, 1, -1, 0, 1, 0.0, 4.87262, 9); - void* var_12 = ConvLayer_PROMISE(var_11, 0.0, 4.87262, conv2d_13_w, -0.035480656, 0.058295887, conv2d_13_b, -0.21477045, 0.14263579, 1, 1, 1, 1, 0, 2, 1, 0.0, 10.32133, 9); - void* var_13 = FCLayer_PROMISE(var_12, 0.0, 10.32133, dense_1_w, -0.08929961, 0.11301676, dense_1_b, -0.20798548, 0.47405547, 1, 0.0, 13.91, 9); - void* var_14 = FCLayer_PROMISE(var_13, 0.0, 13.91, dense_2_w, -0.6627122, 0.35539475, dense_2_b, -1.0631907, 0.9830786, -1, -70.45701, 87.34367, 9); - void* var_15 = tensorSoftmax(var_14); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_15, 100); - final_accuracy += accuracy; - - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_15, classConfs, predictedLabels, relative_start, relative_end); - } - - freeBatchMemory(); - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - - // NOTE: Signal back to OpenTuner - signalPipeToOpenTuner(); - } - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar100_promise.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar100_promise.cc deleted file mode 100644 index 798bc8a1d7..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar100_promise.cc +++ /dev/null @@ -1,207 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 1000; - int offset = 5000; - - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - llvm_hpvm_initTensorRt(0); - - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - std::string dir_prefix = std::string("../model_params/vgg16_cifar100/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - for(int i = 0; i < batch_count; i++){ - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,3,3); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,128,64,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,128,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_7_b_path = dir_prefix + std::string("conv2d_7_b.bin"); - void* conv2d_7_b = readTrainedWeights(conv2d_7_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,512,256,3,3); - std::string conv2d_8_b_path = dir_prefix + std::string("conv2d_8_b.bin"); - void* conv2d_8_b = readTrainedWeights(conv2d_8_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_9_b_path = dir_prefix + std::string("conv2d_9_b.bin"); - void* conv2d_9_b = readTrainedWeights(conv2d_9_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_10_b_path = dir_prefix + std::string("conv2d_10_b.bin"); - void* conv2d_10_b = readTrainedWeights(conv2d_10_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_11_b_path = dir_prefix + std::string("conv2d_11_b.bin"); - void* conv2d_11_b = readTrainedWeights(conv2d_11_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_12_b_path = dir_prefix + std::string("conv2d_12_b.bin"); - void* conv2d_12_b = readTrainedWeights(conv2d_12_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_13_b_path = dir_prefix + std::string("conv2d_13_b.bin"); - void* conv2d_13_b = readTrainedWeights(conv2d_13_b_path.c_str(), 0,1,512,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,512,512); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,512,1,1); - std::string dense_2_w_path = dir_prefix + std::string("dense_2_w.bin"); - void* dense_2_w = readTrainedWeights(dense_2_w_path.c_str(), 0,1,1,512,100); - std::string dense_2_b_path = dir_prefix + std::string("dense_2_b.bin"); - void* dense_2_b = readTrainedWeights(dense_2_b_path.c_str(), 0,1,100,1,1); - - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.7829767, 1.9456929, conv2d_1_w, -0.7450515, 0.71249133, conv2d_1_b, -1.5885142, 0.275554, 1, 1, 1, 1, -1, 0, 1, 0.0, 8.190712, 9); - void* var_1 = ConvLayer_PROMISE(var_0, 0.0, 8.190712, conv2d_2_w, -0.30790088, 0.43504623, conv2d_2_b, -1.4242363, 1.2602744, 1, 1, 1, 1, 0, 2, 1, 0.0, 19.023172, 9); - void* var_2 = ConvLayer_PROMISE(var_1, 0.0, 19.023172, conv2d_3_w, -0.29189092, 0.26958522, conv2d_3_b, -1.0527138, 0.9075671, 1, 1, 1, 1, -1, 0, 1, 0.0, 14.428051, 9); - void* var_3 = ConvLayer_PROMISE(var_2, 0.0, 14.428051, conv2d_4_w, -0.15521508, 0.1829038, conv2d_4_b, -0.845419, 1.9358484, 1, 1, 1, 1, 0, 2, 1, 0.0, 23.065294, 9); - void* var_4 = ConvLayer_PROMISE(var_3, 0.0, 23.065294, conv2d_5_w, -0.13149762, 0.14811686, conv2d_5_b, -0.7162557, 1.0370971, 1, 1, 1, 1, -1, 0, 1, 0.0, 15.165984, 9); - void* var_5 = ConvLayer_PROMISE(var_4, 0.0, 15.165984, conv2d_6_w, -0.06236292, 0.08321518, conv2d_6_b, -0.9067523, 0.9922458, 1, 1, 1, 1, -1, 0, 1, 0.0, 13.664733, 9); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 13.664733, conv2d_7_w, -0.06471479, 0.1024472, conv2d_7_b, -0.15943134, 0.7988499, 1, 1, 1, 1, 0, 2, 1, 0.0, 19.025272, 9); - void* var_7 = ConvLayer_PROMISE(var_6, 0.0, 19.025272, conv2d_8_w, -0.06320205, 0.08291938, conv2d_8_b, -0.32540628, 0.5203079, 1, 1, 1, 1, -1, 0, 1, 0.0, 6.727217, 9); - void* var_8 = ConvLayer_PROMISE(var_7, 0.0, 6.727217, conv2d_9_w, -0.037707984, 0.051601283, conv2d_9_b, -0.25622904, 0.11251946, 1, 1, 1, 1, -1, 0, 1, 0.0, 3.2003012, 9); - void* var_9 = ConvLayer_PROMISE(var_8, 0.0, 3.2003012, conv2d_10_w, -0.056007143, 0.09549151, conv2d_10_b, -0.11591503, 0.06267536, 1, 1, 1, 1, 0, 2, 1, 0.0, 4.321189, 9); - void* var_10 = ConvLayer_PROMISE(var_9, 0.0, 4.321189, conv2d_11_w, -0.060094673, 0.10868926, conv2d_11_b, -0.105962686, 0.09584572, 1, 1, 1, 1, -1, 0, 1, 0.0, 2.936297, 9); - void* var_11 = ConvLayer_PROMISE(var_10, 0.0, 2.936297, conv2d_12_w, -0.034618977, 0.05792674, conv2d_12_b, -0.4237576, 0.11035452, 1, 1, 1, 1, -1, 0, 1, 0.0, 4.87262, 9); - void* var_12 = ConvLayer_PROMISE(var_11, 0.0, 4.87262, conv2d_13_w, -0.035480656, 0.058295887, conv2d_13_b, -0.21477045, 0.14263579, 1, 1, 1, 1, 0, 2, 1, 0.0, 10.32133, 9); - void* var_13 = FCLayer_PROMISE(var_12, 0.0, 10.32133, dense_1_w, -0.08929961, 0.11301676, dense_1_b, -0.20798548, 0.47405547, 1, 0.0, 13.91, 9); - void* var_14 = FCLayer_PROMISE(var_13, 0.0, 13.91, dense_2_w, -0.6627122, 0.35539475, dense_2_b, -1.0631907, 0.9830786, -1, -70.45701, 87.34367, 9); - void* var_15 = tensorSoftmax(var_14); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_15, 100); - final_accuracy += accuracy; - - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_15, classConfs, predictedLabels, relative_start, relative_end); - } - - freeBatchMemory(); - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - } - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar100_top5_promise.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar100_top5_promise.cc deleted file mode 100644 index 7911c64567..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar100_top5_promise.cc +++ /dev/null @@ -1,137 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "../../../tensor_runtime/include/tensor_runtime.h" -#include "../../include/utils.h" - -int main(){ - - llvm_hpvm_initTensorRt(3); - - int total_runs = 1; - for (int i = 0 ; i < total_runs; i++){ - - startMemTracking(); - - int test_input_size = 4000; - //int batch_size = 2500; - int batch_size = 4000; - int offset = 5000; - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - for(int i = 0; i < batch_count; i++){ - - std::string dir_prefix = std::string("../model_params/vgg16_cifar100_front/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,3,3); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,128,64,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,128,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_7_b_path = dir_prefix + std::string("conv2d_7_b.bin"); - void* conv2d_7_b = readTrainedWeights(conv2d_7_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,512,256,3,3); - std::string conv2d_8_b_path = dir_prefix + std::string("conv2d_8_b.bin"); - void* conv2d_8_b = readTrainedWeights(conv2d_8_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_9_b_path = dir_prefix + std::string("conv2d_9_b.bin"); - void* conv2d_9_b = readTrainedWeights(conv2d_9_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_10_b_path = dir_prefix + std::string("conv2d_10_b.bin"); - void* conv2d_10_b = readTrainedWeights(conv2d_10_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_11_b_path = dir_prefix + std::string("conv2d_11_b.bin"); - void* conv2d_11_b = readTrainedWeights(conv2d_11_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_12_b_path = dir_prefix + std::string("conv2d_12_b.bin"); - void* conv2d_12_b = readTrainedWeights(conv2d_12_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_13_b_path = dir_prefix + std::string("conv2d_13_b.bin"); - void* conv2d_13_b = readTrainedWeights(conv2d_13_b_path.c_str(), 0,1,512,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,512,512); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,512,1,1); - std::string dense_2_w_path = dir_prefix + std::string("dense_2_w.bin"); - void* dense_2_w = readTrainedWeights(dense_2_w_path.c_str(), 0,1,1,512,100); - std::string dense_2_b_path = dir_prefix + std::string("dense_2_b.bin"); - void* dense_2_b = readTrainedWeights(dense_2_b_path.c_str(), 0,1,100,1,1); - - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.7829767, 1.9456929, conv2d_1_w, -0.7450515, 0.71249133, conv2d_1_b, -1.5885142, 0.275554, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.7384350299835205, 9); - void* var_1 = ConvLayer_PROMISE(var_0, 0.0, 1.7384350299835205, conv2d_2_w, -0.30790088, 0.43504623, conv2d_2_b, -1.4242363, 1.2602744, 1, 1, 1, 1, 0, 2, 1, 0.0, 4.417154796123498, 9); - void* var_2 = ConvLayer_PROMISE(var_1, 0.0, 4.417154796123498, conv2d_3_w, -0.29189092, 0.26958522, conv2d_3_b, -1.0527138, 0.9075671, 1, 1, 1, 1, -1, 0, 1, 0.0, 3.1919608163833573, 9); - void* var_3 = ConvLayer_PROMISE(var_2, 0.0, 3.1919608163833573, conv2d_4_w, -0.15521508, 0.1829038, conv2d_4_b, -0.845419, 1.9358484, 1, 1, 1, 1, 0, 2, 1, 0.0, 5.108994026184064, 9); - void* var_4 = ConvLayer_PROMISE(var_3, 0.0, 5.108994026184064, conv2d_5_w, -0.13149762, 0.14811686, conv2d_5_b, -0.7162557, 1.0370971, 1, 1, 1, 1, -1, 0, 1, 0.0, 2.8264513099193493, 9); - void* var_5 = ConvLayer_PROMISE(var_4, 0.0, 2.8264513099193493, conv2d_6_w, -0.06236292, 0.08321518, conv2d_6_b, -0.9067523, 0.9922458, 1, 1, 1, 1, -1, 0, 1, 0.0, 2.507186658382409, 9); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 2.507186658382409, conv2d_7_w, -0.06471479, 0.1024472, conv2d_7_b, -0.15943134, 0.7988499, 1, 1, 1, 1, 0, 2, 1, 0.0, 2.550416946411133, 9); - void* var_7 = ConvLayer_PROMISE(var_6, 0.0, 2.550416946411133, conv2d_8_w, -0.06320205, 0.08291938, conv2d_8_b, -0.32540628, 0.5203079, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.7303829237818675, 9); - void* var_8 = ConvLayer_PROMISE(var_7, 0.0, 0.7303829237818675, conv2d_9_w, -0.037707984, 0.051601283, conv2d_9_b, -0.25622904, 0.11251946, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.32286912292241965, 9); - void* var_9 = ConvLayer_PROMISE(var_8, 0.0, 0.32286912292241965, conv2d_10_w, -0.056007143, 0.09549151, conv2d_10_b, -0.11591503, 0.06267536, 1, 1, 1, 1, 0, 2, 1, 0.0, 0.47936276525258825, 9); - void* var_10 = ConvLayer_PROMISE(var_9, 0.0, 0.47936276525258825, conv2d_11_w, -0.060094673, 0.10868926, conv2d_11_b, -0.105962686, 0.09584572, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.6409912902116734, 9); - void* var_11 = ConvLayer_PROMISE(var_10, 0.0, 0.6409912902116734, conv2d_12_w, -0.034618977, 0.05792674, conv2d_12_b, -0.4237576, 0.11035452, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.1027569955587349, 9); - void* var_12 = ConvLayer_PROMISE(var_11, 0.0, 1.1027569955587349, conv2d_13_w, -0.035480656, 0.058295887, conv2d_13_b, -0.21477045, 0.14263579, 1, 1, 1, 1, 0, 2, 1, 0.0, 2.4708798038959503, 9); - void* var_13 = FCLayer_PROMISE(var_12, 0.0, 2.4708798038959503, dense_1_w, -0.08929961, 0.11301676, dense_1_b, -0.20798548, 0.47405547, 1, 0.0, 2.8148007798194876, 9); - void* var_14 = FCLayer_PROMISE(var_13, 0.0, 2.8148007798194876, dense_2_w, -0.6627122, 0.35539475, dense_2_b, -1.0631907, 0.9830786, -1, -21.189617557525633, 22.645009384155276, 9); - void* var_15 = tensorSoftmax(var_14); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - // float accuracy = computeAccuracy2(labels, batch_size, var_15, 100); - float accuracy = computeTop5Accuracy(labels, batch_size, var_15, 100); - - final_accuracy += accuracy; - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - } - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar10_piped.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar10_piped.cc deleted file mode 100644 index 19c802dc88..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar10_piped.cc +++ /dev/null @@ -1,214 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 500; - int offset = 5000; - - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - - llvm_hpvm_initTensorRt(0); - - - std::string dir_prefix = std::string("../model_params/vgg16_cifar10/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,3,3); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,128,64,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,128,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_7_b_path = dir_prefix + std::string("conv2d_7_b.bin"); - void* conv2d_7_b = readTrainedWeights(conv2d_7_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,512,256,3,3); - std::string conv2d_8_b_path = dir_prefix + std::string("conv2d_8_b.bin"); - void* conv2d_8_b = readTrainedWeights(conv2d_8_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_9_b_path = dir_prefix + std::string("conv2d_9_b.bin"); - void* conv2d_9_b = readTrainedWeights(conv2d_9_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_10_b_path = dir_prefix + std::string("conv2d_10_b.bin"); - void* conv2d_10_b = readTrainedWeights(conv2d_10_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_11_b_path = dir_prefix + std::string("conv2d_11_b.bin"); - void* conv2d_11_b = readTrainedWeights(conv2d_11_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_12_b_path = dir_prefix + std::string("conv2d_12_b.bin"); - void* conv2d_12_b = readTrainedWeights(conv2d_12_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_13_b_path = dir_prefix + std::string("conv2d_13_b.bin"); - void* conv2d_13_b = readTrainedWeights(conv2d_13_b_path.c_str(), 0,1,512,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,512,512); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,512,1,1); - std::string dense_2_w_path = dir_prefix + std::string("dense_2_w.bin"); - void* dense_2_w = readTrainedWeights(dense_2_w_path.c_str(), 0,1,1,512,10); - std::string dense_2_b_path = dir_prefix + std::string("dense_2_b.bin"); - void* dense_2_b = readTrainedWeights(dense_2_b_path.c_str(), 0,1,10,1,1); - - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - // NOTE: Wait on signal from OpenTuner - stallOnOpenTunerSignal(); - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - for(int i = 0; i < batch_count; i++){ - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.8816367, 2.0934217, conv2d_1_w, -0.53275156, 0.49437004, conv2d_1_b, -0.6403629, 0.2490165, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.3590874671936035, 9); - void* var_1 = ConvLayer_PROMISE(var_0, 0.0, 1.3590874671936035, conv2d_2_w, -0.2688396, 0.20639156, conv2d_2_b, -0.7745511, 0.82006615, 1, 1, 1, 1, 0, 2, 1, 0.0, 2.521231179237361, 9); - void* var_2 = ConvLayer_PROMISE(var_1, 0.0, 2.521231179237361, conv2d_3_w, -0.16776876, 0.14878987, conv2d_3_b, -0.35283303, 0.5154362, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.2011985784769053, 9); - void* var_3 = ConvLayer_PROMISE(var_2, 0.0, 1.2011985784769053, conv2d_4_w, -0.088948585, 0.114222586, conv2d_4_b, -0.30250227, 0.36856708, 1, 1, 1, 1, 0, 2, 1, 0.0, 1.0359880930185312, 9); - void* var_4 = ConvLayer_PROMISE(var_3, 0.0, 1.0359880930185312, conv2d_5_w, -0.07739562, 0.10973293, conv2d_5_b, -0.15568458, 0.17634983, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.3004955950379369, 9); - void* var_5 = ConvLayer_PROMISE(var_4, 0.0, 0.3004955950379369, conv2d_6_w, -0.051649556, 0.05435231, conv2d_6_b, -0.07395447, 0.07996062, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.11490475405007583, 9); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 0.11490475405007583, conv2d_7_w, -0.043513633, 0.07577866, conv2d_7_b, -0.06921874, 0.02660573, 1, 1, 1, 1, 0, 2, 1, 0.0, 0.16232508487999475, 9); - void* var_7 = ConvLayer_PROMISE(var_6, 0.0, 0.16232508487999475, conv2d_8_w, -0.033842053, 0.045218028, conv2d_8_b, -0.022827804, 0.023845317, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.12424996573477909, 9); - void* var_8 = ConvLayer_PROMISE(var_7, 0.0, 0.12424996573477909, conv2d_9_w, -0.02211613, 0.032084666, conv2d_9_b, -0.02699063, 0.03773564, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.1746344865113496, 9); - void* var_9 = ConvLayer_PROMISE(var_8, 0.0, 0.1746344865113496, conv2d_10_w, -0.01979376, 0.034854397, conv2d_10_b, -0.036107242, 0.07056531, 1, 1, 1, 1, 0, 2, 1, 0.0, 0.5751757621765137, 9); - void* var_10 = ConvLayer_PROMISE(var_9, 0.0, 0.5751757621765137, conv2d_11_w, -0.03452098, 0.046055835, conv2d_11_b, -0.051925894, 0.07039055, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.7718751144409115, 9); - void* var_11 = ConvLayer_PROMISE(var_10, 0.0, 0.7718751144409115, conv2d_12_w, -0.025946895, 0.040090334, conv2d_12_b, -0.06049362, 0.12658806, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.1728516906499844, 9); - void* var_12 = ConvLayer_PROMISE(var_11, 0.0, 1.1728516906499844, conv2d_13_w, -0.021766115, 0.03315237, conv2d_13_b, -0.20705001, 0.117947325, 1, 1, 1, 1, 0, 2, 1, 0.0, 2.0015769386291495, 9); - void* var_13 = FCLayer_PROMISE(var_12, 0.0, 2.0015769386291495, dense_1_w, -0.042597745, 0.046707444, dense_1_b, -0.21937433, 0.2545502, 1, 0.0, 2.002361118793486, 9); - void* var_14 = FCLayer_PROMISE(var_13, 0.0, 2.002361118793486, dense_2_w, -0.32550547, 0.30829763, dense_2_b, -1.1787822, 1.2378151, -1, -18.251470546722413, 24.17363445281988, 9); - void* var_15 = tensorSoftmax(var_14); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_15); - final_accuracy += accuracy; - - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_15, classConfs, predictedLabels, relative_start, relative_end); - } - - - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - // NOTE: Signal back to OpenTuner - signalPipeToOpenTuner(); - } - - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar10_promise.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar10_promise.cc deleted file mode 100644 index 754429a3d5..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_cifar10_promise.cc +++ /dev/null @@ -1,208 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - -int main(int argc, char* argv[]){ - - int test_input_size = 5000; - int batch_size = 500; - int offset = 5000; - - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - bool shouldDumpClassConf = false; - float* classConfs; - int* predictedLabels; - if(argc > 7){ - shouldDumpClassConf = true; - classConfs = (float*) malloc(sizeof(float) * test_input_size); - predictedLabels = (int*) malloc(sizeof(int) * test_input_size); - } - - - - llvm_hpvm_initTensorRt(0); - - int missed = 0; - for (int i = 0 ; i < total_runs; i++){ - - if (missed >= to_skip){ - break; - } - - startMemTracking(); - - - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - std::string dir_prefix = std::string("../model_params/vgg16_cifar10/"); - std::string input_path = dir_prefix + std::string("input.bin"); - std::string labels_path = dir_prefix + std::string("labels.bin"); - std::string labels32_path = dir_prefix + std::string("labels32.bin"); - - for(int i = 0; i < batch_count; i++){ - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,3,3); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,128,64,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,128,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_7_b_path = dir_prefix + std::string("conv2d_7_b.bin"); - void* conv2d_7_b = readTrainedWeights(conv2d_7_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,512,256,3,3); - std::string conv2d_8_b_path = dir_prefix + std::string("conv2d_8_b.bin"); - void* conv2d_8_b = readTrainedWeights(conv2d_8_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_9_b_path = dir_prefix + std::string("conv2d_9_b.bin"); - void* conv2d_9_b = readTrainedWeights(conv2d_9_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_10_b_path = dir_prefix + std::string("conv2d_10_b.bin"); - void* conv2d_10_b = readTrainedWeights(conv2d_10_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_11_b_path = dir_prefix + std::string("conv2d_11_b.bin"); - void* conv2d_11_b = readTrainedWeights(conv2d_11_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_12_b_path = dir_prefix + std::string("conv2d_12_b.bin"); - void* conv2d_12_b = readTrainedWeights(conv2d_12_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_13_b_path = dir_prefix + std::string("conv2d_13_b.bin"); - void* conv2d_13_b = readTrainedWeights(conv2d_13_b_path.c_str(), 0,1,512,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,512,512); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,512,1,1); - std::string dense_2_w_path = dir_prefix + std::string("dense_2_w.bin"); - void* dense_2_w = readTrainedWeights(dense_2_w_path.c_str(), 0,1,1,512,10); - std::string dense_2_b_path = dir_prefix + std::string("dense_2_b.bin"); - void* dense_2_b = readTrainedWeights(dense_2_b_path.c_str(), 0,1,10,1,1); - - - int start = i * batch_size + offset; - int end = (i + 1) * batch_size + offset; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,32,32); - - void* var_0 = ConvLayer_PROMISE(input, -1.8816367, 2.0934217, conv2d_1_w, -0.53275156, 0.49437004, conv2d_1_b, -0.6403629, 0.2490165, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.3590874671936035, 9); - void* var_1 = ConvLayer_PROMISE(var_0, 0.0, 1.3590874671936035, conv2d_2_w, -0.2688396, 0.20639156, conv2d_2_b, -0.7745511, 0.82006615, 1, 1, 1, 1, 0, 2, 1, 0.0, 2.521231179237361, 9); - void* var_2 = ConvLayer_PROMISE(var_1, 0.0, 2.521231179237361, conv2d_3_w, -0.16776876, 0.14878987, conv2d_3_b, -0.35283303, 0.5154362, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.2011985784769053, 9); - void* var_3 = ConvLayer_PROMISE(var_2, 0.0, 1.2011985784769053, conv2d_4_w, -0.088948585, 0.114222586, conv2d_4_b, -0.30250227, 0.36856708, 1, 1, 1, 1, 0, 2, 1, 0.0, 1.0359880930185312, 9); - void* var_4 = ConvLayer_PROMISE(var_3, 0.0, 1.0359880930185312, conv2d_5_w, -0.07739562, 0.10973293, conv2d_5_b, -0.15568458, 0.17634983, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.3004955950379369, 9); - void* var_5 = ConvLayer_PROMISE(var_4, 0.0, 0.3004955950379369, conv2d_6_w, -0.051649556, 0.05435231, conv2d_6_b, -0.07395447, 0.07996062, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.11490475405007583, 9); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 0.11490475405007583, conv2d_7_w, -0.043513633, 0.07577866, conv2d_7_b, -0.06921874, 0.02660573, 1, 1, 1, 1, 0, 2, 1, 0.0, 0.16232508487999475, 9); - void* var_7 = ConvLayer_PROMISE(var_6, 0.0, 0.16232508487999475, conv2d_8_w, -0.033842053, 0.045218028, conv2d_8_b, -0.022827804, 0.023845317, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.12424996573477909, 9); - void* var_8 = ConvLayer_PROMISE(var_7, 0.0, 0.12424996573477909, conv2d_9_w, -0.02211613, 0.032084666, conv2d_9_b, -0.02699063, 0.03773564, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.1746344865113496, 9); - void* var_9 = ConvLayer_PROMISE(var_8, 0.0, 0.1746344865113496, conv2d_10_w, -0.01979376, 0.034854397, conv2d_10_b, -0.036107242, 0.07056531, 1, 1, 1, 1, 0, 2, 1, 0.0, 0.5751757621765137, 9); - void* var_10 = ConvLayer_PROMISE(var_9, 0.0, 0.5751757621765137, conv2d_11_w, -0.03452098, 0.046055835, conv2d_11_b, -0.051925894, 0.07039055, 1, 1, 1, 1, -1, 0, 1, 0.0, 0.7718751144409115, 9); - void* var_11 = ConvLayer_PROMISE(var_10, 0.0, 0.7718751144409115, conv2d_12_w, -0.025946895, 0.040090334, conv2d_12_b, -0.06049362, 0.12658806, 1, 1, 1, 1, -1, 0, 1, 0.0, 1.1728516906499844, 9); - void* var_12 = ConvLayer_PROMISE(var_11, 0.0, 1.1728516906499844, conv2d_13_w, -0.021766115, 0.03315237, conv2d_13_b, -0.20705001, 0.117947325, 1, 1, 1, 1, 0, 2, 1, 0.0, 2.0015769386291495, 9); - void* var_13 = FCLayer_PROMISE(var_12, 0.0, 2.0015769386291495, dense_1_w, -0.042597745, 0.046707444, dense_1_b, -0.21937433, 0.2545502, 1, 0.0, 2.002361118793486, 9); - void* var_14 = FCLayer_PROMISE(var_13, 0.0, 2.002361118793486, dense_2_w, -0.32550547, 0.30829763, dense_2_b, -1.1787822, 1.2378151, -1, -18.251470546722413, 24.17363445281988, 9); - void* var_15 = tensorSoftmax(var_14); - - uint8_t* labels = readLabelsBatch(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy2(labels, batch_size, var_15); - final_accuracy += accuracy; - - - if(shouldDumpClassConf){ - int relative_start = start - offset; - int relative_end = end - offset; - copyClassConfsAndLabels(var_15, classConfs, predictedLabels, relative_start, relative_end); - } - - - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - - if (final_accuracy < bench_acc) - missed += 1; - - - if(shouldDumpClassConf){ - int labels_start = offset; - int labels_end = offset + test_input_size; - uint32_t* goldLabels = readLabelsBatch3(labels32_path.c_str(), labels_start, labels_end); - dumpClassConfsAndLabels(classConfs, predictedLabels, goldLabels, test_input_size); - } - - } - - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; - -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_imagenet_piped.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_imagenet_piped.cc deleted file mode 100644 index 99ee36b6eb..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_imagenet_piped.cc +++ /dev/null @@ -1,186 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - - -int main(int argc, char* argv[]){ - - llvm_hpvm_initTensorRt(0); - - int total_runs = 1; - int offset = 0; - - int test_input_size = 2000; - int batch_size = 20; - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - - - std::string dir_prefix = std::string("/shared/hsharif3/vgg16_imagenet_1/"); - std::string input_path = dir_prefix + std::string("test_input_combined.bin"); - std::string labels_path = dir_prefix + std::string("test_labels_combined.bin"); - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,3,3); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,128,64,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,128,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_7_b_path = dir_prefix + std::string("conv2d_7_b.bin"); - void* conv2d_7_b = readTrainedWeights(conv2d_7_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,512,256,3,3); - std::string conv2d_8_b_path = dir_prefix + std::string("conv2d_8_b.bin"); - void* conv2d_8_b = readTrainedWeights(conv2d_8_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_9_b_path = dir_prefix + std::string("conv2d_9_b.bin"); - void* conv2d_9_b = readTrainedWeights(conv2d_9_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_10_b_path = dir_prefix + std::string("conv2d_10_b.bin"); - void* conv2d_10_b = readTrainedWeights(conv2d_10_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_11_b_path = dir_prefix + std::string("conv2d_11_b.bin"); - void* conv2d_11_b = readTrainedWeights(conv2d_11_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_12_b_path = dir_prefix + std::string("conv2d_12_b.bin"); - void* conv2d_12_b = readTrainedWeights(conv2d_12_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_13_b_path = dir_prefix + std::string("conv2d_13_b.bin"); - void* conv2d_13_b = readTrainedWeights(conv2d_13_b_path.c_str(), 0,1,512,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,25088,4096); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,4096,1,1); - std::string dense_2_w_path = dir_prefix + std::string("dense_2_w.bin"); - void* dense_2_w = readTrainedWeights(dense_2_w_path.c_str(), 0,1,1,4096,4096); - std::string dense_2_b_path = dir_prefix + std::string("dense_2_b.bin"); - void* dense_2_b = readTrainedWeights(dense_2_b_path.c_str(), 0,1,4096,1,1); - std::string dense_3_w_path = dir_prefix + std::string("dense_3_w.bin"); - void* dense_3_w = readTrainedWeights(dense_3_w_path.c_str(), 0,1,1,4096,1000); - std::string dense_3_b_path = dir_prefix + std::string("dense_3_b.bin"); - void* dense_3_b = readTrainedWeights(dense_3_b_path.c_str(), 0,1,1000,1,1); - - - for (int i = 0 ; i < total_runs; i++){ - - // NOTE: Wait on signal from OpenTuner - stallOnOpenTunerSignal(); - - startMemTracking(); - - - for(int i = 0; i < batch_count; i++){ - - int start = i * batch_size; - int end = (i + 1) * batch_size; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,224,224); - - void* var_0 = ConvLayer_PROMISE(input, -123.68, 151.061, conv2d_1_w, -0.5682651399970055, 0.5677501424551024, conv2d_1_b, -0.015828926, 2.064037, 1, 1, 1, 1, -1, 0, 1, 0.0, 407.96143194580145, 9); - void* var_1 = ConvLayer_PROMISE(var_0, 0.0, 407.96143194580145, conv2d_2_w, -0.13156980648636818, 0.2164201746285022, conv2d_2_b, -1.0271513, 0.9052184, 1, 1, 1, 1, 0, 2, 1, 0.0, 1973.2054975586288, 9); - void* var_2 = ConvLayer_PROMISE(var_1, 0.0, 1973.2054975586288, conv2d_3_w, -0.18644111251831055, 0.202149114727974, conv2d_3_b, -0.17922063, 0.36547425, 1, 1, 1, 1, -1, 0, 1, 0.0, 2386.9648486329534, 9); - void* var_3 = ConvLayer_PROMISE(var_2, 0.0, 2386.9648486329534, conv2d_4_w, -0.10804861642420292, 0.12427636455744764, conv2d_4_b, -0.59533477, 0.63375777, 1, 1, 1, 1, 0, 2, 1, 0.0, 4998.494643554761, 9); - void* var_4 = ConvLayer_PROMISE(var_3, 0.0, 4998.494643554761, conv2d_5_w, -0.08040237371623515, 0.09835810117424044, conv2d_5_b, -0.20097896, 0.34949613, 1, 1, 1, 1, -1, 0, 1, 0.0, 4637.92161425807, 9); - void* var_5 = ConvLayer_PROMISE(var_4, 0.0, 4637.92161425807, conv2d_6_w, -0.05306418750435114, 0.06628044287860436, conv2d_6_b, -0.18124875, 0.274845, 1, 1, 1, 1, -1, 0, 1, 0.0, 4365.822572754019, 9); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 4365.822572754019, conv2d_7_w, -0.05084674355760217, 0.07320860563218634, conv2d_7_b, -0.14288792, 0.59477174, 1, 1, 1, 1, 0, 2, 1, 0.0, 5600.749117676456, 9); - void* var_7 = ConvLayer_PROMISE(var_6, 0.0, 5600.749117676456, conv2d_8_w, -0.04523278899490833, 0.053042236261070186, conv2d_8_b, -0.14548235, 0.3148451, 1, 1, 1, 1, -1, 0, 1, 0.0, 3240.830364746551, 9); - void* var_8 = ConvLayer_PROMISE(var_7, 0.0, 3240.830364746551, conv2d_9_w, -0.02917514201253653, 0.03586270406842279, conv2d_9_b, -0.08428453, 0.18237582, 1, 1, 1, 1, -1, 0, 1, 0.0, 1895.9044943847766, 9); - void* var_9 = ConvLayer_PROMISE(var_8, 0.0, 1895.9044943847766, conv2d_10_w, -0.029496615380048753, 0.04047201693058028, conv2d_10_b, -0.19835947, 0.33766547, 1, 1, 1, 1, 0, 2, 1, 0.0, 1273.674801757832, 9); - void* var_10 = ConvLayer_PROMISE(var_9, 0.0, 1273.674801757832, conv2d_11_w, -0.031951379626989365, 0.04218719156458998, conv2d_11_b, -0.3508028, 0.6397485, 1, 1, 1, 1, -1, 0, 1, 0.0, 652.76720800782, 9); - void* var_11 = ConvLayer_PROMISE(var_10, 0.0, 652.76720800782, conv2d_12_w, -0.028522676015272738, 0.03794213477522136, conv2d_12_b, -0.9171057, 0.7597668, 1, 1, 1, 1, -1, 0, 1, 0.0, 316.98977236938646, 9); - void* var_12 = ConvLayer_PROMISE(var_11, 0.0, 316.98977236938646, conv2d_13_w, -0.02821479567326605, 0.03854479804635069, conv2d_13_b, -0.50036746, 9.431553, 1, 1, 1, 1, 0, 2, 1, 0.0, 148.72470889282292, 9); - void* var_13 = FCLayer_PROMISE(var_12, 0.0, 148.72470889282292, dense_1_w, -0.007091613108757884, 0.008147951829247227, dense_1_b, -0.78005254, 0.8555075, 1, 0.0, 40.64329356002882, 9); - void* var_14 = FCLayer_PROMISE(var_13, 0.0, 40.64329356002882, dense_2_w, -0.012781758182682096, 0.01437051862943929, dense_2_b, -0.012339931, 1.2154555, 1, 0.0, 11.167800696373025, 9); - void* var_15 = FCLayer_PROMISE(var_14, 0.0, 11.167800696373025, dense_3_w, -0.02119149128906429, 0.02715564412623694, dense_3_b, -0.773357, 0.6615543, -1, -7.4482048592567445, 17.882177452087543, 9); - void* var_16 = tensorSoftmax(var_15); - - uint32_t* labels = readLabelsBatch3(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy3(labels, var_16); - final_accuracy += accuracy; - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - // NOTE: Signal back to OpenTuner - - signalPipeToOpenTuner(); - - } - - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; -} diff --git a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_imagenet_promise.cc b/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_imagenet_promise.cc deleted file mode 100644 index 69d47078f3..0000000000 --- a/hpvm/projects/hpvm-tensor-rt/dnn_sources/src/promise/vgg16_imagenet_promise.cc +++ /dev/null @@ -1,179 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include "tensor_runtime.h" -#include "utils.h" - - - -int total_runs = 1; -float bench_acc = 0; -int to_skip = 5; - - - -int main(int argc, char* argv[]){ - - llvm_hpvm_initTensorRt(1); - - int total_runs = 1; - int offset = 0; - - int test_input_size = 2000; - int batch_size = 20; - int batch_count = test_input_size / batch_size; - float final_accuracy = 0.0; - - - if (argc > 1){ - total_runs = atoi(argv[1]); - } - - if (argc > 2){ - bench_acc = atof(argv[2]); - } - - if(argc > 3){ - to_skip = atoi(argv[3]); - } - - if(argc > 4){ - test_input_size = atoi(argv[4]); - } - - if(argc > 5){ - offset = atoi(argv[5]); - } - - if(argc > 6){ - batch_size = atoi(argv[6]); - } - - - - - std::string dir_prefix = std::string("/shared/hsharif3/vgg16_imagenet_1/"); - std::string input_path = dir_prefix + std::string("test_input_combined.bin"); - std::string labels_path = dir_prefix + std::string("test_labels_combined.bin"); - - std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); - void* conv2d_1_w = readTrainedWeights(conv2d_1_w_path.c_str(), 0,64,3,3,3); - std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); - void* conv2d_1_b = readTrainedWeights(conv2d_1_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); - void* conv2d_2_w = readTrainedWeights(conv2d_2_w_path.c_str(), 0,64,64,3,3); - std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); - void* conv2d_2_b = readTrainedWeights(conv2d_2_b_path.c_str(), 0,1,64,1,1); - std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); - void* conv2d_3_w = readTrainedWeights(conv2d_3_w_path.c_str(), 0,128,64,3,3); - std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); - void* conv2d_3_b = readTrainedWeights(conv2d_3_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); - void* conv2d_4_w = readTrainedWeights(conv2d_4_w_path.c_str(), 0,128,128,3,3); - std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); - void* conv2d_4_b = readTrainedWeights(conv2d_4_b_path.c_str(), 0,1,128,1,1); - std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); - void* conv2d_5_w = readTrainedWeights(conv2d_5_w_path.c_str(), 0,256,128,3,3); - std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); - void* conv2d_5_b = readTrainedWeights(conv2d_5_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_6_w_path = dir_prefix + std::string("conv2d_6_w.bin"); - void* conv2d_6_w = readTrainedWeights(conv2d_6_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_6_b_path = dir_prefix + std::string("conv2d_6_b.bin"); - void* conv2d_6_b = readTrainedWeights(conv2d_6_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_7_w_path = dir_prefix + std::string("conv2d_7_w.bin"); - void* conv2d_7_w = readTrainedWeights(conv2d_7_w_path.c_str(), 0,256,256,3,3); - std::string conv2d_7_b_path = dir_prefix + std::string("conv2d_7_b.bin"); - void* conv2d_7_b = readTrainedWeights(conv2d_7_b_path.c_str(), 0,1,256,1,1); - std::string conv2d_8_w_path = dir_prefix + std::string("conv2d_8_w.bin"); - void* conv2d_8_w = readTrainedWeights(conv2d_8_w_path.c_str(), 0,512,256,3,3); - std::string conv2d_8_b_path = dir_prefix + std::string("conv2d_8_b.bin"); - void* conv2d_8_b = readTrainedWeights(conv2d_8_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_9_w_path = dir_prefix + std::string("conv2d_9_w.bin"); - void* conv2d_9_w = readTrainedWeights(conv2d_9_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_9_b_path = dir_prefix + std::string("conv2d_9_b.bin"); - void* conv2d_9_b = readTrainedWeights(conv2d_9_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_10_w_path = dir_prefix + std::string("conv2d_10_w.bin"); - void* conv2d_10_w = readTrainedWeights(conv2d_10_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_10_b_path = dir_prefix + std::string("conv2d_10_b.bin"); - void* conv2d_10_b = readTrainedWeights(conv2d_10_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_11_w_path = dir_prefix + std::string("conv2d_11_w.bin"); - void* conv2d_11_w = readTrainedWeights(conv2d_11_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_11_b_path = dir_prefix + std::string("conv2d_11_b.bin"); - void* conv2d_11_b = readTrainedWeights(conv2d_11_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_12_w_path = dir_prefix + std::string("conv2d_12_w.bin"); - void* conv2d_12_w = readTrainedWeights(conv2d_12_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_12_b_path = dir_prefix + std::string("conv2d_12_b.bin"); - void* conv2d_12_b = readTrainedWeights(conv2d_12_b_path.c_str(), 0,1,512,1,1); - std::string conv2d_13_w_path = dir_prefix + std::string("conv2d_13_w.bin"); - void* conv2d_13_w = readTrainedWeights(conv2d_13_w_path.c_str(), 0,512,512,3,3); - std::string conv2d_13_b_path = dir_prefix + std::string("conv2d_13_b.bin"); - void* conv2d_13_b = readTrainedWeights(conv2d_13_b_path.c_str(), 0,1,512,1,1); - std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); - void* dense_1_w = readTrainedWeights(dense_1_w_path.c_str(), 0,1,1,25088,4096); - std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); - void* dense_1_b = readTrainedWeights(dense_1_b_path.c_str(), 0,1,4096,1,1); - std::string dense_2_w_path = dir_prefix + std::string("dense_2_w.bin"); - void* dense_2_w = readTrainedWeights(dense_2_w_path.c_str(), 0,1,1,4096,4096); - std::string dense_2_b_path = dir_prefix + std::string("dense_2_b.bin"); - void* dense_2_b = readTrainedWeights(dense_2_b_path.c_str(), 0,1,4096,1,1); - std::string dense_3_w_path = dir_prefix + std::string("dense_3_w.bin"); - void* dense_3_w = readTrainedWeights(dense_3_w_path.c_str(), 0,1,1,4096,1000); - std::string dense_3_b_path = dir_prefix + std::string("dense_3_b.bin"); - void* dense_3_b = readTrainedWeights(dense_3_b_path.c_str(), 0,1,1000,1,1); - - - for (int i = 0 ; i < total_runs; i++){ - - startMemTracking(); - - for(int i = 0; i < batch_count; i++){ - - int start = i * batch_size; - int end = (i + 1) * batch_size; - - void* input = readInputBatch(input_path.c_str(),0,start,end,3,224,224); - - void* var_0 = ConvLayer_PROMISE(input, -123.68, 151.061, conv2d_1_w, -0.5682651399970055, 0.5677501424551024, conv2d_1_b, -0.015828926, 2.064037, 1, 1, 1, 1, -1, 0, 1, 0.0, 407.96143194580145, 9); - void* var_1 = ConvLayer_PROMISE(var_0, 0.0, 407.96143194580145, conv2d_2_w, -0.13156980648636818, 0.2164201746285022, conv2d_2_b, -1.0271513, 0.9052184, 1, 1, 1, 1, 0, 2, 1, 0.0, 1973.2054975586288, 9); - void* var_2 = ConvLayer_PROMISE(var_1, 0.0, 1973.2054975586288, conv2d_3_w, -0.18644111251831055, 0.202149114727974, conv2d_3_b, -0.17922063, 0.36547425, 1, 1, 1, 1, -1, 0, 1, 0.0, 2386.9648486329534, 9); - void* var_3 = ConvLayer_PROMISE(var_2, 0.0, 2386.9648486329534, conv2d_4_w, -0.10804861642420292, 0.12427636455744764, conv2d_4_b, -0.59533477, 0.63375777, 1, 1, 1, 1, 0, 2, 1, 0.0, 4998.494643554761, 9); - void* var_4 = ConvLayer_PROMISE(var_3, 0.0, 4998.494643554761, conv2d_5_w, -0.08040237371623515, 0.09835810117424044, conv2d_5_b, -0.20097896, 0.34949613, 1, 1, 1, 1, -1, 0, 1, 0.0, 4637.92161425807, 9); - void* var_5 = ConvLayer_PROMISE(var_4, 0.0, 4637.92161425807, conv2d_6_w, -0.05306418750435114, 0.06628044287860436, conv2d_6_b, -0.18124875, 0.274845, 1, 1, 1, 1, -1, 0, 1, 0.0, 4365.822572754019, 9); - void* var_6 = ConvLayer_PROMISE(var_5, 0.0, 4365.822572754019, conv2d_7_w, -0.05084674355760217, 0.07320860563218634, conv2d_7_b, -0.14288792, 0.59477174, 1, 1, 1, 1, 0, 2, 1, 0.0, 5600.749117676456, 9); - void* var_7 = ConvLayer_PROMISE(var_6, 0.0, 5600.749117676456, conv2d_8_w, -0.04523278899490833, 0.053042236261070186, conv2d_8_b, -0.14548235, 0.3148451, 1, 1, 1, 1, -1, 0, 1, 0.0, 3240.830364746551, 9); - void* var_8 = ConvLayer_PROMISE(var_7, 0.0, 3240.830364746551, conv2d_9_w, -0.02917514201253653, 0.03586270406842279, conv2d_9_b, -0.08428453, 0.18237582, 1, 1, 1, 1, -1, 0, 1, 0.0, 1895.9044943847766, 9); - void* var_9 = ConvLayer_PROMISE(var_8, 0.0, 1895.9044943847766, conv2d_10_w, -0.029496615380048753, 0.04047201693058028, conv2d_10_b, -0.19835947, 0.33766547, 1, 1, 1, 1, 0, 2, 1, 0.0, 1273.674801757832, 9); - void* var_10 = ConvLayer_PROMISE(var_9, 0.0, 1273.674801757832, conv2d_11_w, -0.031951379626989365, 0.04218719156458998, conv2d_11_b, -0.3508028, 0.6397485, 1, 1, 1, 1, -1, 0, 1, 0.0, 652.76720800782, 9); - void* var_11 = ConvLayer_PROMISE(var_10, 0.0, 652.76720800782, conv2d_12_w, -0.028522676015272738, 0.03794213477522136, conv2d_12_b, -0.9171057, 0.7597668, 1, 1, 1, 1, -1, 0, 1, 0.0, 316.98977236938646, 9); - void* var_12 = ConvLayer_PROMISE(var_11, 0.0, 316.98977236938646, conv2d_13_w, -0.02821479567326605, 0.03854479804635069, conv2d_13_b, -0.50036746, 9.431553, 1, 1, 1, 1, 0, 2, 1, 0.0, 148.72470889282292, 9); - void* var_13 = FCLayer_PROMISE(var_12, 0.0, 148.72470889282292, dense_1_w, -0.007091613108757884, 0.008147951829247227, dense_1_b, -0.78005254, 0.8555075, 1, 0.0, 40.64329356002882, 9); - - void* var_14 = FCLayer_PROMISE(var_13, 0.0, 40.64329356002882, dense_2_w, -0.012781758182682096, 0.01437051862943929, dense_2_b, -0.012339931, 1.2154555, 1, 0.0, 11.167800696373025, 9); - void* var_15 = FCLayer_PROMISE(var_14, 0.0, 11.167800696373025, dense_3_w, -0.02119149128906429, 0.02715564412623694, dense_3_b, -0.773357, 0.6615543, -1, -7.4482048592567445, 17.882177452087543, 9); - void* var_16 = tensorSoftmax(var_15); - - uint32_t* labels = readLabelsBatch3(labels_path.c_str(),start,end); - - float accuracy = computeAccuracy3(labels, var_16); - final_accuracy += accuracy; - freeBatchMemory(); - - } - - final_accuracy = final_accuracy / batch_count; - dumpFinalAccuracy(final_accuracy); - - } - - - dumpExecutionAccuracies(); - - llvm_hpvm_cleanupTensorRt(); - - return 0; -} -- GitLab