From 1c8c6de48af5e2c42fdab819f1bb7c9f67babb68 Mon Sep 17 00:00:00 2001 From: Kiriti Gowda Date: Mon, 3 Jun 2024 16:02:37 -0700 Subject: [PATCH] NNEF - Use V1.0.0 Branch (#1370) * NNEF - Use V1.0.0 Branch * Numpy - Version update * Setup - Fix * NN Test - Fix * Setup - Fix Numpy for RPM * Numpy - for RPM * Test - Fix NN for RPM --- MIVisionX-setup.py | 8 +- docker/mivisionx-on-ubuntu20.dockerfile | 2 +- docker/ubuntu20/level-5.dockerfile | 2 +- docker/ubuntu22/level-5.dockerfile | 2 +- docs/install/model-compiler-install.rst | 5 +- model_compiler/README.md | 5 +- .../runNeuralNetworkTests.py | 217 +++++++++++------- 7 files changed, 141 insertions(+), 100 deletions(-) diff --git a/MIVisionX-setup.py b/MIVisionX-setup.py index cd11c7493..5555ee180 100644 --- a/MIVisionX-setup.py +++ b/MIVisionX-setup.py @@ -255,7 +255,7 @@ def ERROR_CHECK(call): pip3InferencePackagesUbuntu = [ 'future==0.18.2', 'pytz==2022.1', - 'numpy==1.21', + 'numpy==1.22', 'google==3.0.0', 'protobuf==3.12.4', 'onnx==1.12.0' @@ -264,7 +264,7 @@ def ERROR_CHECK(call): pip3InferencePackagesSLES = [ 'future==0.18.2', 'pytz==2022.1', - 'numpy==1.19', + 'numpy==1.23.0', 'google==3.0.0', 'protobuf==3.12.4', 'onnx==1.11.0' @@ -422,9 +422,9 @@ def ERROR_CHECK(call): # Install NNEF Deps ERROR_CHECK(os.system('mkdir -p '+modelCompilerDeps+'/nnef-deps')) ERROR_CHECK(os.system( - '(cd '+modelCompilerDeps+'/nnef-deps; git clone https://github.com/KhronosGroup/NNEF-Tools.git)')) + '(cd '+modelCompilerDeps+'/nnef-deps; git clone -b nnef-v1.0.0 https://github.com/KhronosGroup/NNEF-Tools.git)')) ERROR_CHECK(os.system( - '(cd '+modelCompilerDeps+'/nnef-deps/NNEF-Tools/parser/cpp; mkdir -p build && cd build; '+linuxCMake+' ..; make -j$(nproc))')) + '(cd '+modelCompilerDeps+'/nnef-deps/NNEF-Tools/parser/cpp; mkdir -p build && cd build; '+linuxCMake+' ..; make -j$(nproc); sudo make install)')) ERROR_CHECK(os.system( '(cd '+modelCompilerDeps+'/nnef-deps/NNEF-Tools/parser/python; sudo python3 setup.py install)')) else: diff --git a/docker/mivisionx-on-ubuntu20.dockerfile b/docker/mivisionx-on-ubuntu20.dockerfile index 12382ac3f..e12da4920 100644 --- a/docker/mivisionx-on-ubuntu20.dockerfile +++ b/docker/mivisionx-on-ubuntu20.dockerfile @@ -41,7 +41,7 @@ ENV CUPY_INSTALL_USE_HIP=1 ENV ROCM_HOME=/opt/rocm RUN DEBIAN_FRONTEND=noninteractive apt-get -y install git g++ hipblas hipsparse rocrand hipfft rocfft rocthrust-dev hipcub-dev python3 python3-pip python3-dev && \ git clone -b v12.2.0 https://github.com/ROCmSoftwarePlatform/cupy.git && \ - git submodule update --init && pip install -e . --no-cache-dir -vvvv && pip install numpy==1.21 && cd + git submodule update --init && pip install -e . --no-cache-dir -vvvv && pip install numpy==1.22 && cd ENV MIVISIONX_WORKSPACE=/workspace WORKDIR $MIVISIONX_WORKSPACE diff --git a/docker/ubuntu20/level-5.dockerfile b/docker/ubuntu20/level-5.dockerfile index c7ec602bf..bc1b461f1 100644 --- a/docker/ubuntu20/level-5.dockerfile +++ b/docker/ubuntu20/level-5.dockerfile @@ -48,7 +48,7 @@ ENV CUPY_INSTALL_USE_HIP=1 ENV ROCM_HOME=/opt/rocm RUN DEBIAN_FRONTEND=noninteractive apt-get -y install git g++ hipblas hipsparse rocrand hipfft rocfft rocthrust-dev hipcub-dev python3 python3-pip python3-dev && \ git clone -b v12.2.0 https://github.com/ROCmSoftwarePlatform/cupy.git && \ - git submodule update --init && pip install -e . --no-cache-dir -vvvv && pip install numpy==1.21 && cd + git submodule update --init && pip install -e . --no-cache-dir -vvvv && pip install numpy==1.22 && cd ENV MIVISIONX_WORKSPACE=/workspace WORKDIR $MIVISIONX_WORKSPACE diff --git a/docker/ubuntu22/level-5.dockerfile b/docker/ubuntu22/level-5.dockerfile index 9ece61483..1a1bf7dc2 100644 --- a/docker/ubuntu22/level-5.dockerfile +++ b/docker/ubuntu22/level-5.dockerfile @@ -55,7 +55,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install git g++ hipblas hipsparse pip install pytest==3.1 && git clone -b v2.10.4 https://github.com/pybind/pybind11 && cd pybind11 && mkdir build && cd build && \ cmake -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON ../ && make -j4 && sudo make install && cd ../../ && \ git clone -b v12.2.0 https://github.com/ROCmSoftwarePlatform/cupy.git && cd cupy && git submodule update --init && \ - pip install -e . --no-cache-dir -vvvv && pip install numpy==1.21 + pip install -e . --no-cache-dir -vvvv && pip install numpy==1.22 ENV MIVISIONX_WORKSPACE=/workspace WORKDIR $MIVISIONX_WORKSPACE diff --git a/docs/install/model-compiler-install.rst b/docs/install/model-compiler-install.rst index 57e693bd4..2ea518d24 100644 --- a/docs/install/model-compiler-install.rst +++ b/docs/install/model-compiler-install.rst @@ -40,7 +40,7 @@ Prerequisites .. code-block:: shell - sudo pip3 install future==0.18.2 pytz==2022.1 numpy==1.21 + sudo pip3 install future==0.18.2 pytz==2022.1 numpy==1.22 .. note:: @@ -85,11 +85,12 @@ NNEF .. code-block:: shell - git clone https://github.com/KhronosGroup/NNEF-Tools.git + git clone -b nnef-v1.0.0 https://github.com/KhronosGroup/NNEF-Tools.git cd NNEF-Tools/parser/cpp mkdir -p build && cd build cmake ../ make + sudo make install cd ../../../python sudo python3 setup.py install diff --git a/model_compiler/README.md b/model_compiler/README.md index e169cf8be..6ed73e05c 100644 --- a/model_compiler/README.md +++ b/model_compiler/README.md @@ -54,7 +54,7 @@ MIVisionX allows hundreds of different [OpenVX](https://www.khronos.org/registry ``` * PIP3 Packages ``` - sudo pip3 install future==0.18.2 pytz==2022.1 numpy==1.21 + sudo pip3 install future==0.18.2 pytz==2022.1 numpy==1.22 ``` **Note:** MIVisionX installs model compiler scripts at `/opt/rocm/libexec/mivisionx/model_compiler/python/` @@ -81,11 +81,12 @@ sudo pip3 install protobuf==3.12.4 onnx==1.12.0 * [nnef-parser](https://github.com/KhronosGroup/NNEF-Tools) - Build the nnef python module ``` -git clone https://github.com/KhronosGroup/NNEF-Tools.git +git clone -b nnef-v1.0.0 https://github.com/KhronosGroup/NNEF-Tools.git cd NNEF-Tools/parser/cpp mkdir -p build && cd build cmake ../ make +sudo make install cd ../../../python sudo python3 setup.py install ``` diff --git a/tests/neural_network_tests/runNeuralNetworkTests.py b/tests/neural_network_tests/runNeuralNetworkTests.py index 88a1d70ca..c5d35ea8f 100644 --- a/tests/neural_network_tests/runNeuralNetworkTests.py +++ b/tests/neural_network_tests/runNeuralNetworkTests.py @@ -18,26 +18,32 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -from datetime import datetime -from subprocess import Popen, PIPE import argparse import os import shutil import sys +import traceback import platform +if sys.version_info[0] < 3: + import commands +else: + import subprocess +from datetime import datetime +from subprocess import Popen, PIPE -__author__ = "Kiriti Nagesh Gowda" __copyright__ = "Copyright 2018 - 2024, AMD MIVisionX - Neural Net Test Full Report" __license__ = "MIT" -__version__ = "1.2.0" -__maintainer__ = "Kiriti Nagesh Gowda" +__version__ = "1.5.0" __email__ = "mivisionx.support@amd.com" __status__ = "Shipping" - -if sys.version_info[0] < 3: - import commands -else: - import subprocess + +# error check calls +def ERROR_CHECK(call): + status = call + if(status != 0): + print('ERROR_CHECK failed with status:'+str(status)) + traceback.print_stack() + exit(status) def shell(cmd): @@ -105,6 +111,41 @@ def script_info(): ('nnef-mnist', 1, 28, 28) ] +# Linux Packages +inferenceDebianPackages = [ + 'inxi', + 'python3-dev', + 'python3-pip', + 'protobuf-compiler', + 'libprotoc-dev' +] + +inferenceRPMPackages = [ + 'inxi', + 'python3-devel', + 'python3-pip', + 'protobuf-devel', + 'python3-protobuf' +] + +pip3InferencePackagesDebian = [ + 'future==0.18.2', + 'pytz==2022.1', + 'numpy==1.22', + 'google==3.0.0', + 'protobuf==3.12.4', + 'onnx==1.12.0' +] + +pip3InferencePackagesRPM = [ + 'future==0.18.2', + 'pytz==2022.1', + 'numpy==1.23.0', + 'google==3.0.0', + 'protobuf==3.12.4', + 'onnx==1.11.0' +] + # REPORT reportConfig = [ ('CAFFE no fused OPs', 'caffe2nnir2openvx_noFuse_profile.md'), @@ -217,8 +258,7 @@ def script_info(): if os.path.exists(modelCompilerDeps) and reinstall == 'ON': os.system('sudo -v') os.system('sudo rm -rf '+modelCompilerDeps) - print("\nMIVisionX runNeuralNetworkTests: Removing Previous Install -- " + - modelCompilerDeps+"\n") + print("\nMIVisionX runNeuralNetworkTests: Removing Previous Install -- " +modelCompilerDeps+"\n") if not os.path.exists(modelCompilerDeps): print("STATUS: Model Compiler Deps Install - "+modelCompilerDeps+"\n") @@ -236,12 +276,13 @@ def script_info(): linuxSystemInstall = '' linuxSystemInstall_check = '' + linuxFlag = '' if "centos" in platfromInfo or "redhat" in platfromInfo or os.path.exists('/usr/bin/yum'): linuxSystemInstall = 'yum -y' linuxSystemInstall_check = '--nogpgcheck' if "centos-7" in platfromInfo or "redhat-7" in platfromInfo: linuxCMake = 'cmake3' - os.system(linuxSystemInstall+' install cmake3') + ERROR_CHECK(os.system(linuxSystemInstall+' install cmake3')) if "centos" not in platfromInfo or "redhat" not in platfromInfo: platfromInfo = platfromInfo+'-redhat' elif "Ubuntu" in platfromInfo or os.path.exists('/usr/bin/apt-get'): @@ -256,38 +297,36 @@ def script_info(): platfromInfo = platfromInfo+'-SLES' else: print("\nMIVisionX runNeuralNetworkTests.py on " + - platfromInfo+" is unsupported\n") + platfromInfo+" is unsupported\n") print("\nMIVisionX runNeuralNetworkTests.py Supported on: Ubuntu 20/22; CentOS 7/8; RedHat 8/9; & SLES 15 SP4\n") exit() if userName == 'root': - os.system(linuxSystemInstall+' update') - os.system(linuxSystemInstall+' install sudo') + ERROR_CHECK(os.system(linuxSystemInstall+' update')) + ERROR_CHECK(os.system(linuxSystemInstall+' install sudo')) os.makedirs(modelCompilerDeps) os.system('sudo -v') if "Ubuntu" in platfromInfo: - os.system( - 'sudo '+linuxSystemInstall+' ' + - linuxSystemInstall_check+' install git inxi python3-dev python3-pip protobuf-compiler libprotoc-dev') + for i in range(len(inferenceDebianPackages)): + ERROR_CHECK(os.system('sudo '+linuxFlag+' '+linuxSystemInstall + + ' '+linuxSystemInstall_check+' install -y '+ inferenceDebianPackages[i])) + for i in range(len(pip3InferencePackagesDebian)): + ERROR_CHECK(os.system('sudo pip3 install '+ pip3InferencePackagesDebian[i])) else: - os.system( - 'sudo '+linuxSystemInstall+' ' + - linuxSystemInstall_check+' install git inxi python-devel python3-devel python3-pip protobuf-devel python3-protobuf') - # Install base Deps - os.system('sudo pip3 install future==0.18.2 pytz==2022.1 numpy==1.21') - # Install CAFFE Deps - os.system('sudo pip3 install google==3.0.0 protobuf==3.12.4') - # Install ONNX Deps - os.system('sudo pip3 install onnx==1.12.0') + for i in range(len(inferenceRPMPackages)): + ERROR_CHECK(os.system('sudo '+linuxFlag+' '+linuxSystemInstall + + ' '+linuxSystemInstall_check+' install -y '+ inferenceRPMPackages[i])) + for i in range(len(pip3InferencePackagesRPM)): + ERROR_CHECK(os.system('sudo pip3 install '+ pip3InferencePackagesRPM[i])) # Install NNEF Deps - os.system('mkdir -p '+modelCompilerDeps+'/nnef-deps') - os.system( - '(cd '+modelCompilerDeps+'/nnef-deps; git clone https://github.com/KhronosGroup/NNEF-Tools.git)') - os.system( - '(cd '+modelCompilerDeps+'/nnef-deps/NNEF-Tools/parser/cpp; mkdir -p build && cd build; '+linuxCMake+' ..; make)') - os.system( - '(cd '+modelCompilerDeps+'/nnef-deps/NNEF-Tools/parser/python; sudo python3 setup.py install)') + ERROR_CHECK(os.system('mkdir -p '+modelCompilerDeps+'/nnef-deps')) + ERROR_CHECK(os.system( + '(cd '+modelCompilerDeps+'/nnef-deps; git clone -b nnef-v1.0.0 https://github.com/KhronosGroup/NNEF-Tools.git)')) + ERROR_CHECK(os.system( + '(cd '+modelCompilerDeps+'/nnef-deps/NNEF-Tools/parser/cpp; mkdir -p build && cd build; '+linuxCMake+' ..; make -j$(nproc); sudo make install)')) + ERROR_CHECK(os.system( + '(cd '+modelCompilerDeps+'/nnef-deps/NNEF-Tools/parser/python; sudo python3 setup.py install)')) else: print("STATUS: Model Compiler Deps Pre-Installed - "+modelCompilerDeps+"\n") if "centos-7" in platfromInfo: @@ -316,18 +355,18 @@ def script_info(): x = str(x) print("\n"+modelName+" - Batch size "+x) os.system('(cd '+outputDirectory + - '; mkdir -p nnir_build_'+x+')') + '; mkdir -p nnir_build_'+x+')') os.system('(cd '+modelBuildDir+x+'; python3 '+modelCompilerDir+'/caffe_to_nnir.py '+scriptPath+'/models/' + - modelName+'/model.caffemodel . --input-dims '+x+','+str(channel)+','+str(height)+','+str(width)+')') + modelName+'/model.caffemodel . --input-dims '+x+','+str(channel)+','+str(height)+','+str(width)+')') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_update.py --fuse-ops 0 . .)') + modelCompilerDir+'/nnir_update.py --fuse-ops 0 . .)') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_to_openvx.py . .)') + modelCompilerDir+'/nnir_to_openvx.py . .)') os.system('(cd '+modelBuildDir+x+'; '+linuxCMake+' .; make)') os.system('echo '+modelName+' - Batch size '+x+' | tee -a ' + - currentWorkingDirectory+'/vx_nn_test/caffe_no_fuse_output.log') + currentWorkingDirectory+'/vx_nn_test/caffe_no_fuse_output.log') os.system('(cd '+modelBuildDir+x+'; MIOPEN_FIND_ENFORCE='+str(miopenFind) + - ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/caffe_no_fuse_output.log)') + ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/caffe_no_fuse_output.log)') annTestResults = shell( '(cd '+modelBuildDir+x+'; ./anntest weights.bin)') annTestResults = annTestResults.decode() @@ -371,18 +410,18 @@ def script_info(): x = str(x) print("\n"+modelName+" - Batch size "+x) os.system('(cd '+outputDirectory + - '; mkdir -p nnir_build_'+x+')') + '; mkdir -p nnir_build_'+x+')') os.system('(cd '+modelBuildDir+x+'; python3 '+modelCompilerDir+'/caffe_to_nnir.py '+scriptPath+'/models/' + - modelName+'/model.caffemodel . --input-dims '+x+','+str(channel)+','+str(height)+','+str(width)+')') + modelName+'/model.caffemodel . --input-dims '+x+','+str(channel)+','+str(height)+','+str(width)+')') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_update.py --fuse-ops 1 . .)') + modelCompilerDir+'/nnir_update.py --fuse-ops 1 . .)') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_to_openvx.py . .)') + modelCompilerDir+'/nnir_to_openvx.py . .)') os.system('(cd '+modelBuildDir+x+'; '+linuxCMake+' .; make)') os.system('echo '+modelName+' - Batch size '+x+' | tee -a ' + - currentWorkingDirectory+'/vx_nn_test/caffe_fuse_output.log') + currentWorkingDirectory+'/vx_nn_test/caffe_fuse_output.log') os.system('(cd '+modelBuildDir+x+'; MIOPEN_FIND_ENFORCE='+str(miopenFind) + - ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/caffe_fuse_output.log)') + ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/caffe_fuse_output.log)') annTestResults = shell( '(cd '+modelBuildDir+x+'; ./anntest weights.bin)') annTestResults = annTestResults.decode() @@ -426,18 +465,18 @@ def script_info(): x = str(x) print("\n"+modelName+" - Batch size "+x) os.system('(cd '+outputDirectory + - '; mkdir -p nnir_build_'+x+')') + '; mkdir -p nnir_build_'+x+')') os.system('(cd '+modelBuildDir+x+'; python3 '+modelCompilerDir+'/caffe_to_nnir.py '+scriptPath+'/models/' + - modelName+'/model.caffemodel . --input-dims '+x+','+str(channel)+','+str(height)+','+str(width)+')') + modelName+'/model.caffemodel . --input-dims '+x+','+str(channel)+','+str(height)+','+str(width)+')') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_update.py --convert-fp16 1 . .)') + modelCompilerDir+'/nnir_update.py --convert-fp16 1 . .)') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_to_openvx.py . .)') + modelCompilerDir+'/nnir_to_openvx.py . .)') os.system('(cd '+modelBuildDir+x+'; '+linuxCMake+' .; make)') os.system('echo '+modelName+' - Batch size '+x+' | tee -a ' + - currentWorkingDirectory+'/vx_nn_test/caffe_fp16_output.log') + currentWorkingDirectory+'/vx_nn_test/caffe_fp16_output.log') os.system('(cd '+modelBuildDir+x+'; MIOPEN_FIND_ENFORCE='+str(miopenFind) + - ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/caffe_fp16_output.log)') + ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/caffe_fp16_output.log)') annTestResults = shell( '(cd '+modelBuildDir+x+'; ./anntest weights.bin)') annTestResults = annTestResults.decode() @@ -481,18 +520,18 @@ def script_info(): x = str(x) print("\n"+modelName+" - Batch size "+x) os.system('(cd '+outputDirectory + - '; mkdir -p nnir_build_'+x+')') + '; mkdir -p nnir_build_'+x+')') os.system('(cd '+modelBuildDir+x+'; python3 '+modelCompilerDir+'/onnx_to_nnir.py '+scriptPath+'/models/' + - modelName+'/model.onnx . --input-dims '+x+','+str(channel)+','+str(height)+','+str(width)+')') + modelName+'/model.onnx . --input-dims '+x+','+str(channel)+','+str(height)+','+str(width)+')') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_update.py --fuse-ops 0 . .)') + modelCompilerDir+'/nnir_update.py --fuse-ops 0 . .)') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_to_openvx.py . .)') + modelCompilerDir+'/nnir_to_openvx.py . .)') os.system('(cd '+modelBuildDir+x+'; '+linuxCMake+' .; make)') os.system('echo '+modelName+' - Batch size '+x+' | tee -a ' + - currentWorkingDirectory+'/vx_nn_test/onnx_no_fuse_output.log') + currentWorkingDirectory+'/vx_nn_test/onnx_no_fuse_output.log') os.system('(cd '+modelBuildDir+x+'; MIOPEN_FIND_ENFORCE='+str(miopenFind) + - ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/onnx_no_fuse_output.log)') + ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/onnx_no_fuse_output.log)') annTestResults = shell( '(cd '+modelBuildDir+x+'; ./anntest weights.bin)') annTestResults = annTestResults.decode() @@ -536,18 +575,18 @@ def script_info(): x = str(x) print("\n"+modelName+" - Batch size "+x) os.system('(cd '+outputDirectory + - '; mkdir -p nnir_build_'+x+')') + '; mkdir -p nnir_build_'+x+')') os.system('(cd '+modelBuildDir+x+'; python3 '+modelCompilerDir+'/onnx_to_nnir.py '+scriptPath+'/models/' + - modelName+'/model.onnx . --input-dims '+x+','+str(channel)+','+str(height)+','+str(width)+')') + modelName+'/model.onnx . --input-dims '+x+','+str(channel)+','+str(height)+','+str(width)+')') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_update.py --fuse-ops 1 . .)') + modelCompilerDir+'/nnir_update.py --fuse-ops 1 . .)') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_to_openvx.py . .)') + modelCompilerDir+'/nnir_to_openvx.py . .)') os.system('(cd '+modelBuildDir+x+'; '+linuxCMake+' .; make)') os.system('echo '+modelName+' - Batch size '+x+' | tee -a ' + - currentWorkingDirectory+'/vx_nn_test/onnx_fuse_output.log') + currentWorkingDirectory+'/vx_nn_test/onnx_fuse_output.log') os.system('(cd '+modelBuildDir+x+'; MIOPEN_FIND_ENFORCE='+str(miopenFind) + - ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/onnx_fuse_output.log)') + ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/onnx_fuse_output.log)') annTestResults = shell( '(cd '+modelBuildDir+x+'; ./anntest weights.bin)') annTestResults = annTestResults.decode() @@ -591,18 +630,18 @@ def script_info(): x = str(x) print("\n"+modelName+" - Batch size "+x) os.system('(cd '+outputDirectory + - '; mkdir -p nnir_build_'+x+')') + '; mkdir -p nnir_build_'+x+')') os.system('(cd '+modelBuildDir+x+'; python3 '+modelCompilerDir+'/onnx_to_nnir.py '+scriptPath+'/models/' + - modelName+'/model.onnx . --input-dims '+x+','+str(channel)+','+str(height)+','+str(width)+')') + modelName+'/model.onnx . --input-dims '+x+','+str(channel)+','+str(height)+','+str(width)+')') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_update.py --convert-fp16 1 . .)') + modelCompilerDir+'/nnir_update.py --convert-fp16 1 . .)') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_to_openvx.py . .)') + modelCompilerDir+'/nnir_to_openvx.py . .)') os.system('(cd '+modelBuildDir+x+'; '+linuxCMake+' .; make)') os.system('echo '+modelName+' - Batch size '+x+' | tee -a ' + - currentWorkingDirectory+'/vx_nn_test/onnx_fp16_output.log') + currentWorkingDirectory+'/vx_nn_test/onnx_fp16_output.log') os.system('(cd '+modelBuildDir+x+'; MIOPEN_FIND_ENFORCE='+str(miopenFind) + - ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/onnx_fp16_output.log)') + ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/onnx_fp16_output.log)') annTestResults = shell( '(cd '+modelBuildDir+x+'; ./anntest weights.bin)') annTestResults = annTestResults.decode() @@ -646,18 +685,18 @@ def script_info(): x = str(x) print("\n"+modelName+" - Batch size "+x) os.system('(cd '+outputDirectory + - '; mkdir -p nnir_build_'+x+')') + '; mkdir -p nnir_build_'+x+')') os.system('(cd '+modelBuildDir+x+'; python3 '+modelCompilerDir+'/nnef_to_nnir.py '+scriptPath+'/models/' + - modelName+' . )') + modelName+' . )') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_update.py --fuse-ops 0 . .)') + modelCompilerDir+'/nnir_update.py --fuse-ops 0 . .)') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_to_openvx.py . .)') + modelCompilerDir+'/nnir_to_openvx.py . .)') os.system('(cd '+modelBuildDir+x+'; '+linuxCMake+' .; make)') os.system('echo '+modelName+' - Batch size '+x+' | tee -a ' + - currentWorkingDirectory+'/vx_nn_test/nnef_no_fuse_output.log') + currentWorkingDirectory+'/vx_nn_test/nnef_no_fuse_output.log') os.system('(cd '+modelBuildDir+x+'; MIOPEN_FIND_ENFORCE='+str(miopenFind) + - ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/nnef_no_fuse_output.log)') + ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/nnef_no_fuse_output.log)') annTestResults = shell( '(cd '+modelBuildDir+x+'; ./anntest weights.bin)') annTestResults = annTestResults.decode() @@ -701,18 +740,18 @@ def script_info(): x = str(x) print("\n"+modelName+" - Batch size "+x) os.system('(cd '+outputDirectory + - '; mkdir -p nnir_build_'+x+')') + '; mkdir -p nnir_build_'+x+')') os.system('(cd '+modelBuildDir+x+'; python3 '+modelCompilerDir+'/nnef_to_nnir.py '+scriptPath+'/models/' + - modelName+' . )') + modelName+' . )') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_update.py --fuse-ops 1 . .)') + modelCompilerDir+'/nnir_update.py --fuse-ops 1 . .)') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_to_openvx.py . .)') + modelCompilerDir+'/nnir_to_openvx.py . .)') os.system('(cd '+modelBuildDir+x+'; '+linuxCMake+' .; make)') os.system('echo '+modelName+' - Batch size '+x+' | tee -a ' + - currentWorkingDirectory+'/vx_nn_test/nnef_fuse_output.log') + currentWorkingDirectory+'/vx_nn_test/nnef_fuse_output.log') os.system('(cd '+modelBuildDir+x+'; MIOPEN_FIND_ENFORCE='+str(miopenFind) + - ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/nnef_fuse_output.log)') + ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/nnef_fuse_output.log)') annTestResults = shell( '(cd '+modelBuildDir+x+'; ./anntest weights.bin)') annTestResults = annTestResults.decode() @@ -756,18 +795,18 @@ def script_info(): x = str(x) print("\n"+modelName+" - Batch size "+x) os.system('(cd '+outputDirectory + - '; mkdir -p nnir_build_'+x+')') + '; mkdir -p nnir_build_'+x+')') os.system('(cd '+modelBuildDir+x+'; python3 '+modelCompilerDir+'/nnef_to_nnir.py '+scriptPath+'/models/' + - modelName+' . )') + modelName+' . )') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_update.py --convert-fp16 1 . .)') + modelCompilerDir+'/nnir_update.py --convert-fp16 1 . .)') os.system('(cd '+modelBuildDir+x+'; python3 ' + - modelCompilerDir+'/nnir_to_openvx.py . .)') + modelCompilerDir+'/nnir_to_openvx.py . .)') os.system('(cd '+modelBuildDir+x+'; '+linuxCMake+' .; make)') os.system('echo '+modelName+' - Batch size '+x+' | tee -a ' + - currentWorkingDirectory+'/vx_nn_test/nnef_fp16_output.log') + currentWorkingDirectory+'/vx_nn_test/nnef_fp16_output.log') os.system('(cd '+modelBuildDir+x+'; MIOPEN_FIND_ENFORCE='+str(miopenFind) + - ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/nnef_fp16_output.log)') + ' ./anntest weights.bin | tee -a '+currentWorkingDirectory+'/vx_nn_test/nnef_fp16_output.log)') annTestResults = shell( '(cd '+modelBuildDir+x+'; ./anntest weights.bin)') annTestResults = annTestResults.decode()