Skip to content
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

Support device detection with new benchmark suite #13182

Merged
merged 8 commits into from
May 3, 2023

Conversation

pzread
Copy link
Contributor

@pzread pzread commented Apr 20, 2023

IREE benchmark tool automatically detects the device info of benchmark device and filter the benchmarks. This change maps the detected info to device architecture enum of new benchmark suite.

For unknown architecture, instead of failing directly, print a warning and skip the benchmarks. This allows users to use the tools with partially unknown hardware (e.g. If users want to run GPU benchmarks but don't care about the CPU benchmarks, we shouldn't fail simply because their CPU is not in the supported list). This is actually the current intended behavior for x86_64 (if uarch is unknown, we don't fail but no CPU benchmarks will be run) but without any warning.

In the case that we should fail if hardware is mismatched to the benchmarks (e.g. on CI), the force mode option will be added in a follow-up change (#13198).

As a side effect, some tests are updated to test with new benchmark suite as we change some code to use new path by default.

This enables the detection of mobile phones' CPU/GPU for Android benchmark tool with new benchmark suite #13176

First 3 commits are the major changes. Each commit message describes their goals.

@pzread pzread added benchmarks:cuda Run default CUDA benchmarks benchmarks:x86_64 Run default x86_64 benchmarks labels Apr 20, 2023
@pzread pzread force-pushed the bench-android-tool-migrate-arch branch 6 times, most recently from ff54f00 to 8b90d01 Compare April 20, 2023 05:41
@github-actions
Copy link

github-actions bot commented Apr 20, 2023

Abbreviated Benchmark Summary

@ commit a3449ae47ab17b896b99ab336441c486908b2050 (vs. base f2fc7c5bb95a5e59f540d201474e53563f109f96)

No improved or regressed benchmarks 🏖️

No improved or regressed compilation metrics 🏖️

For more information:

Source Workflow Run

@pzread pzread changed the title Support host detection with new benchmark suite Support device detection with new benchmark suite Apr 20, 2023
@pzread pzread added the (deprecated) buildkite:benchmark-android Deprecated. Please use benchmarks:android-* label Apr 20, 2023
@iree-github-actions-bot
Copy link
Contributor

iree-github-actions-bot commented Apr 20, 2023

Abbreviated Android Benchmark Summary

@ commit 177a3da54b9cfb17a1c0bdb489b443aa2204e28c (vs. base 5363ea3f0ae3af7f016ee4da4ee48f49f869dd99)

Regressed Latencies 🚩

Benchmark Name Average Latency (ms) Median Latency (ms) Latency Standard Deviation (ms)
PoseNet [fp32] (TFLite) full-inference,experimental-flags with IREE-Vulkan @ Pixel-6-Pro (GPU-Mali-G78) 15.861 (vs. 14.645, 8.30%↑) 15.862 0.061

Improved Latencies 🎉

Benchmark Name Average Latency (ms) Median Latency (ms) Latency Standard Deviation (ms)
PoseNet [fp32] (TFLite) big-core,full-inference,default-flags with IREE-LLVM-CPU-Sync @ Pixel-4 (CPU-ARMv8.2-A) 219.793 (vs. 275.624, 20.26%↓) 192.784 37.174

For more information:

@pzread pzread marked this pull request as ready for review April 20, 2023 08:21
@pzread pzread mentioned this pull request Apr 20, 2023
42 tasks
@pzread pzread force-pushed the bench-android-tool-migrate-arch branch from 4e56e94 to 95c1b17 Compare April 21, 2023 16:38
@pzread pzread removed the (deprecated) buildkite:benchmark-android Deprecated. Please use benchmarks:android-* label Apr 21, 2023
@pzread pzread force-pushed the bench-android-tool-migrate-arch branch 3 times, most recently from e4f506a to a024b3a Compare April 21, 2023 20:15
@pzread
Copy link
Contributor Author

pzread commented Apr 21, 2023

Reorg the commits and gave each commit a clear commit message, which should help the code review.

@pzread pzread force-pushed the bench-android-tool-migrate-arch branch 4 times, most recently from 306e283 to 069af70 Compare April 25, 2023 17:37
@pzread
Copy link
Contributor Author

pzread commented Apr 26, 2023

Kindly ping

@pzread pzread added the (deprecated) buildkite:benchmark-android Deprecated. Please use benchmarks:android-* label Apr 26, 2023
@GMNGeoffrey
Copy link
Contributor

Sorry for the delay here, I've been swamped and summiting all last week. I'm looking now, but just from reading the description, I think I'd prefer that fail be the default and auto-detect the special flag. That way it's always clear that autodetection is happening and we don't get silent failures/skips

if cpu_target_arch is None:
print("WARNING: Detected unsupported CPU architecture in "
f'"{self.device_info}", CPU benchmarking is disabled.')
cpu_target_arch = "unknown"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than letting magic string filtering take care of this here, should we have an explicit case for running no cpu benchmarks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that we probably just want to provide a list of the included architectures to the filter_benchmarks_for_category below. Refactored to avoid the magic string and simplify the interface.

@pzread pzread removed the (deprecated) buildkite:benchmark-android Deprecated. Please use benchmarks:android-* label May 2, 2023
@pzread pzread force-pushed the bench-android-tool-migrate-arch branch from 069af70 to 9a50800 Compare May 2, 2023 15:13
@pzread
Copy link
Contributor Author

pzread commented May 2, 2023

#13198

SG. But I think we can address this in #13198

@pzread pzread requested a review from GMNGeoffrey May 2, 2023 16:14
@pzread pzread force-pushed the bench-android-tool-migrate-arch branch from a76d51e to 2b1920b Compare May 2, 2023 16:16
@pzread pzread added the (deprecated) buildkite:benchmark-android Deprecated. Please use benchmarks:android-* label May 2, 2023
Jerry Wu added 7 commits May 2, 2023 22:48
This field indicates the version of the benchmark suite and help the
following control flow make decision.
Later each DeviceArchitecture has a name and implements __str__. Using
that instead of crafting one here.
@pzread pzread force-pushed the bench-android-tool-migrate-arch branch from aced3be to eb885ed Compare May 2, 2023 22:50
@pzread pzread merged commit c7a99d5 into iree-org:main May 3, 2023
Comment on lines 129 to 130
def test_load_from_run_configs(self):
model_tflite = common_definitions.Model(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm looking into it.

Copy link
Contributor Author

@pzread pzread May 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed with #13390

NatashaKnk pushed a commit to NatashaKnk/iree that referenced this pull request Jul 6, 2023
IREE benchmark tool automatically detects the device info of benchmark
device and filter the benchmarks. This change maps the detected info to
device architecture enum of new benchmark suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmarks:cuda Run default CUDA benchmarks benchmarks:x86_64 Run default x86_64 benchmarks (deprecated) buildkite:benchmark-android Deprecated. Please use benchmarks:android-*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants