Skip to content

Memory architecture M0 — Know before you load (plan + identity, no runtime change) #1001

Description

@michalharakal
Parent tracking issue for **M0 — Know before you load** of the SKEEP-003 memory architecture (umbrella: #932). Design docs: `docs/design/memory/memory-architecture-proposal.md` (proposal rev. 2, §-numbers below refer to it) and `docs/design/memory/memory-architecture-milestones-prd.md` (PRD, requirement IDs `Mx-Fy`/`Mx-Ay`) — both land with the SKEEP-003 docs PR; until merged they are attached to #932.

## Goal
Answer *will this model fit on this device at this context length?* from the GGUF header alone, give every weight a stable `TensorId`, and make every tensor report a coherent `Format(dtype, encoding)`. No runtime behaviour changes (existing benchmarks unchanged).

## Sample app / acceptance vehicle
`skainet-plan` CLI (`skainet-apps/skainet-plan`, JVM; planner in `commonMain` so Android/K-Native can call it): `skainet plan model.gguf --ctx 2048 --budget 1.3G` prints the resident breakdown, fit verdict and suggestions; `--list layers[3].*` prints `TensorId · Format · Shape · bytes · ← gguf name`.

## Consumes (proposal §9 phases)
P0 (two-way dtype bridge → `DType` merge, `StorageSpec` → allocation spec) · P1 partial (`Format` reported everywhere, `TensorId` + GGUF `NameMap`, `toString()` renderer).

## Acceptance criteria (PRD)
- M0-A1 plan for Llama-3.2-1B Q4_K_M @ ctx 2048 within ±10 % of measured resident memory (recorded now, verified at M1-A8)

The checklist is maintained by GitHub's sub-issue tracking on this issue.

Working rules (every slice)

  • One slice = one branch feature/<this-issue#>-<slug> from develop = one PR (Closes #<this issue>), merged independently.
  • develop stays usable after merge: additive API or behind façade / opt-in; no default behaviour switch without golden-parity + benchmark evidence in the PR; deprecate with ReplaceWith, never delete before a major (zero-consumer dead code may be removed with evidence in the PR). No new abstract members on TensorData/KernelProvider (defaults only); no data-class primary-constructor changes (secondary ctors only); BCV: apiDump both api/jvm and api/android, apiCheck clean.
  • Test gate before the PR (JDK 25, scripts/pr-gate.sh once it exists): ./gradlew jvmTest linuxX64Test assemble, ./gradlew verifyNpmPins jsTest wasmJsTest wasmWasiTest, ./gradlew apiCheck, ./gradlew :skainet-test:skainet-test-java:test; storage/backend slices add :skainet-lang:skainet-lang-core:jvmBenchmark and :skainet-backends:benchmarks:jvm-cpu-jmh:jmh before/after when a hot path changes.
  • Commits: conventional commit subject, Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> trailer. Do not edit CHANGELOG.md in slice PRs (parallel branches conflict on it; release notes are written at release time from the merged PRs).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    architecturaltensorsTensor operations and data structurestrackingParent/tracking issue with sub-issues

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions