Skip to content

Commit 7b3d3c7

Browse files
author
Guang Yang
committed
Device telemetry for benchmark
1 parent 311489f commit 7b3d3c7

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

extension/benchmark/android/benchmark/android-llm-device-farm-test-spec.yml.j2

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,22 @@ phases:
105105
echo "*.model tokenizer files found in /data/local/tmp/minibench/"
106106
fi
107107

108+
- echo "Collect Device Telemetry: CPU scaling configuration"
109+
- |
110+
{
111+
echo "=== CPU SCALING CONFIGURATION - $(date) ==="
112+
echo ""
113+
for core_path in /sys/devices/system/cpu/cpu*/cpufreq; do
114+
if [ -d "$core_path" ]; then
115+
core_name=$(basename $(dirname $core_path))
116+
governor=$(cat $core_path/scaling_governor 2>/dev/null || echo "N/A")
117+
min_freq=$(cat $core_path/scaling_min_freq 2>/dev/null || echo "N/A")
118+
max_freq=$(cat $core_path/scaling_max_freq 2>/dev/null || echo "N/A")
119+
echo "$core_name|$governor|$min_freq|$max_freq"
120+
fi
121+
done
122+
} > $DEVICEFARM_LOG_DIR/cpu_scaling_config.txt
123+
108124
- echo "Collect device state before running"
109125
- |
110126
adb -s $DEVICEFARM_DEVICE_UDID shell 'cat /sys/devices/system/cpu/cpu*/cpufreq/stats/time_in_state /sys/devices/system/cpu/cpu*/cpufreq/stats/trans_table' > $DEVICEFARM_LOG_DIR/state_before.txt
@@ -132,7 +148,7 @@ phases:
132148
adb -s $DEVICEFARM_DEVICE_UDID shell am start -W -n org.pytorch.minibench/.BenchmarkActivity \
133149
--es "model_dir" "/data/local/tmp/minibench"
134150
fi
135-
151+
136152
- echo "Collect device state after running"
137153
- |
138154
adb -s $DEVICEFARM_DEVICE_UDID shell 'cat /sys/devices/system/cpu/cpu*/cpufreq/stats/time_in_state /sys/devices/system/cpu/cpu*/cpufreq/stats/trans_table' > $DEVICEFARM_LOG_DIR/state_after.txt

0 commit comments

Comments
 (0)