• fix(android): guard OpenCL llama init and upgrade llama.rn to rc.9#318
Conversation
Co-authored-by: Dishit <hanmadishit74@gmail.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Code Review
This pull request addresses a critical SIGSEGV crash on Android 15 devices using the OpenCL backend by omitting the cache_type_k and cache_type_v parameters during model initialization. It also upgrades the llama.rn dependency to version 0.12.0-rc.9 for improved error handling and adds a detailed investigation document regarding GPU acceleration. Feedback suggests that the HTP backend should not be forced to use f16 KV cache, as the requirement is specific to the OpenCL backend on Adreno devices.
| const needsF16 = | ||
| backend === INFERENCE_BACKENDS.OPENCL || | ||
| (HTP_ENABLED && backend === INFERENCE_BACKENDS.HTP); |
There was a problem hiding this comment.
The logic for needsF16 should be updated to align with hardware-specific requirements. According to the repository rules, the requirement for f16 KV cache is specific to the OpenCL (Adreno) backend. HTP (NPU) and CPU backends can support quantized KV cache (e.g., q8_0) even without flash attention. Therefore, the HTP backend should not be forced to use f16, while OpenCL should remain the primary target for this requirement.
| const needsF16 = | |
| backend === INFERENCE_BACKENDS.OPENCL || | |
| (HTP_ENABLED && backend === INFERENCE_BACKENDS.HTP); | |
| const needsF16 = backend === INFERENCE_BACKENDS.OPENCL; |
References
- On Android, the requirement for f16 KV cache is specific to the OpenCL (Adreno) backend. HTP (NPU) and CPU backends can support quantized KV cache (e.g., q8_0) even without flash attention.
Co-authored-by: Dishit <hanmadishit74@gmail.com>
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (66.66%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #318 +/- ##
==========================================
+ Coverage 83.83% 83.84% +0.01%
==========================================
Files 223 223
Lines 11460 11462 +2
Branches 3144 3145 +1
==========================================
+ Hits 9607 9610 +3
Misses 1070 1070
+ Partials 783 782 -1
🚀 New features to boost your workflow:
|
|



Summary
Type of Change
Screenshots / Screen Recordings
Android
iOS
Checklist
General
Testing
npm test)React Native Specific
project.pbxproj)SPACING/TYPOGRAPHYconstants from the themeuseThemedStylespattern (not inline or staticStyleSheet.create)FlatList/FlashList(not.map()insideScrollView)Performance & Models
/vs\\)Security
Related Issues
Additional Notes