From e43ff7eef4e62dd8923770d743221a040aa06668 Mon Sep 17 00:00:00 2001 From: Jesus Hector Robles Gutierrez Date: Tue, 28 Nov 2023 13:18:53 -0800 Subject: [PATCH] Add AI tools samples Adds AI Tool build samples example for v2024.0.1 Signed-off-by: Jesus Hector Robles Gutierrez --- .github/workflows/build_all.yml | 37 +++++++++++++++++++++++- .github/workflows/list_components.yml | 6 ++-- scripts/build_linux_aitools.sh | 13 +++++++++ scripts/build_windows.bat | 11 ++----- scripts/install_linux_aitools.sh | 13 +++++++++ scripts/list_components_linux_aitools.sh | 12 ++++---- 6 files changed, 75 insertions(+), 17 deletions(-) create mode 100755 scripts/build_linux_aitools.sh create mode 100755 scripts/install_linux_aitools.sh diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index 21fedb9b..0f89fedd 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -11,6 +11,7 @@ env: WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/5b36181e-4974-4733-91c7-0c10c54900a5/w_HPCKit_p_2024.0.0.49588_offline.exe LINUX_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/20f4e6a1-6b0b-4752-b8c1-e5eacba10e01/l_BaseKit_p_2024.0.0.49564_offline.sh LINUX_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1b2baedd-a757-4a79-8abb-a5bf15adae9a/l_HPCKit_p_2024.0.0.49589_offline.sh + LINUX_AIKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/4c0e0228-7d3b-40e2-8a2c-eae82f77b0c8/l_AITools.2024.0.1.3.sh MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/edb4dc2f-266f-47f2-8d56-21bc7764e119/m_HPCKit_p_2023.2.0.49443_offline.dmg WINDOWS_CPP_COMPONENTS: intel.oneapi.win.cpp-dpcpp-common WINDOWS_FORTRAN_COMPONENTS: intel.oneapi.win.ifort-compiler @@ -23,7 +24,7 @@ env: LINUX_DPCPP_COMPONENTS_WEB: intel.oneapi.lin.dpcpp-cpp-compiler MACOS_CPP_COMPONENTS: intel.oneapi.mac.cpp-compiler MACOS_FORTRAN_COMPONENTS: intel.oneapi.mac.ifort-compiler - CACHE_NUMBER: 7 + CACHE_NUMBER: 9 SAMPLES_TAG: 2024.0.0 COMPILER_VERSION: 2024.0.0 TBB_VERSION: 2021.11.0 @@ -249,6 +250,40 @@ jobs: installer* retention-days: 7 + build_linux_aitools: + runs-on: ubuntu-20.04 + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v2 + - name: cache install + id: cache-install + uses: actions/cache@v2 + with: + path: | + /intel/oneapi/intelpython + key: install-${{ env.CACHE_NUMBER }}-${{ env.LINUX_AIKIT_URL }}-compiler-tbb-${{ hashFiles('**/scripts/cache_exclude_linux.sh') }} + - name: install + if: steps.cache-install.outputs.cache-hit != 'true' + run: scripts/install_linux_aitools.sh $LINUX_AIKIT_URL + - name: build + run: scripts/build_linux_aitools.sh $SAMPLES_TAG + - name: exclude unused files from cache + if: steps.cache-install.outputs.cache-hit != 'true' + run: scripts/cache_exclude_linux.sh + + # Delete the following if you don't want to save install logs + - name: Saving install logs + if: steps.cache-install.outputs.cache-hit != 'true' + uses: actions/upload-artifact@v2 + with: + name: InstallLogs_${{ github.job }} + path: | + bootstrapper* + installer* + retention-days: 7 + build_linux_apt_cpp: runs-on: ubuntu-20.04 defaults: diff --git a/.github/workflows/list_components.yml b/.github/workflows/list_components.yml index 05b1c8a0..ab4d000e 100644 --- a/.github/workflows/list_components.yml +++ b/.github/workflows/list_components.yml @@ -18,7 +18,7 @@ env: LINUX_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/20f4e6a1-6b0b-4752-b8c1-e5eacba10e01/l_BaseKit_p_2024.0.0.49564.sh LINUX_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1b2baedd-a757-4a79-8abb-a5bf15adae9a/l_HPCKit_p_2024.0.0.49589.sh LINUX_IOTKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/792937e1-5667-47a9-a9df-e1142fce55b5/l_IoTKit_p_2023.2.0.49273.sh - LINUX_AIKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/249dd907-b3ed-4aae-a9d2-f8e303c02dbe/l_AITools.2024.0.0.21.sh + LINUX_AIKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/4c0e0228-7d3b-40e2-8a2c-eae82f77b0c8/l_AITools.2024.0.1.3.sh LINUX_RENDERKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18e978f0-5a80-4006-bf34-207f205b8f4f/l_RenderKit_p_2024.0.0.49659.sh MACOS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/cd013e6c-49c4-488b-8b86-25df6693a9b7/m_BaseKit_p_2023.2.0.49398.dmg MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/edb4dc2f-266f-47f2-8d56-21bc7764e119/m_HPCKit_p_2023.2.0.49443.dmg @@ -66,10 +66,10 @@ jobs: run: scripts/list_components_linux.sh $LINUX_HPCKIT_URL doc/source/${{ github.workflow }}/${{ github.job }}_hpckit.txt - name: Intel® oneAPI IoT Toolkit run: scripts/list_components_linux.sh $LINUX_IOTKIT_URL doc/source/${{ github.workflow }}/${{ github.job }}_iotkit.txt - - name: Intel® AI Tools Toolkit - run: scripts/list_components_linux_aitools.sh $LINUX_AIKIT_URL - name: Intel® oneAPI Rendering Toolkit run: scripts/list_components_linux.sh $LINUX_RENDERKIT_URL doc/source/${{ github.workflow }}/${{ github.job }}_renderkit.txt + - name: Intel® AI Tools Toolkit + run: scripts/list_components_linux_aitools.sh $LINUX_AIKIT_URL doc/source/${{ github.workflow }}/${{ github.job }}_aitools.txt - name: Upload artifacts uses: actions/upload-artifact@v2 diff --git a/scripts/build_linux_aitools.sh b/scripts/build_linux_aitools.sh new file mode 100755 index 00000000..2d707e0d --- /dev/null +++ b/scripts/build_linux_aitools.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: 2020 Intel Corporation +# +# SPDX-License-Identifier: MIT + +SAMPLES_TAG=$1 + +git clone --depth 1 --branch "$SAMPLES_TAG" https://github.com/oneapi-src/oneAPI-samples.git + +source /intel/oneapi/intelpython/bin/activate tensorflow +cd oneAPI-samples/AI-and-Analytics/Getting-Started-Samples/IntelTensorFlow_GettingStarted +python TensorFlow_HelloWorld.py diff --git a/scripts/build_windows.bat b/scripts/build_windows.bat index 63ff2f0e..43e4e929 100644 --- a/scripts/build_windows.bat +++ b/scripts/build_windows.bat @@ -47,14 +47,9 @@ set /a RESULT=%RESULT%+%ERRORLEVEL% goto exit :dpcpp -for /f "tokens=* usebackq" %%f in (`dir /b "C:\Program Files (x86)\Intel\oneAPI\tbb\" ^| findstr /V latest ^| sort`) do @set "LATEST_VERSION=%%f" -@call "C:\Program Files (x86)\Intel\oneAPI\tbb\%LATEST_VERSION%\env\vars.bat" -cd oneAPI-samples\DirectProgramming\C++SYCL\DenseLinearAlgebra\vector-add -mkdir build -cd build -cmake -G "NMake Makefiles" .. -nmake cpu-gpu -vector-add-buffers.exe +cd oneAPI-samples\DirectProgramming\C++SYCL\DenseLinearAlgebra\matrix_mul +nmake -f Makefile.win build_sycl +matrix_mul_sycl.exe set RESULT=%ERRORLEVEL% goto exit diff --git a/scripts/install_linux_aitools.sh b/scripts/install_linux_aitools.sh new file mode 100755 index 00000000..3b51c489 --- /dev/null +++ b/scripts/install_linux_aitools.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: 2020 Intel Corporation +# +# SPDX-License-Identifier: MIT + +URL=$1 + +curl --output webimage.sh --url "$URL" --retry 5 --retry-delay 5 +chmod +x webimage.sh +sudo ./webimage.sh -b -p /intel/oneapi/intelpython -k +installer_exit_code=$? +exit $installer_exit_code diff --git a/scripts/list_components_linux_aitools.sh b/scripts/list_components_linux_aitools.sh index 572e0614..f92e2bee 100755 --- a/scripts/list_components_linux_aitools.sh +++ b/scripts/list_components_linux_aitools.sh @@ -5,13 +5,15 @@ # SPDX-License-Identifier: MIT URL=$1 +FILENAME=$2 curl --output webimage.sh --url "$URL" --retry 5 --retry-delay 5 chmod +x webimage.sh -./webimage.sh -b -p webimage_extracted -installer_exit_code=$? +sudo ./webimage.sh -b -p webimage_extracted -k rm -rf webimage.sh -WEBIMAGE_NAME=$(ls -1 webimage_extracted/) -echo "$WEBIMAGE_NAME" -rm -rf webimage_extracted +source webimage_extracted/bin/activate base +installer_exit_code=$? +conda env list > "$FILENAME" +cat "$FILENAME" +sudo rm -rf webimage_extracted exit $installer_exit_code