Skip to content

[minibench] Add PSS data to result #8984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions extension/benchmark/android/benchmark/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {

defaultConfig {
applicationId = "org.pytorch.minibench"
minSdk = 28
targetSdk = 33
minSdk = 34
targetSdk = 34
versionCode = 1
versionName = "1.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Debug;
import android.system.ErrnoException;
import android.system.Os;
import com.google.gson.Gson;
Expand Down Expand Up @@ -47,6 +48,8 @@ protected void onCreate(Bundle savedInstanceState) {
int numIter = intent.getIntExtra("num_iter", 50);
int numWarmupIter = intent.getIntExtra("num_warm_up_iter", 10);

long pssIdle = Debug.getPss();

// TODO: Format the string with a parsable format
Stats stats = new Stats();

Expand Down Expand Up @@ -103,6 +106,10 @@ protected void onPostExecute(Void aVoid) {
0.0f));
// Load status
results.add(new BenchmarkMetric(benchmarkModel, "load_status", stats.errorCode, 0));
// RAM PSS usage
results.add(
new BenchmarkMetric(
benchmarkModel, "ram_pss_usage(mb)", (Debug.getPss() - pssIdle) / 1024, 0));

try (FileWriter writer = new FileWriter(getFilesDir() + "/benchmark_results.json")) {
Gson gson = new Gson();
Expand Down
Loading