Context
PR #315 fixed llm-runtime/kllama's PlatformNativeKernels.ios.kt/.macos.kt,
which were stale no-op stubs — both cited SKaiNET#959 as "not shipped yet" when
it had in fact shipped, meaning kllama's registerPlatformBackends() facade
was silently leaving packed-quant matmul on the scalar floor on iOS and macOS,
despite the engine's native-cinterop NEON/Accelerate kernels being built and
available.
The fix itself (calling installNativeKernels(), mirroring linuxMain's
actual) was written and reviewed, but could not be compiled or run in the
session that produced it — that environment was Linux only, and Kotlin/Native
requires a macOS host to compile Apple targets at all. Verification there was
limited to code review and cross-target compilation (jvm/linuxX64/android/js).
What needs a Mac
Related
Good fit for whoever on the team has a Mac + Xcode handy — no deep kernel-SPI knowledge needed, mostly "build it, run it, check the numbers." Remaining: real-device throughput numbers (needs physical hardware time, not just simulator/compile verification).
Context
PR #315 fixed
llm-runtime/kllama'sPlatformNativeKernels.ios.kt/.macos.kt,which were stale no-op stubs — both cited SKaiNET#959 as "not shipped yet" when
it had in fact shipped, meaning
kllama'sregisterPlatformBackends()facadewas silently leaving packed-quant matmul on the scalar floor on iOS and macOS,
despite the engine's
native-cinteropNEON/Accelerate kernels being built andavailable.
The fix itself (calling
installNativeKernels(), mirroringlinuxMain'sactual) was written and reviewed, but could not be compiled or run in the
session that produced it — that environment was Linux only, and Kotlin/Native
requires a macOS host to compile Apple targets at all. Verification there was
limited to code review and cross-target compilation (jvm/linuxX64/android/js).
What needs a Mac
./gradlew :llm-runtime:kllama:compileKotlinIosArm64 :llm-runtime:kllama:compileKotlinIosSimulatorArm64 :llm-runtime:kllama:compileKotlinMacosArm64— confirm the fix actually compiles (theinstallNativeKernels()import/call was written against the API but never type-checked on an Apple target). Update: it did not compile as originally written —implementation(libs.skainet.backend.nativeCpu)was still scoped tolinuxMainonly, notnativeMain, somacosMain/iosMainnever got the dependency. Fixed in PR fix(kllama): stop leaving packed-quant matmul scalar-only on iOS/macOS #315 commit9bb3707; all three Apple targets now compile.KernelRegistry.bestAvailable()?.name(or equivalent) reportsnative-cinteropon iOS/macOS afterregisterPlatformBackends()runs, notscalar. Confirmed viaKernelRegistry.availableNames()on bothmacosArm64TestandiosSimulatorArm64Test: reports[native-cinterop].iosSimulatorArm64Test/macosArm64Test(both currently skip on CI/Linux —kotlin.native.ignoreDisabledTargets). Both green, including the cross-targetSmolLm2InferenceSpike(commonTest).Related
KernelRacesample — see SKaiNET-examples#33, which needs this issue resolved before its iOS build shows real NEON acceleration instead of scalar.Good fit for whoever on the team has a Mac + Xcode handy — no deep kernel-SPI knowledge needed, mostly "build it, run it, check the numbers." Remaining: real-device throughput numbers (needs physical hardware time, not just simulator/compile verification).