feat(kllama,kgemma): add iosArm64/iosSimulatorArm64 targets; document the target matrix (#271) - #274
Merged
Merged
Conversation
… the target matrix runtime-kllama and runtime-kgemma published no iOS artifacts even though every commonMain dependency of both modules already ships iOS variants, and kllama's src/iosMain (the registerPlatformBackends actual) predated the targets and was silently dead code — these modules set kotlin.mpp.applyDefaultHierarchyTemplate=false, so a source folder means nothing until it is wired by hand. Declare iosArm64 + iosSimulatorArm64 in both modules and wire iosMain -> nativeMain the same way llm-core does. Library-only targets: no CLI executable is declared for Apple, consumers link the klib into their app. kgemma's JVM-only deps (compile-hlo, gemma-iree, llm-providers, ...) are already confined to jvmMain, so its commonMain is iOS-clean. Also add a supported-targets matrix to the README (derived from each module's build.gradle.kts) and point the multiplatform feature bullet at it, replacing the 'where applicable' hand-wave. Verified on a Linux host: all four iOS klibs compile (compileKotlinIosArm64 / IosSimulatorArm64 for both modules — K/N builds Apple klibs on any host; only binary linking needs Xcode), iosMain and nativeMain metadata compile, jvmTest of both modules green, linuxX64 compile green. Note: :llm-runtime:kllama:jvmApiCheck fails identically on clean develop (stale api dump from the prefillStrategy change, #226) — unrelated, not touched here. Closes #271 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
runtime-kllamaandruntime-kgemmapublished no iOS artifacts, even though every commonMain dependency of both modules already ships iOS variants — and kllama'ssrc/iosMain(theregisterPlatformBackendsactual) predated the targets and was silently dead code. These modules setkotlin.mpp.applyDefaultHierarchyTemplate=false, so a source folder means nothing until it's wired by hand. Full analysis in #271.How
iosArm64()+iosSimulatorArm64()in both modules, library-only (no CLI executable for Apple — consumers link the klib into their app).iosMain → nativeMainby hand, mirroringllm-core's wiring. kllama's existingiosMain/BackendActual.ktnow actually compiles; kgemma has no iOS-specific sources and inheritsnativeMain.compile-hlo,gemma-iree,llm-providers, …) are already confined tojvmMain, so its commonMain is iOS-clean.build.gradle.kts) replacing the "where applicable" hand-wave, plus the multiplatform feature bullet now links to it.Verified (Linux host)
compileKotlinIosArm64/compileKotlinIosSimulatorArm64for both modules (Kotlin/Native builds Apple klibs on any host; only final binary linking needs Xcode). This exercises expect/actual resolution (registerPlatformBackends,createOptimalKvCache) and resolves every dependency's iOS variant.compileIosMainKotlinMetadata/compileNativeMainKotlinMetadatagreen.jvmTestof both modules green;compileKotlinLinuxX64green (no regression to existing targets).macOS-latest, so the new artifacts build in CI as-is. No ABI dump changes needed (BCV dumps are jvm/android-only).Pre-existing, untouched:
:llm-runtime:kllama:jvmApiCheckfails identically on cleandevelop— theapi/jvm/kllama.apidump is stale from theGenerationConfig.prefillStrategychange (#226). Happy to file/fix that separately.We can validate the resulting klibs in a real iOS app (this is the exact dependency shape our shipped app needed) as soon as a snapshot with these targets is available.
Closes #271
🤖 Generated with Claude Code