Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#502 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
kotlin
Ambito
performance

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Kotlin
Stelle
8
Fork
3
Merge medio
1g 16h
PR unite (30g)
48

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SKaiNET-developers/SKaiNET-transformers

Tutte le issue di SKaiNET-developers/SKaiNET-transformers

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.