Environmental Deployment

This section introduces how to complete the environment deployment required for the D-Robotics-LLM model on both the development machine and the end-side device.

Development Environment Deployment

Deployment Package Preparation

Download the D-Robotics_LLM_{version}.tar.gz installation package provided by us and extract it correctly.

Install the Conda Environment

Note

If you have already installed the Conda environment, please skip this step.

To facilitate the management of the Python environment, we recommend using Miniforge3 as the Python package management tool.

  1. Download the Miniforge3 installation package:

    wget -c https://mirrors.bfsu.edu.cn/github-release/conda-forge/miniforge/LatestRelease/Miniforge3-Linux-x86_64.sh
  2. Install the Miniforge3:

    chmod 777 Miniforge3-Linux-x86_64.sh sh Miniforge3-Linux-x86_64.sh

Set Up the Conda Environment

  1. Enter the Conda base environment, refer to the following command:

    # ~/miniforge3 is the default installation path for Miniforge3, please choose the path based on your actual situation. source ~/miniforge3/bin/activate (base) xxx@xxx:~$
  2. Create a python3.10 environment and switch to the environment, refer to the following command:

    conda create -n oellm python=3.10

    Enter the oellm conda environment:

    conda activate oellm # (oellm) xxx@xxx:~$

    Install the required Python environment:

    pip install -r ./oellm_build/requirements.txt

Install the other files in the deployment package

After setting up the Conda environment, you need to continue installing the model quantization, conversion, and compilation toolkits included in the LLM deployment package. Refer to the following commands:

pip install ./oellm_build/hbdk4_compiler-{version}-cp310-cp310-manylinux_2_17_x86_64.whl pip install ./oellm_build/hbdk4_runtime_aarch64_unknown_linux_gnu_nash-{version}-py3-none-any.whl pip install ./oellm_build/leap_llm-{version}-py310-none-any.whl

At this point, we have completed the installation and setup of the development environment.

Runtime Environment Setup

Preparing the Runtime Environment

At this stage, it is necessary to verify the availability of the runtime environment to ensure it can be used for actual on-board program execution.

Cross-Compilation Toolchain Configuration

The LLM deployment package includes an installer for the cross-compilation toolchain. On the target device, simply create a directory and extract the installer, using the following commands as a reference:

Warning

Please note that this process requires root privileges.

sudo mkdir -p /opt/aarch64/ sudo tar -xvf arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz -C /opt/aarch64/

After extraction, configure the environment variables to check the build toolchain, using the following commands as a reference:

export LINARO_GCC_ROOT=/opt/aarch64/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu

So far, we have completed the installation and deployment of the development environment. Please refer to the subsequent sections to learn how to use D-Robotics-LLM for the quantization conversion and board-side deployment of large models.