skainet-backend-native-cpu: JVM artifact ships no linux-arm64 libskainet_kernels.so → silent ~1000× reference-kernel fallback on ARM Linux
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 58/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- cmake, kotlin, linux
调研方向
Start with the skainet-backend-native-cpu native CMake build and the JVM artifact packaging configuration; the issue says CMake already supports aarch64 and identifies the missing native/linux-arm64/libskainet_kernels.so resource. Check how the existing Linux, macOS, and Windows libraries are built and bundled, then determine how CI can build and include the ARM Linux library. Done when the published JVM artifact contains that library and ARM Linux loads a native kernel instead of falling back to the reference decoder.
由索引模型根据 Issue 内容生成。
描述
Problem
The published skainet-backend-native-cpu 0.61.0 JVM artifact bundles libskainet_kernels for linux-x86_64, macos-arm64 and windows-x86_64 only. There is no native/linux-arm64/libskainet_kernels.so, although NativeLibraryLoader already resolves that path ("aarch64", "arm64" -> "arm64").
On a linux-arm64 JVM, the loader finds nothing, so KernelDispatch has no kernel for packed weights and falls back to the reference decoder:
[SKaiNET] KernelDispatch: no kernel registered for matmul (activation=Dense(bytesPerElement=4), weight=BITNET_B1_58, order=ROW_MAJOR); falling back to the decoding reference kernel (~1000x slower). Install a kernel pack (e.g. KernelPacks.install() + FfmRowMajorKernelPack.install()) before the first forward. Further fallbacks are not reported.
Repro
- Board: Arduino Ventuno Q (QCS8275, 4× Cortex-A78C + 4× A55), Ubuntu 24.04, Temurin 21.0.12.1 (aarch64).
- SKaiNET-transformers
develop@ a92d65e::llm-apps:skainet-cli:shadowJar. unzip -l skainet-all.jar | grep native/shows onlylinux-x86_64,macos-arm64andwindows-x86_64.java --enable-preview --add-modules jdk.incubator.vector -jar skainet-all.jar -m ggml-model-i2_s.gguf -s 32 "The capital of France is"(BitNet b1.58 2B4T): one thread sits inReferenceMatmulKernel→BitNetB158TensorData.dequantizeBlock, with 0 tokens after 10.5 min.
Workaround (verified)
I cross-built the library from skainet-backends/skainet-backend-native-cpu/native at tag 0.61.0 and added it to the jar:
cmake -S native -B b -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 \
-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_BUILD_TYPE=Release
cmake --build b --target skainet_kernels
mkdir -p native/linux-arm64 && cp b/libskainet_kernels.so native/linux-arm64/
jar uf skainet-all.jar native/linux-arm64/libskainet_kernels.so
With that, the same run produces correct greedy output at 1.6–1.8 tok/s instead of the reference fallback.
Ask
- Build and bundle
native/linux-arm64/libskainet_kernels.soin the JVM artifact. The CMake file already handlesaarch64cross builds (-march=armv8.2-a+fp16+dotprod, with NeoGPU pinned toarmv8-a). A CI job usinggcc-aarch64-linux-gnuor an arm64 runner would cover it. - Consider making the "no kernel registered → reference fallback" message an error on platforms where a native pack is expected, or at least naming the missing resource path.
Related: #920 (mobile/Apple/Android JNI; this issue is the plain linux-arm64 JVM case: Raspberry Pi, Qualcomm IoT boards, Graviton).
- 主要语言
- Kotlin
- 星标
- 52
- 派生
- 15
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 63
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SKaiNET-developers/SKaiNET 的其他 Issue
-
coding size:s skill:kotlin-core sub-issue
难度 2/5 1-3 小时 新手友好度 76/100
SKaiNET-developers/SKaiNET#1421 ·
维护者通常 1 天内回复
-
coding size:s skill:kotlin-core sub-issue
难度 2/5 1-3 小时 新手友好度 78/100
SKaiNET-developers/SKaiNET#1419 ·
维护者通常 1 天内回复
-
coding good first issue size:s skill:kotlin-core sub-issue
难度 2/5 1-3 小时 新手友好度 82/100
SKaiNET-developers/SKaiNET#1418 ·
维护者通常 1 天内回复
-
coding good first issue size:xs skill:kotlin-core sub-issue
难度 2/5 1 小时以内 新手友好度 82/100
SKaiNET-developers/SKaiNET#1417 ·
维护者通常 1 天内回复
-
coding good first issue size:s skill:kotlin-core sub-issue
难度 2/5 1-3 小时 新手友好度 84/100
SKaiNET-developers/SKaiNET#1416 ·
维护者通常 1 天内回复
查看 SKaiNET-developers/SKaiNET 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
leboncoin/spark-android#2342 ·
维护者通常 1 天内回复
-
The Voraton URL has been changed可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭Bug Domain changed
难度 2/5 1-3 小时 新手友好度 62/100
keiyoushi/extensions-source#20257 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
feature
难度 2/5 1-3 小时 新手友好度 62/100
user-grinch/RivoPhoneApp#302 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
LeanBitLab/LeanType#713 · 1 条评论 ·
维护者通常 1 天内回复