Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions backends/mediatek/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ MediaTek backend empowers ExecuTorch to speed up PyTorch models on edge devices
The examples provided in this repository are tested and supported on the following MediaTek chip:

- MediaTek Dimensity 9300 (D9300)
- MediaTek Dimensity 9400 (D9400)

## Build Instructions

Expand All @@ -31,13 +32,17 @@ Before you begin, ensure you have the following prerequisites installed and conf

#### 3. MediaTek ExecuTorch Libraries

Download [NeuroPilot Express SDK](https://neuropilot.mediatek.com/resources/public/npexpress/en/docs/npexpress) from MediaTek's NeuroPilot portal:
To get started with MediaTek's ExecuTorch libraries, download the [NeuroPilot Express SDK](https://neuropilot.mediatek.com/resources/public/npexpress/en/docs/npexpress) from MediaTek's NeuroPilot portal. The SDK includes the following components:

- `libneuronusdk_adapter.mtk.so`: This universal SDK contains the implementation required for executing target-dependent code on the MediaTek chip.
- `libneuron_buffer_allocator.so`: This utility library is designed for allocating DMA buffers necessary for model inference.
- `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.
- `mtk_neuron-8.2.2-py3-none-linux_x86_64.whl`: This library converts the model to binaries.
- Copy `NeuronAdapter.h` under `backends/mediatek/runtime/include/api/`.
- **`libneuronusdk_adapter.mtk.so`**: This universal SDK contains the implementation required for executing target-dependent code on the MediaTek chip.

- **`libneuron_buffer_allocator.so`**: This utility library is designed for allocating DMA buffers necessary for model inference.

- **`mtk_converter-8.13.0+public-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl`**: This library preprocesses the model into a MediaTek representation.

- **`mtk_neuron-8.2.19-py3-none-linux_x86_64.whl`**: This library converts the model to binaries.

Additionally, make sure to copy `NeuronAdapter.h` to the following directory: `backends/mediatek/runtime/include/api/`.

### Setup

Expand All @@ -52,8 +57,8 @@ Follow the steps below to setup your build environment:
```
- Install the two .whl downloaded from NeuroPilot Portal
```bash
pip3 install mtk_neuron-8.2.2-py3-none-linux_x86_64.whl
pip3 install mtk_converter-8.8.0.dev20240723+public.d1467db9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pip3 install mtk_neuron-8.2.19-py3-none-linux_x86_64.whl
pip3 install mtk_converter-8.13.0+public-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
```
- Set evironment variables for building backend
```bash
Expand Down
9 changes: 5 additions & 4 deletions docs/source/backends-mediatek.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ MediaTek backend empowers ExecuTorch to speed up PyTorch models on edge devices

### Supported Chips:
- MediaTek Dimensity 9300 (D9300)
- MediaTek Dimensity 9400 (D9400)

### Software:

Expand All @@ -37,19 +38,19 @@ Follow the steps below to setup your build environment:
1. **Setup ExecuTorch Environment**: Refer to the [Getting Started](getting-started.md) guide for detailed instructions on setting up the ExecuTorch environment.

2. **Setup MediaTek Backend Environment**
- Install the dependent libs. Ensure that you are inside `backends/mediatek/` directory
```bash
pip3 install -r requirements.txt
```
- Install the two .whl downloaded from NeuroPilot Portal
```bash
pip3 install mtk_neuron-8.2.13-py3-none-linux_x86_64.whl
pip3 install mtk_converter-8.9.1+public-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pip3 install mtk_neuron-8.2.19-py3-none-linux_x86_64.whl
pip3 install mtk_converter-8.13.0+public-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
```
- Set evironment variables for building backend
```bash
export NEURON_BUFFER_ALLOCATOR_LIB=<path_to_buffer_allocator.so>
export NEURON_BUFFER_ALLOCATOR_LIB=<path_to_buffer_allocator>
```
Additionally, make sure to copy `NeuronAdapter.h` to the following directory: `backends/mediatek/runtime/include/api/`.

## Build

Expand Down
Loading