Skip to content

Commit b6be61a

Browse files
neuropilot-captainMediaTek-ai
authored andcommitted
Move README under mediatek/ Fix some typo
1 parent 39e5b91 commit b6be61a

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed
Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
1-
# Build Instructions
1+
# MediaTek Backend on ExecuTorch
2+
MediaTek backend allows ExecuTorch to speed up PyTorh models on edge devices that equips with MediaTek Neuron Processing Unit (NPU). This document provides a step-by-step guide to set up the build environment for the MediaTek ExecuTorch libraries.
23

3-
This document provides a step-by-step guide to set up the build environment for the MediaTek ExercuTorch libraries.
4+
## Supported Chips
45

5-
## Prerequisites
6+
The examples provided in this repository are tested and supported on the following MediaTek chip:
7+
8+
- MediaTek Dimensity 9300 (D9300)
9+
10+
## Build Instructions
11+
12+
### Prerequisites
613

714
Before you begin, ensure you have the following prerequisites installed and configured:
815

9-
### 1. Buck2 Build Tool
16+
#### 1. Buck2 Build Tool
1017

1118
- **Download Buck2**: Obtain Buck2 from the official [releases page](https://github.com/facebook/buck2/releases/tag/2024-02-01).
1219
- **Add to PATH**: Extract the downloaded file and add the directory to your system's `$PATH` environment variable.
1320
```bash
1421
export PATH=<path_to_buck>:$PATH
1522
```
1623

17-
### 2. Android NDK
24+
#### 2. Android NDK
1825

1926
- **Download Android NDK**: Acquire the Android NDK version 26.3.11579264 from the [Android developer site](https://developer.android.com/ndk/downloads).
2027
- **Set NDK Path**: Ensure that the `$ANDROID_NDK` environment variable is set to the path where the NDK is located.
2128
```bash
2229
export ANDROID_NDK=<path_to_android_ndk>
2330
```
2431

25-
### 3. MediaTek ExercuTorch Libraries
32+
#### 3. MediaTek ExecuTorch Libraries
2633

2734
Download [NeuroPilot Express SDK](https://neuropilot.mediatek.com/resources/public/npexpress/en/docs/npexpress) from MediaTek's NeuroPilot portal:
2835

@@ -31,11 +38,11 @@ Download [NeuroPilot Express SDK](https://neuropilot.mediatek.com/resources/publ
3138
- `mtk_converter-8.8.0.dev20240723+public.d1467db9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl`: This library preprocess the model into a MediaTek representation.
3239
- `mtk_neuron-8.2.2-py3-none-linux_x86_64.whl`: This library converts the model to binaries.
3340

34-
## Setup
41+
### Setup
3542

3643
Follow the steps below to setup your build environment:
3744

38-
1. **Setup ExercuTorch Environment**: Refer to the [Setting up ExercuTorch](https://pytorch.org/executorch/stable/getting-started-setup) guide for detailed instructions on setting up the ExercuTorch environment.
45+
1. **Setup ExecuTorch Environment**: Refer to the [Setting up ExecuTorch](https://pytorch.org/executorch/stable/getting-started-setup) guide for detailed instructions on setting up the ExecuTorch environment.
3946

4047
2. **Setup MediaTek Backend Environment**
4148
- Install the dependent libs. Ensure that you are inside backends/mediatek/ directory
@@ -52,18 +59,21 @@ Follow the steps below to setup your build environment:
5259
export NEURON_BUFFER_ALLOCATOR_LIB=<path_to_buffer_allocator>
5360
```
5461

55-
## Build
62+
### Build
63+
1. Navigate to `scripts/` directory.
5664

57-
1. **Build MediaTek Backend**: Once the prerequisites are in place, run the `mtk_build.sh` script to start the build process, MediaTek backend will be built under `cmake-android-out/backends/` as `libneuron_backend.so`
65+
2. **Build MediaTek Backend**: Once the prerequisites are in place, run the `mtk_build.sh` script to start the build process, MediaTek backend will be built under `cmake-android-out/backends/` as `libneuron_backend.so`
5866

5967
```bash
6068
./mtk_build.sh
6169
```
6270

63-
## Run
71+
### Run
6472

65-
1. **Push MediaTek universal SDK and MediaTek backend to the device**: push `libneuronusdk_adapter.mtk.so` and `libneuron_backend.so` to the phone and export it to the `$LD_LIBRARY_PATH` environment variable before executing ExercuTorch with MediaTek backend.
73+
1. **Push MediaTek universal SDK and MediaTek backend to the device**: push `libneuronusdk_adapter.mtk.so` and `libneuron_backend.so` to the phone and export it to the `$LD_LIBRARY_PATH` environment variable before executing ExecuTorch with MediaTek backend.
6674

6775
```bash
6876
export LD_LIBRARY_PATH=<path_to_usdk>:<path_to_neuron_backend>:$LD_LIBRARY_PATH
6977
```
78+
79+
Please refer to `executorch/examples/mediatek/` for export and execution examples of various of models.

0 commit comments

Comments
 (0)