Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

## [Unreleased]

## [0.28.1] - 2026-06-06

### Fixed

- **DAG-DSL StableHLO export now compiles end-to-end with IREE for the full conformance suite (7/7 models, 27/27 ops).** Shape-changing ops declared a result/return type inferred from operand-0 instead of the op's real output, so `iree-compile` rejected the modules (*"inferred shape … is incompatible with return type"*). `DagBuilder.inferDagOutputSpecs` now computes the correct output spec for:
- **`reshape`/`view`** — reads the target shape from the op's `newShape` parameter (a `Shape`, which the converter's `as? List<Int>` had missed). (#673, PR #674)
- **`matmul`/`dot`/`mm`/`bmm`** — `(…, M, K) @ (…, K, N) → (…, M, N)` instead of echoing operand-0. (#673, PR #674)
- **`concatenate`** — the corrected summed-axis extent propagates to the consumers and the `func.func` return type, not just the op line. (#673, PR #674)
- **`conv1d`** — windowed `(N, Cout, Lout)`; `conv2d` already inferred via `Conv2dOperation`, but `conv1d` was a `GenericOperation`. (#675, PR #676)
- **`gather`** — `table[:axis] ⊕ indices.shape ⊕ table[axis+1:]`. (#675, PR #676)
- **`maxpool2d`/`avgpool2d`** — windowed `(N, C, Hout, Wout)`. (#675, PR #676)
- **`flatten`** — collapses `[startDim..endDim]` while preserving the leading batch dim (it was collapsing everything to rank-1, breaking the dense layer in mnist-cnn). (#675, PR #676)
- **`reduce_window` is emitted in IREE's parseable generic region form.** Pooling previously used the pretty `… applies <op> over window …` form, which IREE rejects (*"has no custom assembly form"*). Now emits `"stablehlo.reduce_window"(…) ({ ^bb0(…): … })` with full NCHW-rank window attributes; average pooling's divisor is splatted to the output type (was a scalar-vs-tensor mismatch). (#675, PR #676)
- **`MlirValidator` understands region block arguments.** It now registers `^bb0(%a, %b)` block-argument SSA definitions and every `%x =` result on a line, so single-line region ops (e.g. `reduce_window`) validate. (PR #676)

### Changed

- Regenerated the JVM binary-compatibility baselines (`apiDump`) to match the public API exposed since 0.27.0 (`AttentionOperationsConverter`, multi-output port helpers, `KClass` dtype constructors).

## [0.28.0] - 2026-06-06

### Fixed
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Add the core dependencies (Gradle Kotlin DSL):
```kotlin
dependencies {
// Recommended: import the umbrella BOM and drop versions on the engine modules.
implementation(platform("sk.ainet:skainet-bom:0.28.0"))
implementation(platform("sk.ainet:skainet-bom:0.28.1"))

implementation("sk.ainet.core:skainet-lang-core")
implementation("sk.ainet.core:skainet-backend-cpu")
Expand Down Expand Up @@ -193,13 +193,15 @@ deployment, the StableHLO path for native and edge targets.

---

## What's New in 0.28.0
## What's New in 0.28.1

- **Four StableHLO export bugs fixed — the Kotlin DSL → MLIR path lowers reshape, concatenate, constants, and reductions correctly.** `reshape` whose target shape lives only in an op parameter now lowers to a typed `stablehlo.reshape` (#666); multi-input `concatenate` sums the operands' extents on the concatenated axis instead of echoing operand-0's (`1×1 + 1×4 + 1×1` on dim 1 → `1×6`, not `1×1`) (#667); DAG constants are inlined into the module and reductions drop the reduced dimension (#663); and `HloGenerator`'s forward-pass tracing now binds the sample input and synthesizes external inputs so it emits real ops instead of a structure-only module (#668). (PRs #664, #670)
- **Non-JVM image runtime support.** Image and data-transform modules are scoped to their supported KMP targets, with a non-JVM image runtime so the image/data-transform APIs build honestly across targets. (PR #671)
- **The Kotlin DSL → StableHLO → IREE path is green end-to-end for the whole conformance suite — 7/7 models and 27/27 ops `iree-compile` to a `vmfb`** (grayscale, tiny-mlp, whisper, mnist-cnn, yolo, leaf-embed, gemma3-260m). Shape-changing ops had been declaring a result/return type from operand-0 instead of their real output, so IREE rejected the modules. `inferDagOutputSpecs` now computes the correct output spec for `reshape`, `matmul`, `concatenate` (#673), and `conv1d`, `gather`, `maxpool2d`/`avgpool2d`, `flatten` (#675), and the corrected shapes flow to both the op result type and the `func.func` return.
- **`reduce_window` (pooling) is emitted in IREE's generic region form** instead of the pretty `applies … over window` form IREE rejects; the `MlirValidator` now understands region block arguments. (#675, PR #676)
- Verified end-to-end by publishing each candidate to mavenLocal and running the `skainet-iree-conformance` harness before release.

### Recent releases

- **0.28.0** — Four StableHLO export bugs fixed (reshape #666, concatenate #667, constants/reductions #663, `HloGenerator` tracing #668) plus non-JVM image runtime support (#671). (PRs #664, #670, #671)
- **0.27.0** — A full gemma3 network lowers to StableHLO and compiles to an IREE `vmfb` (zero op gaps, verified by `GemmaTraceTest`): new `scaledDotProductAttention` (with causal + explicit additive mask), `permute`, `narrow`, and multi-output `split` converters, plus boxing-free `FloatArray` weight externalization for `.irpa` baking. (PRs #661 et al.)
- **0.26.0** — Q4_0 promoted to a first-class quantized format across the provider stack, `tanh` as a first-class activation primitive, and a CPU tensor `convert` op, plus test/build/CI hygiene. (PRs #648–#651, #631, #636)
- **0.25.0** — BF16 and Q8_0 matmul kernels end-to-end across the provider stack, autograd completeness for `pow`/`log` and the conv/pool/upsample/split family, the hybrid adaptive dtype-constraint DSL, the `@DarcValidated` operator-doc flag, and the SentencePiece special-token splitter. (PRs #595, #605–#628)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=sk.ainet.core
VERSION_NAME=0.28.0
VERSION_NAME=0.28.1
POM_DESCRIPTION=SKaiNET

POM_URL=https://github.com/SKaiNET-developers/skainet/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ public final class sk/ainet/compile/hlo/ConversionContext {
public final fun getModuleDeclarations ()Ljava/lang/String;
public final fun getTypeMapper ()Lsk/ainet/compile/hlo/TypeMapper;
public final fun getValueName (Ljava/lang/String;)Ljava/lang/String;
public final fun getValueName (Ljava/lang/String;I)Ljava/lang/String;
public final fun getValueType (Ljava/lang/String;)Ljava/lang/String;
public final fun nextTempValue ()Ljava/lang/String;
public final fun registerExternalParameter (Lsk/ainet/compile/hlo/ExternalParameterRef;)V
public final fun resolveOperands (Lsk/ainet/lang/graph/GraphNode;)Ljava/util/List;
public final fun setGraph (Lsk/ainet/lang/graph/ComputeGraph;)V
public final fun setValueName (Ljava/lang/String;ILjava/lang/String;)V
public final fun setValueName (Ljava/lang/String;Ljava/lang/String;)V
public final fun setValueType (Ljava/lang/String;Ljava/lang/String;)V
}
Expand Down Expand Up @@ -277,6 +280,12 @@ public final class sk/ainet/compile/hlo/converters/ActivationOperationsConverter
public fun getSupportedOperations ()Ljava/util/Set;
}

public final class sk/ainet/compile/hlo/converters/AttentionOperationsConverter : sk/ainet/compile/hlo/StableHloOperationConverter {
public fun <init> ()V
public fun convert (Lsk/ainet/lang/graph/GraphNode;Ljava/util/List;Lsk/ainet/compile/hlo/ConversionContext;)Lsk/ainet/compile/hlo/ConversionResult;
public fun getSupportedOperations ()Ljava/util/Set;
}

public final class sk/ainet/compile/hlo/converters/BasicMathConverter : sk/ainet/compile/hlo/StableHloOperationConverter {
public fun <init> ()V
public fun convert (Lsk/ainet/lang/graph/GraphNode;Ljava/util/List;Lsk/ainet/compile/hlo/ConversionContext;)Lsk/ainet/compile/hlo/ConversionResult;
Expand Down
12 changes: 6 additions & 6 deletions skainet-lang/skainet-lang-core/api/jvm/skainet-lang-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -2019,8 +2019,8 @@ public final class sk/ainet/lang/nn/metrics/MetricKt {
}

public final class sk/ainet/lang/nn/normalization/BatchNormalization : sk/ainet/lang/nn/Module, sk/ainet/lang/nn/topology/ModuleParameters {
public fun <init> (IDDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;)V
public synthetic fun <init> (IDDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (IDDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;Lkotlin/reflect/KClass;)V
public synthetic fun <init> (IDDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;Lkotlin/reflect/KClass;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun eval ()V
public fun forward (Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/context/ExecutionContext;)Lsk/ainet/lang/tensor/Tensor;
public fun getModules ()Ljava/util/List;
Expand All @@ -2030,17 +2030,17 @@ public final class sk/ainet/lang/nn/normalization/BatchNormalization : sk/ainet/
}

public final class sk/ainet/lang/nn/normalization/GroupNormalization : sk/ainet/lang/nn/Module, sk/ainet/lang/nn/topology/ModuleParameters {
public fun <init> (IIDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;)V
public synthetic fun <init> (IIDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (IIDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;Lkotlin/reflect/KClass;)V
public synthetic fun <init> (IIDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;Lkotlin/reflect/KClass;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun forward (Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/context/ExecutionContext;)Lsk/ainet/lang/tensor/Tensor;
public fun getModules ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
public fun getParams ()Ljava/util/List;
}

public final class sk/ainet/lang/nn/normalization/LayerNormalization : sk/ainet/lang/nn/Module, sk/ainet/lang/nn/topology/ModuleParameters {
public fun <init> ([IDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;)V
public synthetic fun <init> ([IDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> ([IDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;Lkotlin/reflect/KClass;)V
public synthetic fun <init> ([IDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;Lkotlin/reflect/KClass;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun forward (Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/context/ExecutionContext;)Lsk/ainet/lang/tensor/Tensor;
public fun getModules ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
Expand Down
Loading