⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@kirklandsign
Copy link
Contributor

@kirklandsign kirklandsign commented Jan 15, 2026

Summary

  • Add GitHub Actions workflow for running LlamaDemo Android instrumentation tests on Ubuntu runners
  • Support multiple model presets (stories, llama, qwen3, custom) selectable via workflow dispatch
  • Configure emulator with 16GB RAM to support larger models
  • Capture and upload logcat as artifact for debugging test failures

Changes

Workflow (.github/workflows/llm-android.yml)

  • Runs on 8-core-ubuntu with KVM acceleration for emulator
  • Caches AVD snapshots for faster subsequent runs
  • Model presets selectable via workflow_dispatch:
    • stories (default): Small 110M stories model from S3
    • llama: Llama-3.2-1B from HuggingFace
    • qwen3: Qwen3-4B-INT8-INT4 from HuggingFace
    • custom: User-provided model and tokenizer URLs
  • Configures emulator with 16GB RAM via AVD config.ini modification
  • Uploads logcat artifact on both success and failure

Gradle (llm/android/LlamaDemo/app/build.gradle.kts)

  • Add model preset system with -PmodelPreset property
  • Support custom URLs via -PcustomPteUrl and -PcustomTokenizerUrl
  • Gradle automatically downloads and pushes model files to emulator

Test plan

  • Run workflow with stories preset - verify tests pass
  • Verify logcat artifact is uploaded
  • Test with llama preset (requires sufficient emulator RAM)
  • Test with qwen3 preset

Run emulator-based instrumentation tests on Ubuntu 24.04 runner with:
- KVM hardware acceleration
- X11/graphics library dependencies for headless emulator
- Android SDK setup via android-actions/setup-android
- AVD caching for faster subsequent runs
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 15, 2026
@kirklandsign kirklandsign changed the title Add LlamaDemo Android instrumentation test workflow Update runner for Android CI Jan 15, 2026
@kirklandsign kirklandsign changed the title Update runner for Android CI Add LlamaDemo Android instrumentation test workflow with model presets Jan 15, 2026
When targetName equals sourceName (e.g., both are tokenizer.model),
localPath and tempForChecksum point to the same file. The checksum
verification was deleting this file, causing the subsequent push to
fail with "No such file or directory".

Now we check if a copy is needed and only delete if we made a copy.
The saveLogs() method was directly iterating over the logs ArrayList
with Gson while another thread could be adding logs via ETLogging.log().
This caused a ConcurrentModificationException during activity destroy.

Fix by creating a defensive copy of the list before serialization.
- Use RAM_SIZE env var in Configure AVD RAM step
- Remove redundant ram-size and -memory emulator options
- Remove meminfo debug output
- Keep directory clearing for fresh model files each run
@kirklandsign kirklandsign merged commit c77bcfe into main Jan 15, 2026
2 checks passed
@kirklandsign kirklandsign deleted the llm-android-ubuntu-runner branch January 15, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants