Skip to content

• fix(android): guard OpenCL llama init and upgrade llama.rn to rc.9#318

Merged
dishit-wednesday merged 4 commits intotestv/0.0.90from
fix-llama-crash-error-and-htp
Apr 27, 2026
Merged

• fix(android): guard OpenCL llama init and upgrade llama.rn to rc.9#318
dishit-wednesday merged 4 commits intotestv/0.0.90from
fix-llama-crash-error-and-htp

Conversation

@dishit-wednesday
Copy link
Copy Markdown
Collaborator

Summary

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (code change that neither fixes a bug nor adds a feature)
  • Chore (build process, CI, dependency updates, etc.)

Screenshots / Screen Recordings

Android

Before After

iOS

Before After

Checklist

General

  • My code follows the project's coding style and conventions
  • I have performed a self-review of my code
  • I have added/updated comments where the logic isn't self-evident
  • My changes generate no new warnings or errors

Testing

  • I have tested on Android (physical device or emulator)
  • I have tested on iOS (physical device or simulator)
  • I have tested in light mode and dark mode
  • Existing tests pass locally (npm test)
  • I have added tests that prove my fix is effective or my feature works

React Native Specific

  • No new native module without corresponding platform implementation (Android + iOS)
  • New native modules are added to the Xcode project build target (project.pbxproj)
  • No hardcoded pixel values — uses SPACING / TYPOGRAPHY constants from the theme
  • Styles use useThemedStyles pattern (not inline or static StyleSheet.create)
  • Animations/gestures work smoothly on both platforms
  • Large lists use FlatList / FlashList (not .map() inside ScrollView)
  • No unnecessary re-renders introduced (check with React DevTools Profiler if unsure)

Performance & Models

  • Downloads / long-running tasks report progress to the UI
  • File paths are resolved correctly on both platforms (no hardcoded / vs \\)
  • Large files (models, assets) are not committed to the repository

Security

  • No secrets, API keys, or credentials are included in the code
  • User input is validated/sanitized where applicable

Related Issues

Additional Notes

Co-authored-by: Dishit <hanmadishit74@gmail.com>
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 79 to 81
const needsF16 =
backend === INFERENCE_BACKENDS.OPENCL ||
(HTP_ENABLED && backend === INFERENCE_BACKENDS.HTP);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
const needsF16 =
backend === INFERENCE_BACKENDS.OPENCL ||
(HTP_ENABLED && backend === INFERENCE_BACKENDS.HTP);
const needsF16 = backend === INFERENCE_BACKENDS.OPENCL;
References
  1. 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
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.84%. Comparing base (9a0b2b5) to head (406875c).

Files with missing lines Patch % Lines
...GenerationSettingsModal/TextGenerationAdvanced.tsx 50.00% 0 Missing and 1 partial ⚠️

❌ 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

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
src/services/llmHelpers.ts 86.08% <100.00%> (+0.07%) ⬆️
...GenerationSettingsModal/TextGenerationAdvanced.tsx 88.15% <50.00%> (+0.15%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dishit-wednesday dishit-wednesday changed the base branch from main to testv/0.0.90 April 27, 2026 05:57
@sonarqubecloud
Copy link
Copy Markdown

@dishit-wednesday dishit-wednesday merged commit d6c308b into testv/0.0.90 Apr 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant