-
Notifications
You must be signed in to change notification settings - Fork 742
Arm Backend: Improve VGF runtime and update MLSDK setup #13155
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
08e3c13
596fbfd
a22813f
c1f05f3
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 |
|---|---|---|
|
|
@@ -23,9 +23,9 @@ target_toolchain="" | |
| enable_fvps=1 | ||
| enable_vela=1 | ||
| enable_model_converter=0 # model-converter tool for VGF output | ||
| enable_vgf_lib=0 # vgf reader - runtime backend dependency | ||
| enable_vgf_lib=0 # vgf reader - runtime backend dependency | ||
| enable_emulation_layer=0 # Vulkan layer driver - emulates Vulkan ML extensions | ||
| mlsdk_manifest_url="" | ||
| mlsdk_manifest_url="https://github.com/arm/ai-ml-sdk-manifest.git" | ||
|
Contributor
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. From the manifest, most of them are on github.com which is awesome but I do see one on mlplatforms.org (the tosa one). FYI in the past we have seen a lot of reliability issues on that domain, keep an eye out of that if we are enabling this on the CI with high freq like pull.yaml for example. |
||
|
|
||
|
|
||
| # Figure out if setup.sh was called or sourced and save it into "is_script_sourced" | ||
|
|
@@ -370,14 +370,19 @@ function create_setup_path(){ | |
| # Add Path for vgf-lib and emulation-layer | ||
| if [[ "${enable_vgf_lib}" -eq 1 ]]; then | ||
| cd "${root_dir}" | ||
| model_vgf_lib_bin_path="$(cd ${mlsdk_manifest_dir}/sw/vgf-lib/build && pwd)" | ||
| echo "export PATH=\${PATH}:${model_vgf_lib_bin_path}" >> ${setup_path_script} | ||
| model_vgf_path="$(cd ${mlsdk_manifest_dir}/sw/vgf-lib/deploy && pwd)" | ||
| echo "export PATH=\${PATH}:${model_vgf_path}/bin" >> ${setup_path_script} | ||
| echo "export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:${model_vgf_path}/lib" >> ${setup_path_script} | ||
| echo "export DYLD_LIBRARY_PATH=\${DYLD_LIBRARY_PATH}:${model_vgf_path}/lib" >> ${setup_path_script} | ||
| fi | ||
|
|
||
| if [[ "${enable_emulation_layer}" -eq 1 ]]; then | ||
| cd "${root_dir}" | ||
| model_emulation_layer_bin_path="$(cd ${mlsdk_manifest_dir}/sw/vgf-lib/build && pwd)" | ||
| echo "export PATH=\${PATH}:${model_emulation_layer_bin_path}" >> ${setup_path_script} | ||
| model_emulation_layer_path="$(cd ${mlsdk_manifest_dir}/sw/emulation-layer/ && pwd)" | ||
| echo "export LD_LIBRARY_PATH=${model_emulation_layer_path}/deploy/lib:\${LD_LIBRARY_PATH}" >> ${setup_path_script} | ||
| echo "export DYLD_LIBRARY_PATH=${model_emulation_layer_path}/deploy/lib:\${DYLD_LIBRARY_PATH}" >> ${setup_path_script} | ||
| echo "export VK_INSTANCE_LAYERS=VK_LAYER_ML_Graph_Emulation:VK_LAYER_ML_Tensor_Emulation:\${VK_INSTANCE_LAYERS}" >> ${setup_path_script} | ||
| echo "export VK_ADD_LAYER_PATH=${model_emulation_layer_path}/deploy/share/vulkan/explicit_layer.d:\${VK_ADD_LAYER_PATH}" >> ${setup_path_script} | ||
| fi | ||
| } | ||
|
|
||
|
|
@@ -434,19 +439,11 @@ if [[ $is_script_sourced -eq 0 ]]; then | |
| setup_fvp | ||
| fi | ||
|
|
||
|
|
||
| if [[ -z "$mlsdk_manifest_url" && "${enable_model_converter}" -eq 1 ]]; then | ||
| echo "Warning: mlsdk-manifest-url is not set, but model converter setup is not skipped." | ||
| echo " Please set the --mlsdk-manifest-url option to the correct URL." | ||
| echo " Skipping MLSDK model converter setup." | ||
| enable_model_converter=0 # Q: Can we assume if we enable mlsdk, we will always enable model converter | ||
| enable_vgf_lib=0 | ||
| enable_emulation_layer=0 | ||
| fi | ||
|
|
||
| if [[ "${enable_model_converter}" -eq 1 ]]; then | ||
| if [[ "${enable_model_converter}" -eq 1 || \ | ||
| "${enable_vgf_lib}" -eq 1 || \ | ||
| "${enable_emulation_layer}" -eq 1 ]]; then | ||
| source $et_dir/backends/arm/scripts/mlsdk_utils.sh -u "${mlsdk_manifest_url}" | ||
| setup_model_converter ${root_dir} ${mlsdk_manifest_dir} ${enable_vgf_lib} ${enable_emulation_layer} | ||
| setup_model_converter ${root_dir} ${mlsdk_manifest_dir} ${enable_model_converter} ${enable_vgf_lib} ${enable_emulation_layer} | ||
| fi | ||
|
|
||
| # Create new setup_path script | ||
|
|
||
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.
Curious what will this do on Apple platforms?
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 will leave this question to @ArmRyan
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.
it's ensuring we have a bit better vulkan functional compatibility in situations where we deploy on moltenvk or other layer implementations. See https://www.lunarg.com/wp-content/uploads/2022/04/Portability-Enumeration-Extension-APR2022.pdf for the rough overview.