feat(#1193): derive mapped-serving encodings from kernel registrations - #1215
Merged
Merged
Conversation
StorageCapabilities.MAPPED_SERVABLE_DEFAULT (skainet-lang-core) and KernelSupportMatrixTest.mappedTiers() (skainet-backend-native-cpu) were two independently hand-maintained lists of which encodings serve straight from mapped/off-heap storage, with nothing checking they agreed. skainet-lang-core cannot depend on skainet-backend-api (that dependency runs the other way), so the hand-kept constant stays, but it's now cross-checked against reality: a new MappedCapableKernel marker on FfmRowMajorMatmulKernel and JniRowMajorMatmulKernel plus KernelDispatch.mappedServableEncodings() derives the set from what's actually registered, and KernelSupportMatrixTest.generate_and_gate_support_matrix() installs the JVM-reachable mapped kernels and asserts the derived set equals StorageCapabilities.MAPPED_SERVABLE_DEFAULT (minus dense F32, which is mapped as an element view, not a matmul kernel). mappedTiers()'s ffm-rowmajor row is now itself derived; the Android native-jni-direct row stays declared, since nothing on a JVM test run can probe a device's JNI kernel availability. Closes the loop #1193 asked for: drift between the two lists now fails CI instead of relying on someone remembering to update both.
|
📖 Documentation Preview The documentation has been built successfully for this PR. Generated Files:
Artifacts:
This comment will be updated automatically when the PR is updated. |
1 task
5 tasks
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.
Summary
StorageCapabilities.MAPPED_SERVABLE_DEFAULT(skainet-lang-core) andKernelSupportMatrixTest.mappedTiers()(skainet-backend-native-cpu) were two independently hand-maintained lists of which encodings can actually be served straight from mapped/off-heap storage — nothing checked that they agreed. This closes that gap for #1193.skainet-lang-corecannot depend onskainet-backend-api(the dependency runs the other way, avoiding a cycle), soStorageCapabilities.MAPPED_SERVABLE_DEFAULTstays a hand-kept constant — but it's now cross-checked against what's actually registered:MappedCapableKernelmarker interface inskainet-backend-api, implemented byFfmRowMajorMatmulKernel(JVM/FFM) andJniRowMajorMatmulKernel(Android/JNI) — the two kernels proven to serve aBLOCKED_ROW_MAJORweight from off-heap/mapped storage as well as heap bytes.KernelDispatch.mappedServableEncodings()derives the served encodings from whateverMappedCapableKernels are actually registered.KernelSupportMatrixTest.generate_and_gate_support_matrix()installs the JVM-reachable mapped kernel pack and asserts the derived set equalsStorageCapabilities.MAPPED_SERVABLE_DEFAULTminus dense F32 (whichStorageCapabilitiesmaps as an element view, not a matmul kernel — it has no row in kernel dispatch by design).mappedTiers()'sffm-rowmajorrow is now itself derived instead of a hardcoded literal; the Androidnative-jni-directrow stays declared, since nothing on a JVM test run can probe whether the JNI.soloads on a device.Drift between the two lists now fails CI instead of relying on someone remembering to update both by hand.
Test plan
./gradlew :skainet-backends:skainet-backend-api:compileKotlinJvm :skainet-backends:skainet-backend-native-cpu:compileKotlinJvm :skainet-backends:skainet-backend-jni-cpu:compileDebugKotlin./gradlew :skainet-backends:skainet-backend-native-cpu:jvmTest(includingKernelSupportMatrixTest,FfmRowMajorDispatchTest,NativeFfmPipelineTest)./gradlew :skainet-backends:skainet-backend-api:jvmTest :skainet-backends:skainet-backend-jni-cpu:testDebugUnitTest