Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[bitnet] planesHeadFromEmbedding takes ~45 s single-threaded at load (tied 128k×2560 head) — parallelise, cache or AOT-convert

Đang mở
#502 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
kotlin
Lĩnh vực
performance

Hướng nghiên cứu

Start with BitNetWeightLoader.kt, especially planesHeadFromEmbedding, and trace the call into BitNetPlanesTensorData.kt and TernaryCodec.kt. Compare the suggested approaches and identify how to measure the conversion during model loading. Done means the tied head is converted faster or reused on subsequent loads, with the output remaining compatible with the existing lossless requantise path.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement skill:kotlin-core

Problem

Loading BitNet b1.58 2B4T (microsoft/bitnet-b1.58-2B-4T-gguf, I2_S) spends about 45 s on a single thread building the two-stage lm_head. The model has a tied head, so BitNetWeightLoader.planesHeadFromEmbedding encodes the 128256 × 2560 token_embd into BITNET_PLANES.

Main-thread stack about 45 s into a load:

at sk.ainet.lang.memory.TernaryCodec.encodeBitNetPlanes(TernaryCodec.kt:220)
at sk.ainet.lang.tensor.data.BitNetPlanesTensorData$Companion.fromFloats(BitNetPlanesTensorData.kt:78)
at sk.ainet.models.bitnet.BitNetWeightLoader.planesHeadFromEmbedding(BitNetWeightLoader.kt:170)
at sk.ainet.models.bitnet.BitNetWeightLoader.loadRuntimeWeights(BitNetWeightLoader.kt:140)

mpstat during load shows one core at 91–100 % and the other three idle for about 40 s.

Setup

Arduino Ventuno Q (QCS8275, 4× Cortex-A78C), Temurin 21, SKaiNET-transformers develop @ a92d65e, engine 0.61.0, skainet-cli.

Suggestions (any one helps)

  1. Parallelise the encode across rows. The rows are independent; each has its own FP16 scale and planes.
  2. Cache the encoded head next to the GGUF, keyed by the file's hash, so the second and later loads are instant.
  3. AOT-convert the head as part of a blueprint or cartridge convert step, shipping a GGUF or sidecar with output.weight already in planes form. The lossless requantise path for files that have output.weight already exists.

On edge boards this 45 s dominates time-to-first-token, and it runs on every start.

Ngôn ngữ chính
Kotlin
Star
8
Fork
3
Merge trung bình
12 giờ 43 phút
Pull request đã merge (30 ngày)
39

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của SKaiNET-developers/SKaiNET-transformers

Tất cả issue của SKaiNET-developers/SKaiNET-transformers

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.