目录

Overview

CANN LM Engine is a large model inference solution built upon CANN Kit. It provides unified acceleration encapsulation for compute pipelines and compute acceleration for large model workloads.

The Large Language Model (LLM) Engine is one of its specific application scenarios. In this scenario, it encapsulates the LLM compute pipelines with high-efficiency multi-step orchestration, memory reuse, and zero-copy data transfer. Additionally, it offers features including LoRA extension, multimodal extension, memory optimization, KV cache management optimization, speculative decoding, and device-cloud collaborative computing. These features ensure optimal energy efficiency and minimal system resource footprint. A comprehensive toolchain is also provided to assist you with model quantization, NPU affinity adaptation, and model conversion.

CANN LM Engine Component

Model Requirement

The current version supports the Qwen2.5-1.5B, DeepSeek-R1-Distill-Qwen-1.5B, Glm-1.5b, Qwen2.5-7B-Instruct, and Qwen3-8B models.

Hardware

kirin X90 platform.

Quick Start

Based on the CANN hardware acceleration capability, the CANN LLM Engine provides high-performance and low-power LLMs, helping users obtain better experience based on the CANN hardware environment.

You can follow the pipeline sequence below to integrate an LLM into the CANN hardware environment:

  1. Quantize the LLM. The input is the original model, and the output is the quantized weight and quantization parameter file.

  2. Export the model structure to the ONNX format. The input is the original model structure and the quantized weight generated in the first step, and the output is the ONNX model and the NPU affinity adaptation of the model structure.

  3. Convert the ONNX model to the CANN model structure format. The input is the ONNX model and quantization parameter file, and the output is the model defined in CANN format.

  4. Integrate the LLM based on the CANN LLM Engine.