Skip to content

ktransformers@94ab2de with working API endpoint

Choose a tag to compare

@ubergarm ubergarm released this 22 Feb 17:33
· 161 commits to main since this release
94ab2de

This binary .whl is newer than v0.2.1 even though the package version still says that because python setup.py version is difficult. Version tag v0.2.1ktransformers@65d73ea has bugs that cause API endpoint and website to hallucinate. The release I compile here fixes the issues and works good for API endpoint! There is no real v0.3, that is just some thing they compiled with special Intel compiler to enable AMX but it is older code and still has the bugs and only works with local chat demo.

The only way to know what version you have is to check git rev-parse --short HEAD.

I built ktransformers@94ab2de following this guide and have it working on a couple different machines with $ nvidia-smi listed below.

It runs about 2x faster than llama.cpp currently, but requires your rig has at least one 16GB+ VRAM GPU. Stick to llama.cpp for pure CPU inferencing for now.

I couldn't figure out how to update setup.py to add the git rev-parse --short HEAD into the cheese .whl file as that is too byzantine for me. Can't even change the filename or it won't install lol.

$ sha256sum 94ab2de/ktransformers-0.2.1.post1+cu120torch26fancy-cp311-cp311-linux_x86_64.whl
96a9c9b0ea5b4b45ea4ca3d3c51d2a9afe44875f9bb33a91431b9b83faf86070  94ab2de/ktransformers-0.2.1.post1+cu120torch26fancy-cp311-cp311-linux_x86_64.whl

Tested Successfully

NVIDIA-SMI 570.86.16 Driver Version: 570.86.16 CUDA Version: 12.8
NVIDIA-SMI 570.86.15 Driver Version: 570.86.15 CUDA Version: 12.8


  1. 版本管理问题

    • 版本标签 v0.2.1(对应提交 ktransformers@65d73ea)存在缺陷:
      该版本会导致API端点及网站产生异常输出(如“幻觉”问题)。
    • 当前修复版本:
      我在此处编译的版本(基于提交 ktransformers@94ab2de)已修复相关问题,API端点运行正常。
  2. 关于所谓的“v0.3”版本

    • 非官方版本:
      “v0.3”并非真实版本号,实为使用特殊Intel编译器手动构建的版本,目的是启用AMX(高级矩阵指令集)支持。
    • 代码状态:
      此版本基于旧代码(仍包含未修复的缺陷),仅适用于本地聊天演示,不推荐用于生产环境。
  3. 版本确认方法

    • 唯一可靠标识:
      实际版本需通过命令 git rev-parse --short HEAD 查看Git提交哈希,版本号本身无参考价值。
  4. 编译与运行环境

    • 构建指南:
      我按照 此指南 成功编译了
      ktransformers@94ab2de,并在多台设备(通过 $ nvidia-smi 确认GPU状态)验证其运行。
    • 性能对比:
      当前版本推理速度约为 llama.cpp 的两倍,但需满足:
      • 至少配备一块 16GB+ 显存的GPU(如NVIDIA系列)。
      • 纯CPU推理仍建议使用 llama.cpp。
  5. 已知限制

    • setup.py 修改难题:
      尝试将 git rev-parse --short HEAD 注入 .whl 文件时,因Python打包逻辑复杂未能成功。
    • 文件名依赖:
      若手动修改生成的 .whl 文件名,会导致安装失败(原文件名强制依赖)。