Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop - Merge to TOT #1201

Merged
merged 4 commits into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* RPP - [1.2.0.50700-63](https://github.com/GPUOpen-ProfessionalCompute-Libraries/rpp/releases/tag/1.2.0)
* FFMPEG - [n4.4.2](https://github.com/FFmpeg/FFmpeg/releases/tag/n4.4.2)
* Dependencies for all the above packages
* MIVisionX Setup Script - `V2.5.5`
* MIVisionX Setup Script - `V2.5.6`

### Known issues

Expand Down
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ option(LOOM "Build MIVisionX with LOOM Support" ON)
option(GPU_SUPPORT "Build MIVisionX with GPU Support" ON)
option(MIGRAPHX "Build MIVisionX with MIGraphX Support" ON)
option(BUILD_DEV "Build MIVisionX Development Package" ON)
option(AMD_FP16_SUPPORT "Build MIVisionX with float16 Support" OFF)
option(BUILD_WITH_AMD_ADVANCE "Build MIVisionX for advanced AMD GPU Architecture" OFF)

if(WIN32)
Expand Down Expand Up @@ -126,12 +125,17 @@ message("-- ${Cyan} -D GPU_SUPPORT=${GPU_SUPPORT} [Turn ON/OFF GPU support (
message("-- ${Cyan} -D MIGRAPHX=${MIGRAPHX} [Turn ON/OFF MIGraphX Module (default:ON)]${ColourReset}")
message("-- ${Cyan} -D BACKEND=${BACKEND} [Select MIVisionX Backend [options:CPU/OPENCL/HIP](default:HIP)]${ColourReset}")
message("-- ${Cyan} -D BUILD_DEV=${BUILD_DEV} [MIVisionX Developement/Runtime Build(default:ON)]${ColourReset}")
message("-- ${Cyan} -D AMD_FP16_SUPPORT=${AMD_FP16_SUPPORT} [Turn ON/OFF OpenVX FP16 Support (default:OFF)]${ColourReset}")

if(AMD_FP16_SUPPORT)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/amd_openvx/cmake)
find_package(HALF QUIET)

if(HALF_FOUND)
add_definitions(-DAMD_FP16_SUPPORT)
message("-- ${Blue}MIVisionX -- -DAMD_FP16_SUPPORT definition added${ColourReset}")
endif(AMD_FP16_SUPPORT)
include_directories(${HALF_INCLUDE_DIRS})
message("-- ${Blue}MIVisionX Built with float16 Support -- -DAMD_FP16_SUPPORT definition added${ColourReset}")
else()
message("-- ${Blue}MIVisionX Built with float16 Support OFF${ColourReset}")
endif()

add_subdirectory(amd_openvx)
add_subdirectory(amd_openvx_extensions)
Expand Down
68 changes: 23 additions & 45 deletions MIVisionX-setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
__author__ = "Kiriti Nagesh Gowda"
__copyright__ = "Copyright 2018 - 2023, AMD ROCm MIVisionX"
__license__ = "MIT"
__version__ = "2.5.5"
__version__ = "2.5.6"
__maintainer__ = "Kiriti Nagesh Gowda"
__email__ = "[email protected]"
__status__ = "Shipping"
Expand All @@ -55,8 +55,8 @@
help='MIVisionX Neural Net Inference Dependency Install - optional (default:ON) [options:ON/OFF]')
parser.add_argument('--rocal', type=str, default='ON',
help='MIVisionX rocAL Dependency Install - optional (default:ON) [options:ON/OFF]')
parser.add_argument('--developer', type=str, default='ON',
help='Setup Developer Options - optional (default:ON) [options:ON/OFF]')
parser.add_argument('--developer', type=str, default='OFF',
help='Setup Developer Options - optional (default:OFF) [options:ON/OFF]')
parser.add_argument('--reinstall', type=str, default='OFF',
help='Remove previous setup and reinstall - optional (default:OFF) [options:ON/OFF]')
parser.add_argument('--backend', type=str, default='HIP',
Expand Down Expand Up @@ -126,7 +126,7 @@
if backend != 'CPU':
print("\nWARNING: ROCm Not Found at -- "+ROCM_PATH+"\n")
print(
"WARNING: Set ROCm Path with \"--rocm_path\" option for full installation [Default:/opt/rocm]\n")
"WARNING: If ROCm installed, set ROCm Path with \"--rocm_path\" option for full installation [Default:/opt/rocm]\n")
print("WARNING: Limited dependencies will be installed\n")
backend = 'CPU'
else:
Expand Down Expand Up @@ -211,24 +211,13 @@

if neuralNetInstall == 'ON':
os.system('sudo -v')
if backend == 'OCL':
if "Ubuntu" in platfromInfo:
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' ' +
linuxSystemInstall_check+' autoremove -y rocblas rocblas-dev miopen-hip miopen-hip-dev migraphx-devel')
else:
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' ' +
linuxSystemInstall_check+' autoremove -y rocblas rocblas-devel miopen-hip miopen-hip-devel migraphx-devel')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall +
' '+linuxSystemInstall_check+' install -y miopengemm miopen-opencl')
else:
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' ' +
linuxSystemInstall_check+' autoremove -y miopengemm miopen-opencl')
if backend == 'HIP':
if "Ubuntu" in platfromInfo:
os.system('sudo '+linuxFlag+' '+linuxSystemInstall +
' '+linuxSystemInstall_check+' install -y rocblas-dev miopen-hip-dev migraphx-dev')
' '+linuxSystemInstall_check+' install -y half rocblas-dev miopen-hip-dev migraphx-dev')
else:
os.system('sudo '+linuxFlag+' '+linuxSystemInstall +
' '+linuxSystemInstall_check+' install -y rocblas-devel miopen-hip-devel migraphx-devel')
' '+linuxSystemInstall_check+' install -y half rocblas-devel miopen-hip-devel migraphx-devel')

if (rocalInstall == 'ON' or neuralNetInstall == 'ON'):
# ProtoBuf
Expand All @@ -253,6 +242,7 @@

print("\nMIVisionX Dependencies Re-Installed with MIVisionX-setup.py V-"+__version__+"\n")
exit()

# Clean Install
else:
print("\nMIVisionX Dependencies Installation with MIVisionX-setup.py V-"+__version__+"\n")
Expand All @@ -272,6 +262,9 @@
os.system(
'(cd '+deps_dir+'; wget https://github.com/protocolbuffers/protobuf/archive/v'+ProtoBufVersion+'.zip )')
os.system('(cd '+deps_dir+'; unzip v'+ProtoBufVersion+'.zip )')
os.system(
'(cd '+deps_dir+'; wget https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2 )')
os.system('(cd '+deps_dir+'; tar xjvf boost_1_72_0.tar.bz2 )')
if ffmpegInstall == 'ON':
os.system(
'(cd '+deps_dir+'; wget https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n4.4.2.zip && unzip n4.4.2.zip )')
Expand All @@ -296,9 +289,6 @@
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' ' +
linuxSystemInstall_check+' install sqlite3 sqlite3-devel libbz2-devel libopenssl-devel python3-devel autoconf automake libtool curl make gcc-c++ unzip')
# Boost V 1.72.0 from source
os.system(
'(cd '+deps_dir+'; wget https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2 )')
os.system('(cd '+deps_dir+'; tar xjvf boost_1_72_0.tar.bz2 )')
os.system(
'(cd '+deps_dir+'/boost_1_72_0/; ./bootstrap.sh --prefix=/usr/local --with-python=python3 )')
os.system(
Expand All @@ -310,12 +300,9 @@
os.system(
'(cd '+deps_dir+'/boost_1_72_0/; sudo ./b2 install threading=multi link=static --with-system --with-filesystem)')
# Install half.hpp
os.system(
'(cd '+deps_dir+'; wget https://sourceforge.net/projects/half/files/half/1.12.0/half-1.12.0.zip )')
os.system('(cd '+deps_dir+'; unzip half-1.12.0.zip -d half-files )')
os.system('sudo -v')
os.system(
'(cd '+deps_dir+'; sudo mkdir -p /usr/local/include/half; sudo cp half-files/include/half.hpp /usr/local/include/half )')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall +
' '+linuxSystemInstall_check+' install -y half')
# Install ProtoBuf
os.system('(cd '+deps_dir+'/protobuf-' +
ProtoBufVersion+'; ./autogen.sh )')
Expand All @@ -332,31 +319,19 @@
'; sudo '+linuxFlag+' ldconfig )')

if neuralNetInstall == 'ON':
# Remove Previous Install - MIOpen
os.system('sudo -v')
if os.path.exists(ROCM_PATH+'/miopen'):
os.system('sudo rm -rf '+ROCM_PATH+'/miopen*')

if backend == 'OCL':
if backend == 'HIP':
os.system('sudo -v')
if "Ubuntu" in platfromInfo:
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' ' +
linuxSystemInstall_check+' autoremove -y rocblas rocblas-dev miopen-hip miopen-hip-dev migraphx-devel')
else:
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' ' +
linuxSystemInstall_check+' autoremove -y rocblas rocblas-devel miopen-hip miopen-hip-devel migraphx-devel')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall +
' '+linuxSystemInstall_check+' install -y miopen-opencl')
else:
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' ' +
linuxSystemInstall_check+' autoremove -y miopengemm miopen-opencl')
' '+linuxSystemInstall_check+' install -y half')
if "Ubuntu" in platfromInfo:
os.system('sudo '+linuxFlag+' '+linuxSystemInstall +
' '+linuxSystemInstall_check+' install -y rocblas-dev miopen-hip-dev migraphx-dev')
else:
os.system('sudo '+linuxFlag+' '+linuxSystemInstall +
' '+linuxSystemInstall_check+' install -y rocblas-devel miopen-hip-devel migraphx-devel')
else:
print(
"\nSTATUS: MIVisionX Setup: Neural Network only supported with HIP backend\n")

# Install Model Compiler Deps
if inferenceInstall == 'ON':
Expand Down Expand Up @@ -576,14 +551,17 @@
linuxFlag+' make install )')

if developerInstall == 'ON':
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check +
' install autoconf texinfo')
if "Ubuntu" in platfromInfo:
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check +
' install autoconf build-essential texinfo libgmp-dev')
' install build-essential libgmp-dev')
else:
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check +
' install autoconf texinfo gmp-devel')
' install gmp-devel')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check +
' groupinstall \'Development Tools\' ')
os.system(
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ For the convenience of the developer, we provide the setup script `MIVisionX-set
--rocal [MIVisionX rocAL Dependency Install - optional (default:ON) [options:ON/OFF]]
--neural_net[MIVisionX Neural Net Dependency Install - optional (default:ON) [options:ON/OFF]]
--inference [MIVisionX Neural Net Inference Dependency Install - optional (default:ON) [options:ON/OFF]]
--developer [Setup Developer Options - optional (default:ON) [options:ON/OFF]]
--developer [Setup Developer Options - optional (default:OFF) [options:ON/OFF]]
--reinstall [Remove previous setup and reinstall (default:OFF)[options:ON/OFF]]
--backend [MIVisionX Dependency Backend - optional (default:HIP) [options:HIP/OCL/CPU]]
--rocm_path [ROCm Installation Path - optional (default:/opt/rocm) - ROCm Installation Required]
Expand Down Expand Up @@ -444,7 +444,7 @@ Review all notable [changes](CHANGELOG.md#changelog) with the latest release
* RPP - [1.2.0.50700-63](https://github.com/GPUOpen-ProfessionalCompute-Libraries/rpp/releases/tag/1.2.0)
* FFMPEG - [n4.4.2](https://github.com/FFmpeg/FFmpeg/releases/tag/n4.4.2)
* Dependencies for all the above packages
* MIVisionX Setup Script - `V2.5.5`
* MIVisionX Setup Script - `V2.5.6`

### Known issues

Expand Down
59 changes: 59 additions & 0 deletions amd_openvx/cmake/FindHALF.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
################################################################################
#
# MIT License
#
# Copyright (c) 2017 - 2023 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
################################################################################
find_path(HALF_INCLUDE_DIRS
NAMES half/half.hpp
HINTS
$ENV{HALF_DIR}/include
PATHS
${HALF_DIR}/include
/usr/include
/usr/local/include
${ROCM_PATH}/include
)
mark_as_advanced(HALF_INCLUDE_DIRS)

if(HALF_INCLUDE_DIRS)
set(HALF_FOUND TRUE)
endif( )

include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( HALF
FOUND_VAR HALF_FOUND
REQUIRED_VARS
HALF_INCLUDE_DIRS
)

set(HALF_FOUND ${HALF_FOUND} CACHE INTERNAL "")
set(HALF_INCLUDE_DIRS ${HALF_INCLUDE_DIRS} CACHE INTERNAL "")

if(HALF_FOUND)
message("-- ${White}Using HALF -- \n\tIncludes:${HALF_INCLUDE_DIRS}${ColourReset}")
else()
if(HALF_FIND_REQUIRED)
message(FATAL_ERROR "{Red}FindHALF -- NOT FOUND${ColourReset}")
endif()
message( "-- ${Yellow}NOTE: FindHALF failed to find -- half.hpp${ColourReset}" )
endif()
4 changes: 2 additions & 2 deletions amd_openvx/openvx/include/VX/vx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ VX_API_ENTRY vx_enum VX_API_CALL vxRegisterUserStruct(vx_context context, vx_siz
* \brief Registers user-defined structures to the context, and associates a name to it.
* \param [in] context The reference to the implementation context.
* \param [in] size The size of user struct in bytes.
* \param [in] *type_name Pointer to the '\0' terminated string that identifies the
* \param [in] type_name Pointer to the '\0' terminated string that identifies the
* user struct type. The string is copied by the function so
* that it stays the property of the caller. NULL means that
* the user struct is not named. The length of the string
Expand All @@ -177,8 +177,8 @@ VX_API_ENTRY vx_enum VX_API_CALL vxRegisterUserStructWithName(vx_context context
/*!
* \brief Returns the name of the user-defined structure associated with the enumeration given.
* \param [in] context The reference to the implementation context.
* \param [out] user_struct_type Name of the user struct
* \param [in] type_name The enumeration value of the user struct
* \param [out] name_size Name of the user struct
* \param [in] name_size The size of allocated buffer pointed to by type_name
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS user_struct_type was valid, and name was found and returned
Expand Down
9 changes: 7 additions & 2 deletions amd_openvx/openvx/include/vx_ext_amd.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ THE SOFTWARE.
* \ingroup group_amd
*/
#define AGO_TARGET_AFFINITY_CPU 0x0010 // CPU
/*! \brief AMD target affinity enumerations for AgoTargetAffinityInfo.device_type
* \ingroup group_amd
*/
#define AGO_TARGET_AFFINITY_GPU 0x0020 // GPU
/*! \brief AMD target affinity enumerations for AgoTargetAffinityInfo.device_type
* \ingroup group_amd
*/
#define AGO_TARGET_AFFINITY_APU 0x0030 // APU

/*! \brief AMD internal parameters. [TODO: This needs to be moved to ago_internal.h]
Expand Down Expand Up @@ -503,8 +509,7 @@ typedef struct
/*! \brief A 16-bit float value.
*/
#include <half/half.hpp>
using half_float::half;
typedef half vx_float16;
typedef half_float::half vx_float16;
#endif
#endif

Expand Down
6 changes: 1 addition & 5 deletions amd_openvx_extensions/amd_custom/include/vx_amd_custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ THE SOFTWARE.
*/

/*! \brief The type enumeration lists all NN extension types.
* \ingroup group_cnn
* \ingroup group_amd_nn
* \ingroup group_amd_custom
*/
enum vx_amd_custom_type_e
Expand All @@ -44,8 +42,6 @@ enum vx_amd_custom_type_e
};

/*! \brief Input parameters for a convolution operation.
* \ingroup group_cnn
* \ingroup group_amd_nn
* \ingroup group_amd_custom
*/
typedef struct _vx_amd_custom_params_t
Expand All @@ -58,7 +54,7 @@ typedef struct _vx_amd_custom_params_t
* \param [in] graph The handle to the graph.
* \param [in] inputs The input tensor data.
* \param [in] function custom funtion enum.
* \param [in] array for user specified custom_parameters.
* \param [in] custom_parameters for user specified custom_parameters.
* \param [out] outputs The output tensor data.
* \return <tt> vx_node</tt>.
* \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
Expand Down
Loading
Loading