Skip to content

Commit c5f9249

Browse files
Merge pull request #107 from SKaiNET-developers/release/0.22.1
Document %use skainet-notebook magic in README
2 parents e0bf7ba + cbedf61 commit c5f9249

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
66

77
## [Unreleased]
88

9+
### Added
10+
- README "SKaiNET notebook dependency" section now documents the `%use skainet-notebook` magic alongside the existing `@file:DependsOn` form, including version-pin variants (`%use skainet-notebook(0.22.1)`, `@0.22.1`) and a callout that JVM startup args (e.g. `--add-modules jdk.incubator.vector`) still have to be set on the kernel — the registry descriptor cannot inject them. Companion descriptor `skainet-notebook.json` is staged for submission to https://github.com/Kotlin/kotlin-jupyter-libraries; once merged it makes `%use skainet-notebook` work out of the box from any Kotlin Jupyter kernel.
11+
912
## [0.22.1] - 2026-05-02
1013

1114
### Added

README.adoc

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,45 @@ You can create Kotlin notebooks directly in IntelliJ IDEA using one of these met
3838

3939
== SKaiNET notebook dependency
4040

41-
Use SKaiNET directly in a Kotlin Notebook via Maven Central.
41+
There are two ways to pull SKaiNET into a Kotlin Notebook cell. Pick whichever fits your kernel — both load the same uber-jar and run the same `SKaiNETJupyterIntegration` (default imports, tensor / image renderers, ready banner, SIMD-availability check).
42+
43+
=== Via `%use` magic (registry-driven)
44+
45+
Once `skainet-notebook.json` lands in the https://github.com/Kotlin/kotlin-jupyter-libraries[Kotlin Jupyter library registry], a single line is enough — the kernel resolves the artifact coordinate and version pin from the registry and the in-classpath integration takes over from there:
46+
47+
[source, Kotlin]
48+
----
49+
%use skainet-notebook
50+
----
51+
52+
Pin a specific version (otherwise the registry's `properties.v` wins):
53+
54+
[source, Kotlin]
55+
----
56+
%use skainet-notebook(0.22.1)
57+
%use skainet-notebook@0.22.1
58+
----
59+
60+
Combine with other registry libraries in the usual comma-separated form:
61+
62+
[source, Kotlin]
63+
----
64+
%use skainet-notebook, dataframe, lets-plot
65+
----
66+
67+
NOTE: JVM startup arguments (notably `--add-modules jdk.incubator.vector`, see <<enabling-simd>>) cannot be set from a registry descriptor — they have to be configured on the kernel itself. The integration will still load on a vanilla kernel; it will just emit the SIMD-not-active warning and run the scalar CPU path.
68+
69+
=== Via `@file:DependsOn` (explicit coordinate)
70+
71+
When you need to pin against a specific Maven coordinate without depending on the registry (offline kernels, internal mirrors, locked-down environments):
4272

4373
[source]
4474
----
4575
@file:DependsOn("sk.ainet.app:kotlin-notebook:0.22.1")
4676
----
4777

78+
In either case the first cell that needs SKaiNET looks the same:
79+
4880
.code
4981
[source, Kotlin]
5082
----
@@ -71,6 +103,7 @@ import sk.ainet.app.notebook.tools.toImage
71103
imageTensor.toImage(Layout.CHW)
72104
----
73105

106+
[#enabling-simd]
74107
== Enabling SIMD
75108

76109
SKaiNET's CPU backend uses the JDK Vector API (`jdk.incubator.vector`) for SIMD-accelerated matmul, quantized kernels (Q4_K, Q6_K, Q8_0, TurboQuant), and elementwise/reduction ops. The Vector API is an incubator module — it is shipped with the JDK but *not* in the default module graph, so the kernel JVM has to be started with `--add-modules jdk.incubator.vector` for SKaiNET to install the SIMD kernels. Without that flag, SKaiNET silently falls back to scalar `DefaultCpuOps`.

0 commit comments

Comments
 (0)