Skip to content

Commit 0d4d962

Browse files
Merge pull request #775 from SKaiNET-developers/release/0.33.0
release: 0.33.0 — GRU, upsample2d Bilinear export, autodiff coverage fix
2 parents aba3812 + 6702c34 commit 0d4d962

3 files changed

Lines changed: 60 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,47 @@
22

33
## [Unreleased]
44

5+
## [0.33.0] - 2026-06-29
6+
7+
### Added
8+
9+
- **GRU layer (`sk.ainet.lang.nn.Gru`).** SKaiNET's first recurrent layer (issue #217): single-layer,
10+
unidirectional, batch-first `[B, S, D] -> [B, S, H]`, PyTorch gate order (reset, update, new). Built
11+
by composing existing primitives (matmul/add/sigmoid/tanh/narrow/concat) **unrolled over the static
12+
sequence length at trace time** — StableHLO has no loop construct, so any recurrence must unroll. It
13+
runs eagerly, is trainable through the standard tape, and exports to StableHLO with no dedicated
14+
converter. Also adds a `gru(hiddenSize) { … }` network-DSL builder. (PR #772)
15+
- **`upsample2d` Bilinear + StableHLO export.** Adds the Bilinear forward (PyTorch coord map, 4-neighbour
16+
blend) and its autodiff backward, and a traceable StableHLO lowering for **both** Nearest and Bilinear
17+
(scale is static at trace time, so everything lowers to fixed reshape/broadcast/`dot_general` — no
18+
runtime index math, no `custom_call`). Unblocks export of resize/FPN-style paths. (PR #771)
19+
- **Seven newly-differentiable ops.** `cos`, `sin`, `tril`, `gather`, `indexSelect`, `unfold`,
20+
`convTranspose1d` now carry `@Diff` and have backward rules (with finite-difference parity tests):
21+
trig for RoPE, `gather` for embedding lookup, `tril` for causal masks, the rest structural. (PR #774)
22+
- **KSP-generated autodiff-coverage guard.** The tracing-wrapper processor now emits
23+
`DifferentiableTensorOpsRules.ruleNames` (the authoritative `@Diff` op set); a unit test asserts the
24+
execution tape's dispatch covers it, so a differentiable op can no longer ship with a backward rule
25+
that is never wired. `operators.json` now records `isDifferentiable` (+ optional `diffRuleName`),
26+
schema-validated. (PR #774)
27+
28+
### Fixed
29+
30+
- **Silent gradient drop for `elu`, `leakyRelu`, `permute`.** These were `@Diff` and had correct
31+
backward formulas, but had no arm in the execution tape's trace dispatch, so their gradients fell
32+
through to `null` and were silently discarded. Now wired (and guarded by the coverage test above);
33+
`permuteBackward` also fixed to decode its `axes` attribute as the traced `List<Int>`. (PR #774)
34+
- **`layerNorm` / `rmsNorm` / `batchNorm` lower to real `stablehlo.reduce`.** The norm converters
35+
previously emitted non-compilable `reduce_mean` / `reduce_variance` `custom_call`s (export-only); they
36+
now decompose to real `stablehlo.reduce`, so all three compile and run on stock IREE (llvm-cpu). (PR #769)
37+
38+
### Changed
39+
40+
- **BREAKING: `TensorOps.sin`, `TensorOps.cos`, `TensorOps.convTranspose1d` are now abstract.** They
41+
previously had default `throw NotImplementedError(...)` bodies; they are abstract so the tracing
42+
wrapper records them (and they become differentiable/exportable). Any type implementing `TensorOps`
43+
directly must now override them — both bundled backends (`DefaultCpuOpsBase`, `VoidTensorOps`) already
44+
do. (PR #774)
45+
546
## [0.32.4] - 2026-06-26
647

748
### Fixed

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,13 @@ Add the core dependencies (Gradle Kotlin DSL):
3636
```kotlin
3737
dependencies {
3838
// Recommended: import the umbrella BOM and drop versions on the engine modules.
39-
implementation(platform("sk.ainet:skainet-bom:0.32.4"))
39+
implementation(platform("sk.ainet:skainet-bom:0.33.0"))
4040

4141
implementation("sk.ainet.core:skainet-lang-core")
4242
implementation("sk.ainet.core:skainet-backend-cpu")
4343
}
4444
```
4545

46-
> The BOM was first correctly published to Maven Central in 0.22.2 — earlier versions
47-
> shipped at the wrong coordinates and could not be imported. Pin versions directly if
48-
> you need an older release.
49-
5046
### Hello Neural Net
5147

5248
```kotlin
@@ -256,6 +252,23 @@ Runnable examples:
256252

257253
---
258254

255+
## What's New in 0.33.0
256+
257+
- **GRU — the first recurrent layer.** `nn.Gru` (`[B,S,D]->[B,S,H]`, PyTorch gate order) composed from
258+
existing primitives and unrolled over the static sequence at trace time, so it runs eagerly, trains
259+
through the standard tape, and exports to StableHLO with no dedicated converter. Plus a `gru(…)`
260+
network-DSL builder. (PR #772, issue #217)
261+
- **`upsample2d` Bilinear + StableHLO export** for both Nearest and Bilinear — everything lowers to fixed
262+
reshape/broadcast/`dot_general` (no `custom_call`), unblocking resize/FPN-style export. (PR #771)
263+
- **Autodiff correctness + coverage.** Fixes a silent gradient-drop for `elu`/`leakyRelu`/`permute`
264+
(backward rules existed but were never wired into the trace dispatch), makes `cos`/`sin`/`tril`/
265+
`gather`/`indexSelect`/`unfold`/`convTranspose1d` differentiable, and adds a KSP-generated coverage
266+
guard so a differentiable op can no longer ship without a wired backward. (PR #774)
267+
- **Norms compile on stock IREE.** `layerNorm`/`rmsNorm`/`batchNorm` now lower to real `stablehlo.reduce`
268+
instead of export-only `custom_call`s. (PR #769)
269+
- **Breaking:** `TensorOps.sin`/`cos`/`convTranspose1d` are now abstract — backends implementing
270+
`TensorOps` directly must override them (both bundled backends already do).
271+
259272
## What's New in 0.32.4
260273

261274
- **Streaming detokenization keeps word spaces (`Tokenizer.decodeToken`).** Decoding generated tokens

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GROUP=sk.ainet.core
2-
VERSION_NAME=0.32.4
2+
VERSION_NAME=0.33.0
33
POM_DESCRIPTION=SKaiNET
44

55
POM_URL=https://github.com/SKaiNET-developers/skainet/

0 commit comments

Comments
 (0)