Skip to content

docs: virtual-tensors explanation + Android classifier tutorial (CI-verified samples) - #1164

Merged
michalharakal merged 1 commit into
developfrom
feature/1160-tutorials-and-explanation
Aug 26, 2026
Merged

michalharakal merged 1 commit into
developfrom
feature/1160-tutorials-and-explanation

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Closes #1160. Independent of #1162 (both branch from develop; merge in any order).

Two Antora pages with hand-drawn SVGs, one honest story:

explanation/virtual-tensors.adoc (developers) — the ML Drift-style tensor virtualization as implemented on the eager/IO side: the strides algebra (one logical cell, two physical positions), TensorView = Shape + Format + Layout + Storage, resolver-owned physical forms (WeightFormResolver → AllocationResolver → explain(), with the user-wins override lane), scope-based lifetime without a graph, and a "known limits, stated rather than implied" list (compile lane carries no Layout yet; Storage.OffHeap has no tensor-factory consumer; the ForwardScope slab is heap; trainable params are heap-resident). Heavy xrefs to memory-model, packed-weight-layout, eager-execution instead of duplication.

tutorials/android-classifier-getting-started.adoc (consumers) — define, train and evaluate a [4,16,3] Iris MLP with the Kotlin DSL on Android (minSdk 24, published coordinates), then two deliberately precise sections: where off-heap applies today (mapped GGUF loading — dense F32; not trainable parameters; #973 for packed) and where NEON applies today (quantized matmul via the auto-discovered JNI provider; FP32 is scalar until #920), with xrefs to the kernel-support matrix and the Pixel 8a perf page.

The tutorial cannot rot: its snippets are tagged regions of the new IrisClassifier.kt in skainet-docs-samples, compiled and executed in CI with a held-out accuracy ≥ 0.80 assertion. This is also the suite's first end-to-end CrossEntropyLoss training of a DSL model — a previously untested composition, now covered. (skainet-docs-samples gains skainet-data-api/skainet-data-simple and kotlinx-coroutines-test test deps.)

Full pr-gate green.

🤖 Generated with Claude Code

…erified

Two pages, one honest story:

- explanation/virtual-tensors.adoc — the ML Drift-style split as implemented:
  the strides algebra, TensorView = Shape + Format + Layout + Storage,
  resolver-owned physical forms (WeightFormResolver, AllocationResolver,
  the user-wins override), scope-based lifetime without a graph, and the
  known limits stated rather than implied. Three hand-drawn SVGs show the
  mechanisms: one logical cell landing at two physical positions, three
  views sharing one storage with materialize() as the only copy point,
  and the resolution flow with the override lane.

- tutorials/android-classifier-getting-started.adoc — define, train and
  evaluate a [4,16,3] Iris MLP with the Kotlin DSL, plus precise sections
  on where off-heap weights (mapped GGUF loading, not trainable params)
  and NEON kernels (quantized matmul, not FP32; #920) apply on Android.

The tutorial's code is IrisClassifier.kt in skainet-docs-samples: compiled
and executed in CI with a held-out accuracy >= 0.80 assertion — the first
end-to-end CrossEntropyLoss training of a DSL model in the test suite,
converting a previously untested composition into coverage.

Closes #1160.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

📖 Documentation Preview

The documentation has been built successfully for this PR.

Generated Files:

  • Operator documentation: docs/modules/operators/_generated_/
  • JSON schema output: operators.json

Artifacts:

  • Download the documentation-preview-1164 artifact to view the complete documentation locally.

This comment will be updated automatically when the PR is updated.

@michalharakal
michalharakal merged commit e6e2287 into develop Aug 26, 2026
17 checks passed
@michalharakal
michalharakal deleted the feature/1160-tutorials-and-explanation branch August 26, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tutorial: train a simple classifier on Android — weights off the heap, ARM kernels

1 participant