-
Notifications
You must be signed in to change notification settings - Fork 606
[Arm][Example] Minor Script Updates #715
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
Changes from all commits
b98f278
48f90eb
24d2ce7
bbb6fb3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,10 @@ | |
|
||
set -eu | ||
|
||
if [[ "${1:-'.'}" == "-h" ]]; then | ||
echo "Usage: $(basename $0) [path-to-a-scratch-dir]" | ||
exit 0 | ||
if [[ "${1:-'.'}" == "-h" || "${#}" -eq 0 || "${#}" -gt 2 ]]; then | ||
echo "Usage: $(basename $0) <--i-agree-to-the-contained-eula> [path-to-a-scratch-dir]" | ||
echo "Supplied args: $*" | ||
exit 1 | ||
fi | ||
|
||
######## | ||
|
@@ -44,33 +45,42 @@ function verify_md5() { | |
script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd) | ||
|
||
if [[ $(get_cpu_arch) == "x86_64" ]]; then | ||
# FVP | ||
fvp_url="https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-300/FVP_Corstone_SSE-300_11.22_20_Linux64.tgz?rev=018659bd574f4e7b95fa647e7836ccf4&hash=22A79103C6FA5FFA7AFF3BE0447F3FF9" | ||
fvp_model_dir="Linux64_GCC-9.3" | ||
fvp_md5_checksum="98e93b949d0fbac977292d8668d34523" | ||
|
||
# toochain | ||
toolchain_url="https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi.tar.xz" | ||
toolchain_dir="arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi" | ||
toolchain_md5_checksum="00ebb1b70b1f88906c61206457eacb61" | ||
# FVP | ||
fvp_url="https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-300/FVP_Corstone_SSE-300_11.22_20_Linux64.tgz?rev=018659bd574f4e7b95fa647e7836ccf4&hash=22A79103C6FA5FFA7AFF3BE0447F3FF9" | ||
fvp_model_dir="Linux64_GCC-9.3" | ||
fvp_md5_checksum="98e93b949d0fbac977292d8668d34523" | ||
|
||
# toochain | ||
toolchain_url="https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi.tar.xz" | ||
toolchain_dir="arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi" | ||
toolchain_md5_checksum="00ebb1b70b1f88906c61206457eacb61" | ||
elif [[ $(get_cpu_arch) == "aarch64" ]]; then | ||
# FVP | ||
fvp_url="https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-300/FVP_Corstone_SSE-300_11.22_20_Linux64_armv8l.tgz?rev=9cc6e9a32bb947ca9b21fa162144cb01&hash=7657A4CF27D42E892E3F08D452AAB073" | ||
fvp_url="https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-300/FVP_Corstone_SSE-300_11.22_20_Linux64_armv8l.tgz?rev=9cc6e9a32bb947ca9b21fa162144cb01&hash=7657A4CF27D42E892E3F08D452AAB073" | ||
fvp_model_dir="Linux64_armv8l_GCC-9.3" | ||
fvp_md5_checksum="cbbabbe39b07939cff7a3738e1492ef1" | ||
fvp_md5_checksum="cbbabbe39b07939cff7a3738e1492ef1" | ||
|
||
# toochain | ||
toolchain_url="https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-aarch64-arm-none-eabi.tar.xz" | ||
toolchain_dir="arm-gnu-toolchain-12.3.rel1-aarch64-arm-none-eabi" | ||
toolchain_md5_checksum="02c9b0d3bb1110575877d8eee1f223f2" | ||
toolchain_md5_checksum="02c9b0d3bb1110575877d8eee1f223f2" | ||
else | ||
echo "[main] Error: only x86-64 & aarch64 architecture is supported for now!"; exit 1; | ||
echo "[main] Error: only x86-64 & aarch64 architecture is supported for now!"; exit 1; | ||
fi | ||
|
||
# ethos-u | ||
ethos_u_repo_url="https://review.mlplatform.org/ml/ethos-u/ethos-u" | ||
ethos_u_base_rev="0995223100e3da8011700f58e491f1bf59511e3c" | ||
|
||
######## | ||
digantdesai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
### Mandatory user args | ||
######## | ||
eula_acceptance="${1:-'.'}"; shift | ||
if [[ "${eula_acceptance}" != "--i-agree-to-the-contained-eula" ]]; then | ||
echo "Must pass first positional argument '--i-agree-to-the-contained-eula' to agree to EULA associated with downloading the FVP. Exiting!" | ||
exit 1 | ||
fi | ||
|
||
######## | ||
### Optional user args | ||
######## | ||
|
@@ -152,38 +162,40 @@ function patch_repo() { | |
} | ||
|
||
function setup_tosa_reference_model() { | ||
# The debug flow on the host includes running on a reference implementation of TOSA | ||
# This is useful primarily for debug of quantization accuracy, but also for internal | ||
# errors for the early codebase | ||
cd "${root_dir}" | ||
if [[ ! -e reference_model ]]; then | ||
git clone https://git.mlplatform.org/tosa/reference_model.git -b v0.80.0 | ||
cd reference_model | ||
git submodule update --init --recursive | ||
cd .. | ||
fi | ||
cd reference_model | ||
mkdir -p build | ||
cd build | ||
cmake .. | ||
make | ||
cd reference_model | ||
tosa_bin_path=`pwd` | ||
echo "export PATH=\${PATH}:${tosa_bin_path}" >> "${setup_path_script}" | ||
# The debug flow on the host includes running on a reference implementation of TOSA | ||
# This is useful primarily for debug of quantization accuracy, but also for internal | ||
# errors for the early codebase | ||
cd "${root_dir}" | ||
if [[ ! -e reference_model ]]; then | ||
git clone https://git.mlplatform.org/tosa/reference_model.git -b v0.80.0 | ||
cd reference_model | ||
git submodule update --init --recursive | ||
cd .. | ||
fi | ||
cd reference_model | ||
mkdir -p build | ||
cd build | ||
cmake .. | ||
n=$(nproc) | ||
make -j"$((n - 5))" | ||
digantdesai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cd reference_model | ||
tosa_bin_path=`pwd` | ||
echo "export PATH=\${PATH}:${tosa_bin_path}" >> "${setup_path_script}" | ||
} | ||
|
||
function setup_vela() { | ||
# | ||
# Prepare the Vela compiler for AoT to Ethos-U compilation | ||
# | ||
cd "${root_dir}/ethos-u/" | ||
if [[ ! -e ethos-u-vela ]]; then | ||
git clone https://git.mlplatform.org/ml/ethos-u/ethos-u-vela.git | ||
name="ethos-u-vela" | ||
base_rev=00a15db3e1a188b25065d095152d701f4394cdc5 | ||
patch_repo | ||
fi | ||
pip install . | ||
# | ||
# Prepare the Vela compiler for AoT to Ethos-U compilation | ||
# | ||
cd "${root_dir}/ethos-u/" | ||
digantdesai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if [[ ! -e ethos-u-vela ]]; then | ||
git clone https://git.mlplatform.org/ml/ethos-u/ethos-u-vela.git | ||
name="ethos-u-vela" | ||
base_rev=00a15db3e1a188b25065d095152d701f4394cdc5 | ||
patch_repo | ||
fi | ||
cd "${root_dir}/ethos-u/ethos-u-vela" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this was because patch_repo was leaving us in ethos-u-vela directory and so pip install . was in the right place (a clean re-run works on this stage) ; do we want to consistently sub-shell functions to prevent this kind of leak? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sounds good. But still we don't want to make too many assumption (beyond var values) when we enter the function. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. deferring this for later |
||
pip install . | ||
} | ||
|
||
######## | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice a few other functions do not have this diagnostic output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we should standardize a bit more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deferring this for later