From c13a94b1b98d89ca9fa6fc76471e106648f3dd18 Mon Sep 17 00:00:00 2001 From: Michal Harakal Date: Sat, 6 Jun 2026 18:20:28 +0200 Subject: [PATCH 1/2] chore(api): regenerate JVM binary-compat baselines (apiDump) Sync the committed .api dumps to the actual public API. The drift was pre-existing (0.27.0): skainet-compile-hlo gained AttentionOperationsConverter + multi-output port helpers (getValueName/resolveOperands/setValueName(String,Int,...)), and skainet-lang-core conv/pool op constructors gained a KClass dtype parameter. Neither came from the 0.28.1 export fixes (#674/#676, all private). Makes jvmApiCheck green. --- .../api/jvm/skainet-compile-hlo.api | 9 +++++++++ .../skainet-lang-core/api/jvm/skainet-lang-core.api | 12 ++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/skainet-compile/skainet-compile-hlo/api/jvm/skainet-compile-hlo.api b/skainet-compile/skainet-compile-hlo/api/jvm/skainet-compile-hlo.api index 8277d9594..4f170f5e6 100644 --- a/skainet-compile/skainet-compile-hlo/api/jvm/skainet-compile-hlo.api +++ b/skainet-compile/skainet-compile-hlo/api/jvm/skainet-compile-hlo.api @@ -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 } @@ -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 ()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 ()V public fun convert (Lsk/ainet/lang/graph/GraphNode;Ljava/util/List;Lsk/ainet/compile/hlo/ConversionContext;)Lsk/ainet/compile/hlo/ConversionResult; diff --git a/skainet-lang/skainet-lang-core/api/jvm/skainet-lang-core.api b/skainet-lang/skainet-lang-core/api/jvm/skainet-lang-core.api index ad66191e6..c4ecd987b 100644 --- a/skainet-lang/skainet-lang-core/api/jvm/skainet-lang-core.api +++ b/skainet-lang/skainet-lang-core/api/jvm/skainet-lang-core.api @@ -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 (IDDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;)V - public synthetic fun (IDDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (IDDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;Lkotlin/reflect/KClass;)V + public synthetic fun (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; @@ -2030,8 +2030,8 @@ 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 (IIDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;)V - public synthetic fun (IIDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (IIDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;Lkotlin/reflect/KClass;)V + public synthetic fun (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; @@ -2039,8 +2039,8 @@ public final class sk/ainet/lang/nn/normalization/GroupNormalization : sk/ainet/ } public final class sk/ainet/lang/nn/normalization/LayerNormalization : sk/ainet/lang/nn/Module, sk/ainet/lang/nn/topology/ModuleParameters { - public fun ([IDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;)V - public synthetic fun ([IDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun ([IDZLjava/lang/String;Lsk/ainet/lang/tensor/Tensor;Lsk/ainet/lang/tensor/Tensor;Lkotlin/reflect/KClass;)V + public synthetic fun ([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; From 557ae913e741fd70a2dc7f713e2e8a3f9533db02 Mon Sep 17 00:00:00 2001 From: Michal Harakal Date: Sat, 6 Jun 2026 18:22:53 +0200 Subject: [PATCH 2/2] =?UTF-8?q?release:=200.28.1=20=E2=80=94=20DAG-DSL=20e?= =?UTF-8?q?xport=20compiles=20end-to-end=20(7/7=20models,=2027/27=20ops)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - VERSION_NAME 0.28.0 -> 0.28.1 - CHANGELOG [0.28.1]: reshape/matmul/concat (#674) + conv1d/gather/pooling/flatten + reduce_window generic form (#676); apiDump baseline regen - README: What's New in 0.28.1, BOM bump, 0.28.0 demoted to Recent releases --- CHANGELOG.md | 19 +++++++++++++++++++ README.md | 10 ++++++---- gradle.properties | 2 +- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3faae26da..d21b0e4c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` 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 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 diff --git a/README.md b/README.md index 6c90966f0..5a8120c7f 100644 --- a/README.md +++ b/README.md @@ -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") @@ -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) diff --git a/gradle.properties b/gradle.properties index 3a8751f80..353a8641a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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/