TensorData and TensorStorage are parallel layers — unify the storage model (ownership, views, dtype/encoding, placement): SKEEP-003 discussion anchor
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- kotlin
调研方向
Read the TensorData code under skainet-lang-core/.../tensor/data/ alongside the 20-file TensorStorage layer under .../tensor/storage/, then trace which abstractions Tensor currently holds and where allocations and backend dispatch use them. Compare the two candidate end-states described in the issue and review the maintainer discussion; done requires a decided direction that preserves packed encodings bit-identically.
由索引模型根据 Issue 内容生成。
描述
SKaiNET carries two storage abstractions:
TensorData(skainet-lang-core/.../tensor/data/) — the live one. EveryTensorholds one; backends dispatch by downcasting to concrete classes/markers (is Q4_KTensorData -> .packedData); all common-code storage is heap arrays.TensorStorage(.../tensor/storage/, 20 files) — a designed descriptor layer with the right concepts (BufferHandle.{Owned,Borrowed,Aliased,FileBacked,DeviceResident},Placement/MemoryDomain,TensorEncoding,MemoryPlanner,StorageSpec) whose own KDoc says "new loaders, planners, and backends should targetTensorStoragedirectly" — but which noTensorever holds.StorageSpechas zero consumers; the planner is never consulted at any allocation;Aliasedis never produced;FileBackedandDeviceResidentthrow in every consumer;LogicalDType.fromDTypehas no inverse, so the layer structurally cannot backTensor<T>today.
The result is a set of related, recurring costs:
- ownership is recorded but never enforced (lifetimes fell back to GC after explicit arenas OOM'd — the missing piece is a weights-persistent vs activations-transient scope split, which
Placement.Residencymodels but nothing uses) - two disconnected view systems (
SlicedTensorViewindex remap vsBufferHandle.Aliasedbyte range) - three type representations (
DTypeKClass generic,LogicalDTypeenum,TensorEncoding), with packed tensors erasing their logical dtype entirely (Q4_KTensorData : TensorData<DType, Byte>— a logically-FP32 weight is not typed as such; ops find it by class check) - placement/mmap/off-heap work (#921, #922, SKEEP-002) keeps landing at the edges because the middle isn't wired
An SKEEP-003 draft (PR to follow) lays out the analysis and two candidate end-states — (a) TensorStorage becomes the single byte-owner and TensorData a typed view protocol over it; (b) TensorData stays primary and absorbs BufferHandle/Placement, retiring the parallel descriptor — deliberately without a recommendation: the trade-off (dispatch rewrite + dtype coherence vs minimal churn + status quo dispatch) is a maintainer decision. Both directions share two prerequisites (two-way LogicalDType ↔ DType bridge; decide StorageSpec's fate) and one hard constraint: the packed-encoding system (7 GGML block formats, ternary, TurboQuant, kernel dispatch, StableHLO skainet.tensor_encodings export) must survive bit-identically.
Mechanical bugs found during the same audit are filed separately (TensorStorageFactory contract violations, GGUF encoding mapping dropping five formats, transfer-API gaps, rank-broken copyToFloatArray default, memory-diagnostics paper-cuts) — they are fixable under either end-state.
- 主要语言
- Kotlin
- 星标
- 52
- 派生
- 15
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 36
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SKaiNET-developers/SKaiNET 的其他 Issue
-
coding good first issue size:xs skill:kotlin-core sub-issue
难度 2/5 1-3 小时 新手友好度 88/100
SKaiNET-developers/SKaiNET#1323 ·
维护者通常 1 天内回复
-
coding good first issue platform size:xs skill:js sub-issue
难度 2/5 1-3 小时 新手友好度 72/100
SKaiNET-developers/SKaiNET#1232 ·
维护者通常 1 天内回复
-
skeep tracking
难度 5/5 一周以上 新手友好度 15/100
SKaiNET-developers/SKaiNET#1331 ·
维护者通常 1 天内回复
-
assessment size:s skill:review sub-issue
难度 4/5 1-2 天 新手友好度 18/100
SKaiNET-developers/SKaiNET#1330 ·
维护者通常 1 天内回复
-
documentation good first issue size:s skill:docs sub-issue
难度 3/5 1-2 天 新手友好度 78/100
SKaiNET-developers/SKaiNET#1329 ·
维护者通常 1 天内回复
查看 SKaiNET-developers/SKaiNET 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 83/100
Kotlin/kotlin-lsp#288 ·
-
afk-ok area:data-quality importer size:S
难度 2/5 1-3 小时 新手友好度 77/100
enorm-labs/event-junkie#3166 ·
维护者通常 1 天内回复
-
bugbane/qf good first issue
难度 2/5 1-3 小时 新手友好度 64/100
osservatorionessuno/bugbane#173 ·
维护者通常 1 天内回复
-
Android: build fails with Android Gradle Plugin 9 (kotlinOptions, lintOptions, proguard-android.txt)未关闭
难度 2/5 1-3 小时 新手友好度 78/100
capacitor-community/stripe#544 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100