Skip to main content

A lightweight, effective and easy-to-extend inference runtime

Project description

xlite logo

Xlite轻量化推理运行时

介绍

xlite (GVirt前端):轻量级Transformer模型运行时,支持多样性算力协同,当前支持在昇腾硬件上高效运行。 xlite公开了Transformer运行所需的模型构图以及算子,所有算子基于昇腾AscendC/CCE开发。

背景与动机

在大模型推理场景中,传统的单流串行执行模式存在以下问题:

  • 核间负载不均:不同AICORE之间的任务分配不均衡,部分核心闲置
  • 资源浪费多:计算资源和传输资源利用率低,存在显著浪费
  • 执行时间长:Host CPU下发算子开销大,造成严重的host bond问题

xlite通过以下技术手段解决上述问题:

  • 多流并行:充分利用卡内资源,将单流串行改为多流并行执行
  • 核间负载均衡:核间负载均衡,提升资源利用率
  • CPU NPU协同:C++侧完全消除Python的GC、线程等干扰,简化Host tiling计算,去除小块内存申请释放及拷贝,消除Host bond

性能效果显著:

在GLM-4.7双机推理场景(40K输入、1K输出、prefix cache命中率约90%)下:

  • TPOT时延降低17%~30%
  • 吞吐提升13%~41%

详细性能数据参考 PR #7935

软件架构

image

xlite已适配vllm_ascend,可通过xlite_graph_config配置快速使能xlite加速效果,使用方法参考官方指导文档

xlite支持模型见模型列表

快速开始

安装

# 安装vllm_ascend, 可参考https://github.com/vllm-project/vllm-ascend/blob/main/README.md
# 安装xlite
pip install xlite

离线推理示例

import os
from vllm import LLM

# xlite默认支持decode-only模式, 可通过设置 "full_mode": True 使能full模式
model = LLM(model="path/to/Qwen3-32B", tensor_parallel_size=8, additional_config={"xlite_graph_config": {"enabled": True, "full_mode": True}})
outputs = model.generate("Hello, how are you?")

在线服务示例

vllm serve path/to/Qwen3-32B --tensor-parallel-size 8 --additional-config='{"xlite_graph_config": {"enabled": true, "full_mode": true}}'

开发指南

编译构建、容器镜像、源码安装等开发相关内容,请参考 开发指南

环境变量

xlite使用的环境变量及其配置方法,请参考 环境变量

目录结构

.
├── csrc/    - 轻量化运行时的核心代码
├── xlite/   - python代码,包括tools等
├── doc/     - 相关文档介绍
├── docker/  - 容器镜像Dockerfile
└── tests/   - 测试用例

致谢

本项目的核心算子初始版本和思路来自于华为终端小艺AI Infra团队的贡献,相关优化实现可参考论文:

《XY-Serve: End-to-End Versatile Production Serving for Dynamic LLM Workloads》 [ASPLOS 2026]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

xlite-0.1.0rc10.dev210-cp312-cp312-manylinux2014_x86_64.whl (793.3 kB view details)

Uploaded CPython 3.12

xlite-0.1.0rc10.dev210-cp312-cp312-manylinux2014_aarch64.whl (746.7 kB view details)

Uploaded CPython 3.12

xlite-0.1.0rc10.dev210-cp311-cp311-manylinux2014_x86_64.whl (782.7 kB view details)

Uploaded CPython 3.11

xlite-0.1.0rc10.dev210-cp311-cp311-manylinux2014_aarch64.whl (746.1 kB view details)

Uploaded CPython 3.11

File details

Details for the file xlite-0.1.0rc10.dev210-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for xlite-0.1.0rc10.dev210-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 06934c9ec73dbb3f280957461657f0f6993890fb69e3f16ffebdeaa8be09ce7c
MD5 84e3b3a2ff6ae34365cecafaf43c374b
BLAKE2b-256 b0c780c7e859a578c3b273ebaf2b8b588bbb5e60fe0fdb9f992b4b99c83a88eb

See more details on using hashes here.

File details

Details for the file xlite-0.1.0rc10.dev210-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for xlite-0.1.0rc10.dev210-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7bd86db5a35a06ea0a3b05256dd8b54e3647884ca845c47d6e7cd1237794c6cc
MD5 4dba2d54b91654182985608d59be9f3d
BLAKE2b-256 7c29c0bfb8319eaed741df14af4f47ad4da146f570f2d6783a2e0eee51cf03c1

See more details on using hashes here.

File details

Details for the file xlite-0.1.0rc10.dev210-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for xlite-0.1.0rc10.dev210-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 37203c57182128fa9da96d6e6cda9dc9d2c88c7cf0e0a5cf86b9124ba0915b6a
MD5 aac1da6e530530f03de04e4c2f7067ed
BLAKE2b-256 54d72ed506a35cf182e8ed397a1df9e7eca9333b545d21ae4df1811aaae109e0

See more details on using hashes here.

File details

Details for the file xlite-0.1.0rc10.dev210-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for xlite-0.1.0rc10.dev210-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2527d4840046f77529cba14491ce1f42c3e75a78e78a0e1b02fa3ca00253dab2
MD5 f18532c0ed4006f5e7d638cedccaf844
BLAKE2b-256 69319080707b3065ca16abee6284949dc21bbd0b2d61b5b39b2a5aed957b95c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page