Skip to content

Edge Deployment of HY-MT1.5-1.8B

Introduction

HY-MT1.5-1.8B is version 1.5 of the Hunyuan translation model released by Tencent. As an upgraded version of the WMT25 championship model, it is optimized for explanatory translation and mixed-language scenarios, and adds support for terminology intervention, contextual translation, and formatted translation. Although HY-MT1.5-1.8B has less than one-third the parameter count of HY-MT1.5-7B, its translation performance is comparable to that of the larger model, balancing high speed with high quality. After quantization, the 1.8B model can be deployed on edge devices and supports real-time translation scenarios, offering broad application prospects.

This chapter demonstrates how to complete the deployment, loading, and translation process of HY-MT1.5-1.8B on edge devices. The following deployment method is provided:

  • AidGen C++ API

In this case, the large language model inference runs on the device side, and the relevant interfaces are called through code to receive user input and return conversation results in real time.

  • Device: IQ9075
  • System: Ubuntu 24.04
  • Model: HY-MT1.5-1.8B

Supported Platforms

PlatformRunning Method
IQ9075Ubuntu 24.04

Prerequisites

  1. IQ9075 hardware

  2. Ubuntu 24.04 system

System Dependency Configuration

Configure the AidLux Repository

bash
# Download the correct public key
sudo wget -O- https://archive.aidlux.com/ubuntu24/public.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/private-aidlux.gpg > /dev/null

# Edit the source file
sudo vim /etc/apt/sources.list.d/private-aidlux.list

# Add the private key provided by AidLux to the source file
deb [arch=arm64 signed-by=/etc/apt/trusted.gpg.d/private-aidlux.gpg] https://archive.aidlux.com/ubuntu24 noble main

# Update the cache
sudo apt update

After the update, you can obtain the official AidLux SDK dependencies with the following command:

bash
sudo apt list | grep aid | grep unknown
bash
# Install software
# Must be installed first; not included with the system
sudo apt install python3 python3-pip libopencv-dev python3-opencv  net-tools
# Required before installing aidlite
sudo apt install aidlux-aistack-base aidrtcm

# Install aidlite and its dependencies
sudo apt install aid-lms aidlms-sdk aidlite-sdk cmake
sudo apt-get install libfmt-dev nlohmann-json3-dev
sudo apt install aidlite-*

# Enable DSP support
sudo apt-get install qcom-fastrpc1
sudo apt-get install qcom-fastrpc-dev

# Install the aidgen SDK
sudo apt install aidgen-sdk
sudo apt install aidgen-qnn*

# Install the mms service
sudo apt install aid-mms

# Enable GPU support
sudo apt-add-repository -s ppa:ubuntu-qcom-iot/qcom-ppa
sudo apt install qcom-adreno-cl1
sudo ln -s /usr/lib/aarch64-linux-gnu/libOpenCL.so.1 /usr/lib/aarch64-linux-gnu/libOpenCL.so

After installation, check that the aidlite and aidgen directories have been added under /usr/local/share.

Device Authorization

Obtain the Device SN Code

bash
cat  /sys/devices/soc0/serial_number

Obtain the License File

Provide the SN code to the Aplux technical staff to generate a device-specific License file, and place it under /etc/opt/aidlux/license/AidLuxLics.

Activate Authorization

bash
sudo /opt/aidlux/cpf/aid-lms/manager.sh restart

AidGen Case Deployment

Step 1: Copy the AidGen SDK Code Examples

bash
# Copy the test code
cd ~/aidllm

cp -r /usr/local/share/aidgen/examples/ ./

Step 2: Download Model Resources

Since HY-MT1.5-1.8B is currently in the Model Farm preview section, it must be retrieved via the mms command.

Using mms requires logging in with a Model Farm account. Please visit Model Farm account registration

bash
# Log in
mms login

# Search for the model
mms list HY

# Download the model
mms get -m HY-MT1.5-1.8B -p w4a16 -c qcs9075 -b qnn2.36 -d ~/aidllm/

cd ~/aidllm/
unzip qnn236_qcs9075_cl2048.zip

Step 3: Confirm Resource Files

The file distribution is as follows:

bash
~/aidllm
├── hy-mt1.5-1.8b_qnn236_qcs9075_cl2048_2_of_2.serialized.bin.aidem
├── hy-mt1.5-1.8b_qnn236_qcs9075_cl2048_1_of_2.serialized.bin.aidem
├── htp_backend_ext_config.json
├── chat.txt
├── aidgen_config.json
├── aidgen_chat_template.txt
├── prefix-kvcache

Step 4: Set the Conversation Template

💡Note

For the conversation template, refer to the chat.txt file in the model resource package.

Modify the test_aidgen_t2t.cpp file according to the large model's template:

cpp
std::string system_prompt =
    "<|hy_begin▁of▁sentence|><|hy_place▁holder▁no▁3|>\n"
    "<|hy_begin▁of▁sentence|>\n"
    "<|hy_User|>Translate the following segment into Chinese, without additional explanation.\n\n";
// User turn: wraps the user input and triggers assistant generation
auto make_user_turn = [](const std::string& text) -> std::string {
return text + "\n<|hy_Assistant|>";
};

Step 5: Compile and Run

bash
# Install dependencies
cd ~/aidllm/examples

# Compile
mkdir build && cd build
cmake .. && make

cp ./test_t2t ../../qnn236_qcs9075_cl2048

cd ~/aidllm/qnn236_qcs9075_cl2048
./test_t2t aidgen_config.json "Success is not final, failure is not fatal: it is the courage to continue that counts. Believe in yourself and all that you are, for greatness lives within your soul."
  • After the model runs successfully, the following log output is displayed:
bash
============================================================
  Turn 1: Single-turn inference
============================================================
User: Success is not final, failure is not fatal: it is the courage to continue that counts. Believe in yourself and all that you are, for greatness lives within your soul.
Assistant: [API] Generator::run(prompt, callback)
[BOS]Success is not the destination, and failure is not a fatal disaster. What matters is having the courage to keep moving forward. Believe in yourself, and in everything you have. For greatness resides in your soul.<|hy_place▁holder▁no▁2|>[EOS]

--- Turn 1 Performance (Generator::get_profiler) ---
  Init Time (us):           890366
  Prompt Token Count:       53
  Time-to-First-Token (us): 64775
  Prompt TPS (tok/s):       1976.07
  Generated Token Count:    34
  Generate Time (us):       905709
  Generate TPS (tok/s):     37.5396