Repository navigation
feat(laya): engine 0.61.0 and the packed Q8_0 lane (SKEEP-007 consumer) - #498
Merged
michalharakal merged 1 commit intoOct 17, 2026
Conversation
Engine 0.61.0 brings quantize-at-load and the browser kernel pack. The Laya loader becomes common code over a RandomAccessSource (the JVM Path overload is an extension over it); LayaWeightForms.q8_0For quantizes the encoder and head projections and the token table to Q8_0 at load, LayaWeightPreparation splits the fused matrices in their packed form and wraps the token table for row-wise reads, and LayaQuantizedParityTest gates the lane on decision quality: every predict.json choice agrees with FP32, no value shifts by more than 0.05 (measured 0.035, 5/5 choices).
This was referenced Oct 17, 2026
Merged
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.
Engine 0.61.0 and the Laya consumer of SKEEP-007 (quantize-at-load, the browser lane).
Engine bump
skainet = "0.61.0": SKEEP-007 Tiers 0–2 (packed-weight dispatch order, theskainet-backend-wasm-simdsidecar, quantize-at-load for the SafeTensors and GGUF loaders) and the scheduled removal of the SKEEP-006 compatibility aliases — nothing in this repository referenced them.Laya on the packed Q8_0 lane
LayaModelLoader.loadis common code (commonMain): the four side files as text (LayaCheckpointFiles) plus aRandomAccessSourceformodel.safetensors,suspend, withweightForm/weightFormForpassed through to the engine's SafeTensors loader. The JVMload(directory: Path, ctx, exactGelu, weightFormFor)is now an extension over it — source-compatible for Kotlin callers (same call), a different owner class for Java callers (API dump updated). The Android replica of the six steps in the examples repository can collapse onto this function.LayaWeightForms.q8_0For: Q8_0 for the encoder and head projections (Wqkv,Wo,Wi,mlp.Wo,in_proj_weight,out_proj.weight,linear1/2.weight) and the 256k × 768 token table; norms, biases, the type embedding and the scorer stay dense. About a quarter of the FP32 bytes, served by the packed kernels on every tier (FFM on the JVM, JNI on Android, the SIMD128 sidecar in a browser afterWasmSimd.install()).LayaWeightPreparationsplits the fusedWqkv/Wi/in_projmatrices in their packed form (in row-major block storage a row block is a contiguous byte range, so no FP32 transient) and wraps the token table asPackedRowDequantTensorData, which the embedding layer reads row by row.LayaQuantizedParityTest(model-gated like the other fixture tests) loads the FP32 and the Q8_0 agent, runs thepredict.jsonsingle cases through both, and requires every choice to agree and no probability, score, noul value or confidence to shift by more than 0.05 (LAYA_Q8_TOL; measured 0.035). FP32 parity (1.5e-4) stays the contract of the reference lane. The fixture question parser moved toLayaFixtures.questionOfso both tests share it.typed-decisions.adocgains a Quantized lane section and its Current limits no longer lists "JVM only"; CHANGELOGUnreleased.Verification (local, 12-core laptop, engine 0.61.0 from Maven Central)
compileKotlinJvmandcompileTestKotlinJvmacross the repository against 0.61.0: clean (nothing referenced the removed engine aliases).:llm-inference:laya:jvmTestwithLAYA_MULTILINGUAL_PATH: 33 tests, the FP32 fixtures and batching tests unchanged.LayaQuantizedParityTest: 5/5 choices agree, 45 values compared, max shift 0.035 against the 0.05 gate; packed weights 325 MB; FP32 load 11.4 s, Q8_0 load 12.1 s. On the eager JVM path the Q8_0 lane runs the six fixture cases in 171 s against 69 s for FP32 — the row-major packed kernels take one activation row at a time — so on the JVM this lane is a memory measure; the speed is the browser sidecar's.apiDumpfor the laya module regenerated (the JVMload(Path, …)is now inLayaModelLoaderKt).