ZIP人反对如果方法非法方法非法方法非法方法 7.21KB

weixin_44013626需要积分:2(1积分=1元)

资源文件列表:

tvm-riscv-deploy-main.zip 大约有7个文件
  1. tvm-riscv-deploy-main/
  2. tvm-riscv-deploy-main/Qemu_usage.md 4.09KB
  3. tvm-riscv-deploy-main/README.md 2.98KB
  4. tvm-riscv-deploy-main/cpp_deploy.cc 1.59KB
  5. tvm-riscv-deploy-main/prepare_test_libs.py 889B
  6. tvm-riscv-deploy-main/python_deploy.py 1.16KB
  7. tvm-riscv-deploy-main/tvm_runtime_pack.cc 3.42KB

资源介绍:

人反对如果方法非法方法非法方法非法方法
# tvm-riscv-deploy This repository demonstrates how to deploy the TVM compiler on a RISC-V architecture using ResNet18. ## Step 1: Setting up TVM Follow these steps, which are adapted from the [TVM Install from Source](http://tvm.apache.org/docs/install/from_source.html) page. ### Clone the repository ```bash git clone --recursive --branch int4_direct_HWNC http://github.com/zachzzc/incubator-tvm.git ~/tvm ``` ### Install LLVM ```bash sudo bash -c "$(wget -O - http://apt.llvm.org/llvm.sh)" ``` ### Install build dependencies ```bash sudo apt-get update sudo apt-get install -y python3 python3-dev python3-setuptools gcc libtinfo-dev zlib1g-dev build-essential cmake libedit-dev libxml2-dev ``` ### Build TVM Navigate to the TVM directory, create a build directory, and copy the `config.cmake` file. ```bash cd ~/tvm mkdir build cp cmake/config.cmake build ``` Edit `build/config.cmake` to customize compilation options: - Change `set(USE_LLVM OFF)` to `set(USE_LLVM /path/to/llvm-config)` to build with LLVM (replace `/path/to/llvm-config` with the actual path, such as `/usr/lib/llvm-10/bin/llvm-config`). Then compile TVM: ```bash cd build cmake .. make -j4 ``` ### Install the TVM Python package Add the following lines to `~/.bashrc`: ```bash export TVM_HOME=/path/to/tvm export PYTHONPATH=$TVM_HOME/python:$TVM_HOME/topi/python:$TVM_HOME/nnvm/python:${PYTHONPATH} ``` Source `~/.bashrc` to apply the changes: ```bash source ~/.bashrc ``` ### Install Python dependencies Install the necessary dependencies: ```bash pip3 install --user numpy decorator attrs ``` ## Step 2: Install RISC-V GNU Compiler Toolchain ```bash sudo apt update sudo apt install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu ``` Compile the TVM runtime for RISC-V: ```bash riscv64-linux-gnu-g++ -c -std=c++17 -O2 -fPIC -I/home/tvm/include -I/home/tvm/3rdparty/dmlc-core/include -I/home/tvm/3rdparty/dlpack/include -DDMLC_USE_LOGGING_LIBRARY=\<tvm/runtime/logging.h\> -o lib/libtvm_runtime_pack.o tvm_runtime_pack.cc ``` This will generate the `libtvm_runtime_pack.o` file. ## Step 3: Generate `test_resnet18.so` Use `prepare_test_libs.py` to generate the `test_resnet18.so` file. ## Step 4: Compile the Deployment Package ```bash riscv64-linux-gnu-g++ -std=c++17 -O2 -fPIC -I/home/tvm/include -I/home/tvm/3rdparty/dmlc-core/include -I/home/tvm/3rdparty/dlpack/include -DDMLC_USE_LOGGING_LIBRARY=\<tvm/runtime/logging.h\> -o lib/cpp_deploy_pack cpp_deploy.cc lib/test_resnet18.so lib/libtvm_runtime_pack.o -L/home/tvm/build -ldl -pthread ``` This will create the `cpp_deploy_pack` executable. ## Step 5: Running on RISC-V Processor or Emulator If you do not have a RISC-V processor to execute, you can use the QEMU emulator. For more information, please read `Qemu_usage.md`. Transfer the `cpp_deploy_pack` executable and `lib/test_resnet18.so` to riscv64 file system and execute to get the results. ```bash ./cpp_deploy_pack ``` With these steps, you have successfully deployed ResNet18 using the TVM compiler on a RISC-V processor and performed an inference.
100+评论
captcha
    类型标题大小时间
    ZIP弹道导弹的点点滴滴的点点滴滴的点点滴滴的43.28MB7月前
    ZIP雷赛控制卡 2410 驱动9.38MB7月前
    ZIP[教务通24-132]关于2024级《体育与健康1》课程选项课选课的通知.zip2.19MB7月前
    ZIPESP32C3-SuperMini 的PlatformIO支持文件2.16KB7月前
    ZIP修改后4学分课件.zip4.88MB7月前
    ZIP中小学学科答题小程序 v1.106.49MB7月前
    ZIPsystem view6.0安装包37.69MB7月前
    ZIPsqlite免安装工具,解压即用,支持查询,就是小5.43MB7月前