Added support to build onnxruntime with ACL#3586
Added support to build onnxruntime with ACL#3586prabhat00155 merged 3 commits intomicrosoft:masterfrom prabhat00155:prroy/acl_changes
Conversation
| 1. Build ACL Library (skip if already built) | ||
| ``` | ||
| cd ~ | ||
| git clone https://github.com/Arm-software/ComputeLibrary.git |
There was a problem hiding this comment.
This is an example for someone who wants to build ACL. If they have a pre-built version, they may use it as mentioned above.
| source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_acl_cc_srcs}) | ||
| add_library(onnxruntime_providers_acl ${onnxruntime_providers_acl_cc_srcs}) | ||
| onnxruntime_add_include_to_target(onnxruntime_providers_acl onnxruntime_common onnxruntime_framework onnx onnx_proto protobuf::libprotobuf) | ||
| target_link_libraries(onnxruntime_providers_acl -L$ENV{LD_LIBRARY_PATH}) |
There was a problem hiding this comment.
why using LD_LIBRARY_PATH? that's normally used at run time.
There was a problem hiding this comment.
We need to link the ACL so files. Without this build fails with this error: "Unable to load arm_compute arm_compute_graph arm_compute_core".
There was a problem hiding this comment.
My point was that LD_LIBRARY_PATH should not be used for that purpose.
We should allow user to specify the location of ACL libraries as build option.
There was a problem hiding this comment.
Even if you make user pass ACL library location, the user will still need to set LD_LIBRARY_PATH in order to use onnxruntime_perf_test otherwise get this error: "error while loading shared libraries: libarm_compute.so: cannot open shared object file: No such file or directory."
There was a problem hiding this comment.
yes, but LD_LIBRARY_PATH is used at runtime. it's not meant to be used during build time (which is what the cmake files are for)
at build time, the ACL install location can be anywhere and not set in the user's LD_LIBRARY_PATH
the binary could then be deployed to a target where LD_LIBRARY_PATH would need to be set at run time.
besides, LD_LIBRARY_PATH env variable is specific to Linux/Unix.
Many other EP's have dependency on other libs. (e.g. CUDA, OpenVINO) etc.
But you can grep through all our cmake files and you won't find a single reference to LD_LIBRARY_PATH
| //optimized depthwise convolution | ||
| #if defined(ACL_1902) || defined(ACL_1905) | ||
| auto layer = std::make_shared<arm_compute::NEDepthwiseConvolutionLayer3x3>(); | ||
| auto layer = std::make_shared<arm_compute::NEDepthwiseConvolutionLayer>(); |
There was a problem hiding this comment.
What is the reason of this change? NEDepthwiseConvolutionLayer3x3 is an optimized version for depthwise 3x3 which increases the performance significantly for mobilenets and other models.
There was a problem hiding this comment.
I believe it was accidental.
@prabhat00155 was trying to incorporate some of the changes from #2511
but accidentally reverted changes from
#2774
@prabhat00155 can you please revert this change? thanks.
There was a problem hiding this comment.
I was getting error(NEDepthwiseConvolutionLayer3x3 not defined) and had to make this change to build. I'll update my ACL repo and retry.
There was a problem hiding this comment.
Got the issue, this should be only used for ACL_1902. I'll create a new PR to use NEDepthwiseConvolutionLayer3x3 and fix the error.
Description: With these changes, onnxruntime could be built with ACL ep using:
./build.sh --use_aclMotivation and Context