huawei-noah / bolt

Bolt is a deep learning library with high performance and heterogeneous flexibility.
https://huawei-noah.github.io/bolt/
MIT License
918 stars 160 forks source link

anyone fine too difficult to build ? #21

Closed maxfy1992 closed 3 years ago

jianfeifeng commented 3 years ago

Thanks for your feedback. We provide one-click compilation scripts that are currently only suitable for cross-compilation of Linux servers. However, due to various differences in the configuration of different server environments, it is inevitable that various problems will be encountered during the compilation process. We are constantly optimizing the compilation process of bolt. In the future, we will try our best to meet the compilation needs of users such as linux/windows/mac, and make compilation as easy to use as possible. If possible, you can paste the problems encountered during the compilation process, and we are very happy to analyze and solve the problems for you. You are also welcome to contact us at any time if you encounter any problems. My contact email is: jianfeifeng@outlook.com. 感谢您的反馈。我们提供一键编译脚本目前仅适用于linux服务器交叉编译,但由于不同服务器环境配置存在各种差异,难免会在编译过程中遇到各种各样的问题,我们在不断优化bolt的编译流程。未来我们会尽可能满足linux/windows/mac等用户的编译需求,尽可能让编译变得简单易用。如果可以,您可以把编译过程中遇到的问题粘贴下来,我们非常乐意为您去分析并解决问题。也欢迎您遇到问题随时联系我们,我的联系邮箱是:jianfeifeng@outlook.com.

maxfy1992 commented 3 years ago

I want build on Mac OS using ndk build aarch64 arm version

maxfy1992 commented 3 years ago

maybe just like other framework, usually set NDK path and cmake .. --some options, then build lib and binary which can be run at android with adb...

maxfy1992 commented 3 years ago

where can I find XX.bolt in https://github.com/huawei-noah/bolt/blob/master/docs/BENCHMARK.md ....

maxfy1992 commented 3 years ago
device:/data/local/tmp/install_arm_llvm/examples # ./benchmark -m ./mobilenet_v2_f32.bolt -l 1

Please enter this command './benchmark --help' to get more usage information.
option is -m <boltModelPath>, value is: ./mobilenet_v2_f32.bolt
option is -l [loopTime], value is: 1
Input Tensor Dimension: dt:6 df:0 dims:4(1,3,224,224)
Illegal instruction (core dumped)
maxfy1992 commented 3 years ago
 git clone https://github.com/huawei-noah/bolt/blob/master/docs/INSTALL.md

 install ndk cmake ...
 adb pull libOpenCL ...

 sh ./third_party/install.sh -c arm_llvm -t 12
 sh ./install.sh -c arm_llvm -t 33 -g ON

 adb push install_arm_llvm /data/local/tmp/

 get caffe model from https://github.com/shicai/MobileNet-Caffe

device:/data/local/tmp/install_arm_llvm/tools # ./X2bolt -d ./models/ -m mobilenet_v2 -i FP32

 Enter './X2bolt --help' to get more usage information.
 Enter './X2bolt --version' to get the version.

 option is -d <modelDirectory>, value is: ./models/
 option is -m <modelName>, value is: mobilenet_v2
 option is -i <inferencePrecision>, value is: FP32
 Model Conversion Succeeded!

device:/data/local/tmp/install_arm_llvm/examples # ./benchmark -m ./mobilenet_v2_f32.bolt -l 1

 Please enter this command './benchmark --help' to get more usage information.
 option is -m <boltModelPath>, value is: ./mobilenet_v2_f32.bolt
 option is -l [loopTime], value is: 1
 Input Tensor Dimension: dt:6 df:0 dims:4(1,3,224,224)
 Illegal instruction (core dumped)
maxfy1992 commented 3 years ago
 git clone https://github.com/huawei-noah/bolt/blob/master/docs/INSTALL.md

 install ndk cmake ...
 adb pull libOpenCL ...

 sh ./third_party/install.sh -c arm_llvm -t 12
 sh ./install.sh -c arm_llvm -t 33 -g ON

 adb push install_arm_llvm /data/local/tmp/

 get caffe model from https://github.com/shicai/MobileNet-Caffe

device:/data/local/tmp/install_arm_llvm/tools # ./X2bolt -d ./models/ -m mobilenet_v2 -i FP32

 Enter './X2bolt --help' to get more usage information.
 Enter './X2bolt --version' to get the version.

 option is -d <modelDirectory>, value is: ./models/
 option is -m <modelName>, value is: mobilenet_v2
 option is -i <inferencePrecision>, value is: FP32
 Model Conversion Succeeded!

device:/data/local/tmp/install_arm_llvm/examples # ./benchmark -m ./mobilenet_v2_f32.bolt -l 1

 Please enter this command './benchmark --help' to get more usage information.
 option is -m <boltModelPath>, value is: ./mobilenet_v2_f32.bolt
 option is -l [loopTime], value is: 1
 Input Tensor Dimension: dt:6 df:0 dims:4(1,3,224,224)
 Illegal instruction (core dumped)
jianfeifeng commented 3 years ago

maybe just like other framework, usually set NDK path and cmake .. --some options, then build lib and binary which can be run at android with adb...

Thanks for your suggestions. We will further optimize the compilation. Supports for Windows and Mac are coming soon.

jianfeifeng commented 3 years ago
 git clone https://github.com/huawei-noah/bolt/blob/master/docs/INSTALL.md

 install ndk cmake ...
 adb pull libOpenCL ...

 sh ./third_party/install.sh -c arm_llvm -t 12
 sh ./install.sh -c arm_llvm -t 33 -g ON

 adb push install_arm_llvm /data/local/tmp/

 get caffe model from https://github.com/shicai/MobileNet-Caffe

device:/data/local/tmp/install_arm_llvm/tools # ./X2bolt -d ./models/ -m mobilenet_v2 -i FP32

 Enter './X2bolt --help' to get more usage information.
 Enter './X2bolt --version' to get the version.

 option is -d <modelDirectory>, value is: ./models/
 option is -m <modelName>, value is: mobilenet_v2
 option is -i <inferencePrecision>, value is: FP32
 Model Conversion Succeeded!

device:/data/local/tmp/install_arm_llvm/examples # ./benchmark -m ./mobilenet_v2_f32.bolt -l 1

 Please enter this command './benchmark --help' to get more usage information.
 option is -m <boltModelPath>, value is: ./mobilenet_v2_f32.bolt
 option is -l [loopTime], value is: 1
 Input Tensor Dimension: dt:6 df:0 dims:4(1,3,224,224)
 Illegal instruction (core dumped)

We think running benchmark(compiled with v7) on v8 device or running benchmark(compiled with v8) on v7 device will cause "Illegal instruction" error. Thus, could you paste what compilation options(https://github.com/huawei-noah/bolt/blob/master/common/cmakes/bolt.cmake) you set when compling bolt ? Pay particular attention to these two options:https://github.com/huawei-noah/bolt/blob/6e4017cc4102d487ef5a024447871309247860fd/common/cmakes/bolt.cmake#L24 and https://github.com/huawei-noah/bolt/blob/6e4017cc4102d487ef5a024447871309247860fd/common/cmakes/bolt.cmake#L25. If possible, you can print out the COMMON_FLAGS below https://github.com/huawei-noah/bolt/blob/6e4017cc4102d487ef5a024447871309247860fd/common/cmakes/bolt.cmake#L46.

maxfy1992 commented 3 years ago

thanks for your suggestion.. And where can I find XX.bolt in https://github.com/huawei-noah/bolt/blob/master/docs/BENCHMARK.md, would you supply a benchmark model zoo ?

jianfeifeng commented 3 years ago

thanks for your suggestion.. And where can I find XX.bolt in https://github.com/huawei-noah/bolt/blob/master/docs/BENCHMARK.md, would you supply a benchmark model zoo ?

You're welcome. For users' convenience, a benchmark model zoo will be provided for you all in the next version. Given that some models of Huawei Noah's Ark Lab mentioned in benchmark report are not open-source, maybe just the open-source models will be opened to you. Welcome to explore bolt further, any question or issue can be submitted to us, and we will reply to you as soon as possible.

maxfy1992 commented 3 years ago

just some fake models, like mobilenet_v1 v2 v3 shufflenet ...

jianfeifeng commented 3 years ago

just some fake models, like mobilenet_v1 v2 v3 shufflenet ...

Ok,we got it. And I highly recommend that you can use X2bolt to convert Mobilenet(v1/v2) , Resnet50, Squeezenet(1.0/1.1) to XXX.bolt. X2bolt is quite easy to use and you can run "X2bolt --help" for the detailed usage.

maxfy1992 commented 3 years ago

ok.. thx