Repository navigation
feat(wasm): BF16/FP16 provider kernels, common KernelStrictness, matrix rows, sidecar features, aligned wasm-bench scenarios - #1363
Merged
michalharakal merged 1 commit intoOct 19, 2026
Conversation
…ix rows, sidecar features, aligned wasm-bench scenarios - WasmKernelProvider binds the existing skainet_bf16_matmul / skainet_fp16_matmul sidecar exports (resident contiguous weight, staged strided window). - WasmSimd.features() and a one-line install banner mirroring the JVM factory. - KernelStrictness moves to commonMain with a programmatic overrideEnabled switch; JVM/Android keep the system property. KernelDispatch and DefaultCpuOps.matmul fail fast in strict mode before their reference fallbacks. - Kernel support matrix: Float16 row, BF16/FP16 on wasm-simd128, Q6_K on native-ffm, new "Resident serving" table; drift gate covers Panama and FFM tiers when available. - wasm-bench runs the engine-* scenarios of jvm-cpu-publish on every tier; the ternary gemv is skipped where no ternary kernel is registered. - Docs: eager-execution wasm column and FP16 row, corrected gaps; dtype-model strict-mode section; CHANGELOG.
aharakal
approved these changes
Oct 19, 2026
michalharakal
deleted the
feature/wasm-parity-bf16-fp16-strictness-matrix
branch
October 19, 2026 10:14
This was referenced Oct 19, 2026
feat(wasm): resident activations in the sidecar; elementwise, activation and reduction kernels
#1369
Merged
michalharakal
added a commit
that referenced
this pull request
Oct 21, 2026
CHANGELOG [0.62.0] - 2026-10-21 with the parity headline over #1363, #1364, #1368, #1369, #1426, #1427, #1428 and #1430, plus entries for the operator coverage matrix (#1370), the BitNet decode allocation and threading fixes (#1359, #1360, #1361, #1362), the ClassificationSupport extraction (#1429) and the toolchain bumps (Kotlin 2.4.21, kotest 6.2.6, Gradle 9.8.1). VERSION_NAME, CITATION, Antora version, README bom coordinate, What's New and contributors, Android tutorial coordinates; regenerated operator and kernel-support matrices; SKEEP-007 rollout step 3 marked shipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First step of bringing the wasmJs tier to feature parity with the JVM tier (compute layer). No C changes; everything here is Kotlin, the support matrix and the bench.
skainet_bf16_matmulandskainet_fp16_matmulsince 0.61.0, butWasmKernelProvidernever bound them, so 16-bit dense weights fell to the scalar Kotlin kernels in a browser.WasmBf16MatmulKernel/WasmFp16MatmulKernelbind them; a contiguous weight is uploaded once and stays resident, a strided window is staged per call like the activation.WasmSimd.features()(mode, SIMD128, threads, cross-origin isolation, logical cores, resident weight bytes), andWasmSimd.install()prints the same one-line[SKaiNET] Using …banner the JVM factory prints.KernelStrictnessis common code. It was JVM-only (System.getProperty). NowKernelStrictness.overrideEnabledis the programmatic switch on every target (the only one on JS, Wasm and Kotlin/Native); JVM and Android still honour-Dskainet.strict.kernels. Two new fail-fast sites make strict mode mean the same thing on every tier:KernelDispatchbefore the decoding reference fallback,DefaultCpuOps.matmulbefore the generic per-element loop. The JVM subclass keeps its earlier check.Float16row (every tier had the kernel, the matrix had no row); BF16/FP16 in the wasm column; Q6_K on the JVM corrected frompanama-vectortonative-ffm(NativeKernelProvider.matmulQ6K()has existed, the declared tier had not been updated —DefaultCpuOpsresolves the kernel from the best available provider, so FFM was already serving it); a third table, Resident serving, for the sidecar-resident weights that stand in for mapped serving on JS/WASM. The test now also gates the declared Panama and FFM tiers against what the providers expose when they are available on the runner.wasm-benchruns theengine-*scenarios ofjvm-cpu-publish(same ids, shapes, generators and metrics) on each tier it measures, so JVM and wasm numbers sit in one table.engine-ternary-f32-gemvis reported as skipped on wasm until the ternary kernels join the sidecar (the decoding reference path takes hours at that shape).Verification
:skainet-backends:skainet-backend-wasm-simd:wasmJsNodeTest— parity for BF16/FP16 (contiguous and windowed) against the scalar kernels, features, strict mode on wasm, plus the existing Q8_0/Q4_0/dense tests.:skainet-backends:skainet-backend-native-cpu:jvmTest --tests '*KernelSupportMatrixTest*',generateKernelMatrix(page regenerated).:skainet-backends:skainet-backend-cpu:jvmTest --tests '*KernelStrictnessTest*'.scripts/pr-gate.sh --quick.Follow-ups in the same series: explicit SIMD128 bodies for the K-quants, Q5_0/Q5_1 and dense FP32/BF16/FP16 plus row threading for the dense kernels; ternary kernels in the sidecar and the direct
x · Wᵀkernel on the JVM; resident activations and fused elementwise/attention kernels; the browser IO gaps.