Skip to content

Commit b45d7db

Browse files
committed
Clean up workflow: use env var for RAM, remove redundant options
- 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
1 parent 82ee80e commit b45d7db

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

.github/workflows/llm-android.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
API_LEVEL: 34
4444
ARCH: x86_64
4545
EMULATOR_OPTIONS: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
46-
RAM_SIZE: 16384M
46+
RAM_SIZE: 16384
4747

4848
name: Instrumentation Test LlamaDemo
4949
steps:
@@ -81,22 +81,19 @@ jobs:
8181
api-level: ${{ env.API_LEVEL }}
8282
arch: ${{ env.ARCH }}
8383
force-avd-creation: true
84-
ram-size: ${{ env.RAM_SIZE }}
8584
emulator-options: ${{ env.EMULATOR_OPTIONS }}
8685
disable-animations: false
8786
working-directory: llm/android/LlamaDemo
8887
script: echo "Generated AVD snapshot for caching."
8988

9089
- name: Configure AVD RAM
9190
run: |
92-
# Find and update AVD config to set RAM
9391
AVD_DIR="$HOME/.android/avd"
9492
for config in "$AVD_DIR"/*.avd/config.ini; do
9593
if [ -f "$config" ]; then
9694
echo "Updating RAM in $config"
97-
sed -i 's/hw.ramSize=.*/hw.ramSize=16384/' "$config" || true
98-
grep -q "hw.ramSize" "$config" || echo "hw.ramSize=16384" >> "$config"
99-
cat "$config" | grep -E "hw.ramSize|AvdId"
95+
sed -i 's/hw.ramSize=.*/hw.ramSize=${{ env.RAM_SIZE }}/' "$config" || true
96+
grep -q "hw.ramSize" "$config" || echo "hw.ramSize=${{ env.RAM_SIZE }}" >> "$config"
10097
fi
10198
done
10299
@@ -110,12 +107,10 @@ jobs:
110107
api-level: ${{ env.API_LEVEL }}
111108
arch: ${{ env.ARCH }}
112109
force-avd-creation: false
113-
ram-size: ${{ env.RAM_SIZE }}
114-
emulator-options: -no-snapshot-save -memory 16384 ${{ env.EMULATOR_OPTIONS }}
110+
emulator-options: -no-snapshot-save ${{ env.EMULATOR_OPTIONS }}
115111
disable-animations: true
116112
working-directory: llm/android/LlamaDemo
117113
script: |
118-
adb shell cat /proc/meminfo | head -5
119114
adb shell rm -rf /data/local/tmp/llama
120115
adb shell mkdir -p /data/local/tmp/llama
121116
adb logcat -c && adb logcat > /tmp/logcat.txt &

0 commit comments

Comments
 (0)