Repository navigation
perf(backend-cpu): dense-FP32 fast path for split - #1361
Merged
Merged
Conversation
DefaultCpuOpsBase.split built every output element through dataFactory.init with outIdx.copyOf() plus a vararg-spread get — two IntArray copies and a boxed value per element. RoPE's split-half rotation calls it every step, which made it the top decode allocation site once the Vector API fallback was gone (#1357). Dense FP32 (floatWindowOf: plain or slab-backed) now copies each chunk as outer contiguous runs with copyInto and adopts the result through floatResult; other data keeps the generic path. Refs #1357 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aharakal
approved these changes
Oct 19, 2026
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.
Problem
DefaultCpuOpsBase.splitbuilt every output element throughdataFactory.init { outIdx -> val inIdx = outIdx.copyOf(); …; tensor.data.get(*inIdx) }. That's twoIntArraycopies (thecopyOfand the vararg spread) plus a boxed value per element.RoPE.applyRoPESplitHalfFullcallssplitevery decode step, and once the Vector API fallback was gone (#1360) this was the top decode allocation site in a BitNet 2B4T JVM profile: about 7.8 GB in a 45 s window.Change
A dense-FP32 fast path, using the same
floatWindowOf/floatResultfunnel as the other hot ops (plain and slab-backed data, scope-aware adoption):outercontiguous runs ofsize × innerfloats, copied withcopyInto;Tests
split_rank4_every_dim_matches_element_mapping: a 2×3×5×4 tensor split on every axis with a remainder chunk. Every element of every part is checked against the source mapping; it also checks negativedim.:skainet-backends:skainet-backend-cpu:jvmTest491/491 pass;compileKotlinLinuxX64passes.Measured
Arduino Ventuno Q, 4× Cortex-A78C, JVM, BitNet 2B4T I2_S, 128 greedy tokens. The patch was backported onto 0.61.0 together with #1360 and the mmap bulk-copy PR:
Arrays.copyOf(int[])←split←RoPEallocation site disappears from the JFR allocation-by-site list;52f57d1d…);Refs #1357
🤖 Generated with Claude Code