AIBench: Memory profiling on Android 10+ devices using Perfetto #484
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Use perfetto (built into all Android devices from os 10 on) to generate a native heap profile for analysis.
This feature extends the existing SimplePerf cpu-profiling feature by adding a type (cpu vs memory) and optional options field to the config / AIBenchAPI.
Options may need to be specified to get useful results for a given benchmark type. Also, results are more interesting on devices running Android OS 12 or at least 11. It does not work at all on devices running less than Android OS 10.
For now, we substitute a perfetto_config file for the perfetto_report link instead of the intended flamegraph output link.
Output can be observed by downloading the perfetto_data link and importing it into https://ui.perfetto.dev.
Caveats:
AIBenchAPI changes:
Amended the existing aibenchAPI profile argument to use a single bool || dict argument.
For example, for a test case below, here is the input:
And here is what this translates to in the benchmark_config:
In this case, the profiler flavor is redundant since if left unspecified, it will default to "perfetto" unless "cpu" (or nothing) is specified for types.
For simpleperf profiling, this argument can simply be
or
or
Reviewed By: axitkhurana
Differential Revision: D31508439