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
Build Turbine native image with PGO #22197
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is pretty large and could potentially be used to hide exploits (I promise I didn't :-)). It would be great if this could be regenerated on import, followed by a rerun of the benchmark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this as a way to get started. Did you have ideas for updating this automatically with CI, or was the idea for now that whoever does the import could regenerate it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably replace the bazel run
script with an aspect that runs a modified Turbine action to collect the profile as an output file. But CI has a lot of other stuff running in parallel, so profiling may not lead to accurate results anymore. Profile generation is highly non-reproducible. Alternatively, we could run this in the release pipeline for java_tools.
src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/update_turbine_pgo.sh
Outdated
Show resolved
Hide resolved
src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/turbine_benchmark.sh
Show resolved
Hide resolved
@iancha1992 Could you add |
I'm working on getting this imported, but there are some details I need to work through internally and it might take another couple of weeks, sorry for the delay |
The Turbine native image is now built with GraalVM Enterprise, making use of its profile-guided optimization capability. A script generates a PGO profile by running Turbine on a representative Java target (currently
skyframe_cluster
).On Linux x86_64, this improves the overall wall time of the benchmark by ~10%:
On macOS with an M3 Max, performance remains mostly unchanged (though without PGO, the binary built from HEAD is slightly slower than the prebuilt one, so in total there could be a somewhat more noticeably improvement):
With
--jobs=4
, the M3 Max reproduces a similar 10% improvement in build wall time, indicating that at a higher level of parallelism Turbine performance doesn't really have an impact on wall time anymore.When manually building
//src/main/java/com/google/devtools/build/lib/cmdline
with Turbine with and without PGO, the M3 Max shows a significant improvement:This commit also bundles a few fixes for the benchmark and Turbine build:
apple_support
, which provides the toolchain used to build Turbine on macOS.rules_graalvm
.--strict-image-heap
to opt into stricter GraalVM behavior that will become the default in the future.