@@ -18,8 +18,23 @@ SKaiNET uses a hybrid backend strategy that separates development iteration from
1818
1919### SKaiNET is Data
2020
21- - Data loaders (MNIST, JSON datasets, image helpers)
22- - Type‑safe tensors across JVM/JS/Native
21+ - ** Built-in Data Loaders** : ` MNIST ` , ` Fashion-MNIST ` , ` CIFAR-10 `
22+ - ** I/O Formats** : ` GGUF ` , ` ONNX ` , ` JSON ` , ` Image ` (JPEG, PNG, etc.)
23+ - ** Type-safe Tensors** : Unified API across JVM, JS, and Native
24+ - ** Data Transforms** : Fluent API for data preprocessing, including image resizing, normalization, and tensor conversion.
25+ - ** Transformation DSL** : Compose complex preprocessing pipelines using a type-safe Kotlin DSL.
26+
27+ ``` kotlin
28+ // Data Transformation Pipeline
29+ val transform = transforms<PlatformBitmapImage , Tensor <FP32 , Float >> {
30+ resize(224 , 224 )
31+ centerCrop(200 , 200 )
32+ toTensor(ctx)
33+ normalize(ctx, mean = floatArrayOf(0.485f , 0.456f , 0.406f ), std = floatArrayOf(0.229f , 0.224f , 0.225f ))
34+ }
35+
36+ val processedTensor = transform.apply (rawImage)
37+ ```
2338
2439``` kotlin
2540// data loaders
@@ -96,12 +111,18 @@ println(ds.describe())
96111
97112### SKaiNET is Compiler
98113
99- - MLIR/StableHLO based lowering (modules provided in ` SKaiNET-compile-* ` )
114+ - ** MLIR/StableHLO Backend** : Lowering from high-level Kotlin DSL to MLIR StableHLO dialect.
115+ - ** Optimization Passes** : Extensible transformation API for optimizing the compiled IR.
116+ - ` ConstantFoldingPass ` : Folds arithmetic operations with constant operands.
117+ - ` OperationFusionPass ` : Fuses multiple ops (e.g., Add + ReLU) into efficient kernels.
118+ - ` DeadCodeEliminationPass ` : Removes unused computations.
119+
100120``` kotlin
101- // Illustrative: export graph to JSON/StableHLO IR
102- val ir = Compile .toStableHlo(model )
103- println (ir.pretty() )
121+ // Applying Compiler Optimizations
122+ val optimizer = StableHloOptimizer .createDefault( )
123+ val optimizedModule = optimizer.optimize(mlirModule )
104124```
125+
105126- ** Arduino C Code Generation** : Export models to standalone, optimized C99 code with static memory allocation.
106127
107128``` kotlin
@@ -124,8 +145,8 @@ Read the [Deep Technical Explanation](docs/arduino-c-codegen.md) for more detail
124145
125146``` kotlin
126147dependencies {
127- implementation(" sk.ainet.core:SKaiNET-lang-core:0.7.1 " )
128- implementation(" sk.ainet.core:SKaiNET-backend-cpu:0.7.1 " )
148+ implementation(" sk.ainet.core:SKaiNET-lang-core:0.8.3 " )
149+ implementation(" sk.ainet.core:SKaiNET-backend-cpu:0.8.3 " )
129150}
130151// Ready to build & run in ~8 minutes
131152```
@@ -150,15 +171,15 @@ dependencyResolutionManagement {
150171
151172dependencies {
152173 // minimal dependency with simple CPU backend
153- implementation(" sk.ainet.core:SKaiNET-lang-core:0.7.1 " )
154- implementation(" sk.ainet.core:SKaiNET-backend-cpu:0.7.1 " )
174+ implementation(" sk.ainet.core:SKaiNET-lang-core:0.8.3 " )
175+ implementation(" sk.ainet.core:SKaiNET-backend-cpu:0.8.3 " )
155176
156177 // simple model zoo
157- implementation(" sk.ainet.core:SKaiNET-lang-models:0.7.1 " )
178+ implementation(" sk.ainet.core:SKaiNET-lang-models:0.8.3 " )
158179
159180 // Optional I/O (e.g., GGUF loader, JSON)
160- implementation(" sk.ainet.core:SKaiNET-io-core:0.7.1 " )
161- implementation(" sk.ainet.core:SKaiNET-io-gguf:0.7.1 " )
181+ implementation(" sk.ainet.core:SKaiNET-io-core:0.8.3 " )
182+ implementation(" sk.ainet.core:SKaiNET-io-gguf:0.8.3 " )
162183}
163184```
164185
@@ -168,7 +189,7 @@ Maven:
168189<dependency >
169190 <groupId >sk.ainet.core</groupId >
170191 <artifactId >SKaiNET-lang-core</artifactId >
171- <version >0.7.1 </version >
192+ <version >0.8.3 </version >
172193</dependency >
173194```
174195
@@ -177,25 +198,25 @@ Maven:
177198- Sample app: https://github.com/SKaiNET-developers/SKaiNET-samples/tree/feature/MNIST/SinusApproximator
178199- Kotlin Notebook: https://github.com/SKaiNET-developers/SKaiNET-notebook
179200
180- ## 0.7.1 highlights (with tiny snippets)
201+ ## 0.8.3 highlights (with tiny snippets)
181202
182- - ** Sine Approximation CLI** : Added ` skainet-sine-approx-cli ` for training models.
183- - ** Autograd Engine** : Initial support for automatic differentiation and reverse-mode gradients using ` DefaultGradientTape ` .
184- - ** Optimization & Training** : New ` SgdOptimizer ` and training DSL to build and run training loops.
185- - ** Loss Functions** : Added ` MSELoss ` and ` CrossEntropyLoss ` with configurable reduction strategies.
203+ - ** KLlama (Llama 2 port)** : Initial version supporting GGUF models with ` mmap ` for zero-copy loading.
204+ - ** Quantization & BitNet** : Support for ` Q8_0 ` , ` Q4_K ` , and BitNet/Ternary (` TQ1_0 ` , ` TQ2_0 ` ) formats.
205+ - ** Streaming & I/O** : Added streaming support for GGUF/ONNX and improved GGUF metadata loading.
206+ - ** Advanced Operations** : Added ` LeakyReLU ` , ` ELU ` , ` AvgPool2d ` , ` Conv1d ` , and ` Conv3d ` .
207+ - ** Optimizers & Metrics** : New ` Adam ` , ` AdamW ` optimizers and ` Accuracy ` metrics.
208+ - ** Datasets & Transforms** : Support for ` CIFAR-10 ` , ` Fashion-MNIST ` , and a new ` Data Transform API ` .
186209
187210``` kotlin
188- // Example training step with Autograd
189- val loss = MSELoss ()
190- val optimizer = sgd(lr = 0.01 )
191-
192- val (tape, l) = record { loss.forward(model.forward(x, ctx), y, ctx) }
193- tape.computeGradients(targets = listOf (l), sources = model.parameters())
194- optimizer.step()
211+ // Example: Streaming inference with KLlama (GGUF)
212+ val llama = KLlama .load(" path/to/model.gguf" )
213+ llama.generate(" Once upon a time" ) { token ->
214+ print (token) // streaming output
215+ }
195216```
196217
197- - Improved ** Graph DSL ** with better wiring and recording support .
198- - Stability improvements for StableHLO and CUDA backends .
218+ - ** WASM/JS ** : Initial support for web-based deployments .
219+ - ** GGUF-only ** : Simplified I/O by focusing on GGUF (removed legacy formats) .
199220
200221See [ CHANGELOG.md] ( CHANGELOG.md ) for the full list.
201222
0 commit comments