feat: add xlite as third npu backend (support qwen3-dense/qwen3-moe/glm-4.7/glm-5.1/glm-5.2) - #2282
Open
banxiaduhuo wants to merge 1 commit into
Open
feat: add xlite as third npu backend (support qwen3-dense/qwen3-moe/glm-4.7/glm-5.1/glm-5.2)#2282banxiaduhuo wants to merge 1 commit into
banxiaduhuo wants to merge 1 commit into
Conversation
banxiaduhuo
requested review from
DongheJin,
DragonFive,
JimHsiung,
Kang-Meng,
liujinguang0125,
liutongxuan,
ustcfy,
xiao-yu-chen,
yingxudeng,
yinjiawei01 and
zhang-minchao
as code owners
August 23, 2026 07:16
banxiaduhuo
force-pushed
the
main
branch
3 times, most recently
from
August 24, 2026 01:31
54d0229 to
a9a5b1b
Compare
…lm-4.7/glm-5.1/glm-5.2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds xlite as a third NPU backend for xLLM, alongside the existing ATB backend. xlite is a lightweight NPU inference runtime that directly calls CANN ops without the aclgraph abstraction layer, providing lower launch overhead and higher TTFT.
The adapter integrates xlite into xLLM's model layer through a thin C++ adapter (
xlite/core/layers/xlite/), supporting five model architectures out of the box:About xlite
xlite is a lightweight XPU virtualization frontend and backend inference runtime. It provides a minimalist and efficient heterogeneous computing environment, supporting diverse computing power collaboration. See https://gitcode.com/openeuler/GVirt/blob/master/README.en.md.
Key changes
xllm/core/layers/xlite/, 9 files ~1700 lines):xlite_causal_lm_base/xlite_config_builder/xlite_weight_utils/xlite_attn_meta_builder/xlite_freqs_cis/xlite_init_utils/xlite_model_adapter/xlite_register_macros. Bridges xlite'sXModelruntime into xLLM'sCausalLMBaselifecycle (load → init → forward), mapping xLLM weight tensors to xliteMatmulWeight/MoEWeightwith per-model quantization field binding.xllm/models/llm/xlite/adapters/, 5 files):qwen3_adapter/qwen3_moe_adapter/glm4_moe_adapter/glm5_adapter/deepseek_v3_adapter+register_all.h(299 lines, model registry wiring).xlite_executor_impl.cpp/h):XliteExecutorImplimplementsinit/forward/syncover xlite'sXModel::Forward, withnode_rank % device_countauto device selection (no--devicesneeded).cmake/xlite.cmake,CMakeLists.txt):USE_XLITE=ONlinkslibxlite.sofrom site-packages, propagates-L/-rpath-linkto all executables.IsW8A8(context)guard (derived fromquant_model_description.json) replaces hardcodedquantAttnWeightTrans=true, fixing a BF16 shared-expert layout regression (_isSharedExpertWeightFullis read unconditionally at construction). MLA four STATIC projections (mlaQKVA/mlaQB/attnOut/indexQB) +down_projdeqScale + shared indexer binding for GLM-5.2.Verification
功能验证
All milestones verified by smoke (
script/smoke/verify.sh, EP8 减层 functional) + EvalScope perf + msprof per-step 算子级对比 vs ATB:EvalScope perf — input_32 (decode 为主, prompt=32tok, output=128tok)
EvalScope perf — input_2000 (prefill 重 + DSA 稀疏, prompt=2000tok, output=128tok)
Related Issues
Change Type
Pull Request Checklist
Thank you for contributing to xLLM. Before requesting review, please make sure the following items are complete.
PR Title and Commit Messages
<type>: <subject>.Pre-commit Checks
pre-commitby runningpip install pre-commitor an equivalent command.pre-commit install.pre-commit run --all-filesand fixed any reported issues.Self Review
.agents/skills/code-review/references/custom-code-style.md, especially code written or assisted by AI.mainbranch.Build and Test Coverage
python setup.py build testhas passed on a CUDA machine.python setup.py build testhas passed on an NPU machine.python setup.py build testhas passed on an MLU machine.Reviewer Notes