issue/1569 - 为 NVIDIA 后端增加可复用的 GGUF 线性层与 BlockFP8 支持 - #1570
Open
xindongliu594 wants to merge 4 commits into
Open
xindongliu594 wants to merge 4 commits into
xindongliu594 wants to merge 4 commits into
Conversation
46 tasks
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.
关联 Issue
Closes #1569
概要
linear_gguf算子,支持Q8_0、Q4_K、Q5_K和Q6_K。动机
InfiniLM 的 Qwen3.5 / Qwen3-Next GGUF Route B 需要直接执行 GGML block-quantized 权重。若把解量化和矩阵计算分别写入模型代码,会造成重复实现,也无法被其他 GGUF 模型复用。
本 PR 将能力下沉为通用算子:InfiniCore 负责 block layout、校验、workspace 和 NVIDIA kernel;InfiniLM 只负责模型权重映射、融合关系和少量模型特有重排。
主要变更
linear_ggufQ8_0/Q4_K/Q5_K/Q6_Kblock layout;block_fp8_linearscripts/python_test.py;test/infiniop/linear_gguf.py与test/infiniop/block_fp8_linear.py;测试结果
CORE_LINK_BUILTldd -r与隔离 Python importlinear_gguf官方测试block_fp8_linear官方测试c3440e6d最终测试截图
性能影响
同一 RTX 5090、同一 Qwen3.5/Qwen3-Next 27B Q6_K GGUF、相同配置与 warmup,三次测量取中位数:
测试按“新实现后旧实现”顺序执行,并非随机交替试验;decode 的约 6% 差异不归因于本 PR。当前性能仍低于 llama.cpp,本 PR 不宣称达到 llama.cpp 水平。
兼容性与范围
Review 建议
建议重点检查: