Skip to content

Add a CPU/GPU-only backend setting for the built-in models - #15

Closed
marufmoinuddin wants to merge 2 commits into
smnexstudio:mainfrom
marufmoinuddin:feature/cpu-gpu-only
Closed

marufmoinuddin wants to merge 2 commits into
smnexstudio:mainfrom
marufmoinuddin:feature/cpu-gpu-only

Conversation

@marufmoinuddin

@marufmoinuddin marufmoinuddin commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A smaller replacement for #7, following the requested CPU/GPU-only scope and independent of #5, #6 and #8.

  • Add one Automatic / CPU / GPU setting for both built-in models, Qwen and Gemma 4.
  • Preserve the previous Qwen backend choice when upgrading; explicit new choices take precedence.
  • Apply the choice at the next model load and retain the existing runtime GPU-to-CPU fallback.
  • Add five tests covering migration, persistence and both built-in models following the setting.
  • Include no NPU support, Qualcomm/QNN binaries or native-library download scripts.

Maintainer feedback addressed

  • Merged upstream main at af42e2c and resolved the changelog and settings view-model conflicts while preserving both branches’ changes.
  • Translated compute_backend, compute_backend_gpu_note and compute_backend_cpu_note in all 15 localized strings.xml files (45 values), preserving GPU / CPU names.
  • Updated docs/TESTING.md to 697 unit tests in 106 classes, including the engine subtotal and migration-test entry. Existing coverage figures are explicitly historical, not newly measured.

Validation

Passed on the development VPS:

./gradlew --offline --no-daemon --console=plain --max-workers=2 assembleDebug testDebugUnitTest :core:model:test
./gradlew --offline --no-daemon --console=plain --max-workers=2 testDebugUnitTest :core:model:test

The debug APK assembled successfully. The combined command hit the execution time limit during test preparation; subsequent incremental unit-suite invocations completed successfully with exit code 0. All module JUnit reports were verified from this validation session: 697 tests in 106 classes, with zero failures, errors or skipped tests.

All 45 localized values passed XML, key-presence and CPU/GPU-token checks; git diff whitespace checks passed.

Device review

Ready for maintainer device review. As requested, contributor-supplied phone timings are not included; physical-device validation will be performed by the maintainer. The two instrumented tests were not run on the VPS.

Updated commit: d2d9557.

@smnexstudio

Copy link
Copy Markdown
Owner

Hi! Thanks for your contribution

Apologies, I merged some changes into main without noticing your PR .

Could you :

  • please sync your branch with the main to resolve conflicts, also update the test count in docs/TESTING.md, since main has more tests now.
  • Translate the new strings: In every core/ui/src/main/res/values-*/strings.xml, compute_backend, compute_backend_gpu_note and compute_backend_cpu_note values are still in English. Each file needs its own language. An LLM translation is fine; the GPU / CPU names as they are.

You don't need to supply phone timings. Once it's updated, I'll install it and review it on a device myself. Mark it ready for review when you're done.

@marufmoinuddin
marufmoinuddin marked this pull request as ready for review November 6, 2026 08:03
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.

2 participants