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

Evaluate Profile-Guided Optimization (PGO) #387

Open
zamazan4ik opened this issue Oct 12, 2023 · 2 comments
Open

Evaluate Profile-Guided Optimization (PGO) #387

zamazan4ik opened this issue Oct 12, 2023 · 2 comments

Comments

@zamazan4ik
Copy link

Hi!

Recently I did many Profile-Guided Optimization (PGO) benchmarks on multiple projects - the results are available here. Here you can find different applications from different domains that were accelerated with PGO: operating systems (like Linux and Windows kernels), virtual machines (like QEMU and CrosVM), compilers, gRPC workloads, benchmark tools, databases, and much more. So that's why I think it's worth trying to apply PGO to LK.

I can suggest the following things to do:

  • Evaluate PGO's applicability to LK via benchmarks.
  • If PGO helps to achieve better performance - add a note to LK's documentation about that. In this case, users and maintainers will be aware of another optimization opportunity for LK.
  • Provide PGO integration into the build scripts. It can help users and maintainers easily apply PGO for their own workloads.

After PGO, I can suggest evaluating LLVM BOLT as an additional optimization step after PGO.

@travisg
Copy link
Member

travisg commented Feb 27, 2024

So the question here is how does the system get the data out of the run and back into the build system? In the case of an operating system kernel, the trouble is the data ends up on the device and it's hard to extract it. Is there any prior art to running this over a kernel?

@zamazan4ik
Copy link
Author

So the question here is how does the system get the data out of the run and back into the build system?

In general case, PGO profiles are saved to a disk. Then, on the optimization phase, these profiles are passed to a compiler via compiler options like -fprofile-use=pgo_profile_name (more details can be found in the documentation for your compiler).

In the case of an operating system kernel, the trouble is the data ends up on the device and it's hard to extract it. Is there any prior art to running this over a kernel?

Yes, there are multiple examples:

E.g. in the Linux kernel case, profiles can be gathered via procfs (AFAIK) and then passed to the compiler on the optimization phase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants