Repository navigation
Create platform-specific targets in benchmark suites - #9237
Conversation
Abbreviated x86_64 Benchmark Summary (experimental)@ commit f54f354d9da592a55b3fa0bf2229a4f093f92171 (vs. base 73f5cc76bea6b0935e63b2ca9f64638e1026fbdc) Improved Benchmarks 🎉
For more information: |
| # Add benchmarks for all platforms. # | ||
| ################################################################################ | ||
| include(android-arm64-v8a.cmake) | ||
| include(android-adreno.cmake) | ||
| include(android-mali.cmake) | ||
| include(linux-x86_64.cmake) |
Abbreviated Benchmark Summary@ commit f54f354d9da592a55b3fa0bf2229a4f093f92171 (vs. base 73f5cc76bea6b0935e63b2ca9f64638e1026fbdc) Improved Benchmarks 🎉
For more information: |
0c516e9 to
2ef8bcf
Compare
antiagainst
left a comment
There was a problem hiding this comment.
Super nice! Thanks for cleaning this up! I do have a question inlined. Assuming it works then LGTM!
| set(_COMPILATION_FLAGFILE "${_RUN_SPEC_DIR}/compilation_flagfile") | ||
| add_custom_command( | ||
| OUTPUT "${_COMPILATION_FLAGFILE}" | ||
| COMMAND ${CMAKE_COMMAND} -E echo -e -- ${_BENCHMARK_COMPILATION_FLAGS} > "${_COMPILATION_FLAGFILE}" |
There was a problem hiding this comment.
Hmm, does this actually work properly to generate multi-line files? I used to run into issues previously: #8181 (comment). Is the trick at L302 does it?
There was a problem hiding this comment.
L302 transforms the list of flags into <flag1>\\n<flag2>\\n..., echo -e will then turn \n into the real newlines. This should be fine as long as each flag is only one line (no newline character in the flag).
The reason we can't use configure_file or file here is because they will always generate the files regardless of the targets. So it will create the incomplete benchmark suite directories if we only compile for one architecture.
There was a problem hiding this comment.
It seems weird to include -- in the flagfile
Also please add a comment noting why we're not using file
There was a problem hiding this comment.
Ah.. I thought cmake -E echo is like echo, but it's not, so this trick doesn't work (it doesn't interpret the newline character). Let me find something else..
There was a problem hiding this comment.
Eventually added a small python script for this. Let me know if you prefer other ways.
There was a problem hiding this comment.
Well I'd really prefer that CMake allowed you to easily do simple things, but alas that will never be
GMNGeoffrey
left a comment
There was a problem hiding this comment.
I still don't like the amount of CMake here, but this definitely seems like an improvement.
| # INTERNAL; VK_ERROR_DEVICE_LOST; vkQueueSubmit; while invoking native function | ||
| # hal.ex.submit_and_wait; while calling import; | ||
| # ``` | ||
| # With current kernel performance and timeouts on Adreno Pixel 4, this means we |
There was a problem hiding this comment.
Didn't we stop benchmarking on Pixel 4 and switch to another Adreno GPU? Not this PR, but we should see if these can be enabled. @antiagainst
There was a problem hiding this comment.
Ah, good catch. Yes, I just turned off Pixel 4 Vulkan benchmarking in #8018. We still benchmark adreno + Vulkan on Moto Edge X30. We can revisit what this comment says, probably after this refactoring PR.
There was a problem hiding this comment.
I prefer not to change the benchmark configs in this PR. We can revisit this later.
There was a problem hiding this comment.
Oh yeah, for sure. I just noticed it as a separate thing while reviewing this
| # `iree-benchmark-module`. | ||
| # | ||
| # Parameters: | ||
| # SUITE_NAME: A group name this benchmark will join. Each group has its own |
There was a problem hiding this comment.
It's confusing to have this called "SUITE_NAME" when the cmake function is also called "suite". It would suggest that these are one-to-one, whereas really a suite can be made up of multiple iree_benchmark_suite calls. Can we rename one or the other?
There was a problem hiding this comment.
Renamed to GROUP_NAME, hope this one is clearer : )
| set(_COMPILATION_FLAGFILE "${_RUN_SPEC_DIR}/compilation_flagfile") | ||
| add_custom_command( | ||
| OUTPUT "${_COMPILATION_FLAGFILE}" | ||
| COMMAND ${CMAKE_COMMAND} -E echo -e -- ${_BENCHMARK_COMPILATION_FLAGS} > "${_COMPILATION_FLAGFILE}" |
There was a problem hiding this comment.
It seems weird to include -- in the flagfile
Also please add a comment noting why we're not using file
As the benchmark suites keeps growing , it wastes time and disk space to build all benchmarks just to run on a specific platform.
This change creates small benchmark suite targets
iree-benchmark-suites-<platform>-<architecture>for each platform and architecture, which only include the related benchmarks. For x86_64 benchmark pipeline, it reduces the module artifact size from 1.27GB to 131MB.It also aligns with the upcoming refactoring for the benchmark framework.