Skip to content

Publish skainet-backend-native-cpu for iosArm64 / iosSimulatorArm64 / macosArm64 with embedded kernel archives #959

Description

@michalharakal

Part of the iOS/Apple kernel track of #920 (slices 2–3 of 3; depends on the Apple dotprod-dispatch issue).

skainet-backend-native-cpu publishes only jvm/linuxX64/linuxArm64, so every Apple Kotlin/Native consumer runs scalar packed-quant matmul — the field report behind #920 measured 0.11 tok/s on the iOS simulator for a model that does 10+ tok/s on Android with the JNI backend. The C kernels are portable aarch64 NEON and the cinterop static-archive embedding (#941/#942) was built with exactly this extension in mind.

Plan (two PRs):

PR A — targets + archives + PR-time CI

  • Three CMake lanes on a macOS host: CMAKE_SYSTEM_NAME=iOS + CMAKE_OSX_SYSROOT=iphoneos|iphonesimulator for the device/simulator archives, plain arm64 for macosArm64; deployment targets matched to K/N binary minimums (iOS 12.0 / sim 14.0 / macOS 11.0); no -march (dispatch handles dotprod). iOS builds static-only.
  • iosArm64() / iosSimulatorArm64() / macosArm64() targets wired through the existing wireSkainetKernels seam; new injection properties -PskainetKernelsIosArm64Dir / -PskainetKernelsIosSimulatorArm64Dir / -PskainetKernelsMacosArm64Dir beside the Linux pair, with a macOS-host heuristic and the established bindings-only warning.
  • Source sets join the existing hand-wired nativeMain/nativeTest; the 7 arch-agnostic parity suites run unmodified as iosSimulatorArm64Test / macosArm64Test on a macOS host. Non-macOS hosts get the Apple task family disabled (mirrors the existing non-Linux gate), keeping ubuntu CI deterministic.
  • native-cpu-multiarch.yml macos-14 leg gains the two K/N test tasks — real archives, simulator-executed parity, dotprod fast arm.

PR B — release plumbing + kernel matrix

  • publish.yml: macos-14 build-native leg builds + uploads the three archives (native-static-apple, fail-loud); publish job verifies with test -f and injects the three -P dirs — same contract as the Linux ELF archives.
  • Kernel support matrix: add the missing native-cinterop tier (priority 100, Native·linux + Native·apple, Q8_0/Q4_0/Q4_K/Q5_K/Q6_K — this also fixes the currently under-reported Native·linux column), regenerate the adoc, and document that registration on K/N is manual via installNativeKernels().

Registration stays manual by design — auto-registering from skainet-backend-cpu's appleMain would invert the dependency direction and force the archives onto every Apple consumer. The transformers runtime facades will wire installNativeKernels() in their appleMain, mirroring the Android JNI wiring (transformers follow-up issue, filed when this lands).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions