-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/compile: pgo weighted merge support #64487
Comments
CC @golang/compiler. |
It is true that there is no existing tooling to perform a weighted profile merge. That would be nice to have.
https://go.dev/doc/pgo#merging-profiles does allude to this limitation: "you likely want to ensure that all profiles have the same wall duration (i.e., all profiles are collected for 30s). Otherwise, profiles with longer wall duration will be overrepresented in the merged profile." Perhaps it isn't explicit enough, though.
I disagree that this is hard. The |
In compiler/runtime triage, we think that maybe this should be a feature request for the |
Thanks for sharing your prototype! It would be really valuable before we get a "mature" implementation.
Do I need to create this issue in pprof repo instead? |
I'm less convinced that this should go straight to the pprof repo. While I think this would be a decent feature for the pprof CLI (perhaps Perhaps we should have a tool in x/tools for working with profiles, specifically for PGO that could provide extra functionality not available directly in pprof. |
Go PGO documentation shows support for merging multiple PGO profiles. However, as far as I see, there is no support for adding a weight to each profile. I quickly checked the
pprof
merge implementation and also didn't find a way to add weights to profiles for the merge operation.In the current guideline already there is a note about merging multiple profiles into one:
But it also says nothing about adding weights to the profiles.
The use case for such functionality is the following. We gathered N profiles from different workloads. According to our needs, one workload is our primary workload, and others are secondaries. So we want to add some multiplier to optimize as much as possible for our main workload, and optimize for our secondary workloads too but with a lower priority.
llvm-profdata
tool supports weighted merge (here are some invocation examples).Right now I see the following ways, how it can be mitigated:
If you think having such functionality is important for PGO users in Go, I kindly ask implement it. Before the weight implementation, we can put the temporal mitigations to the documentation (of course if they work - I didn't test them yet). Probably it will require some changes on the
pprof
side.The text was updated successfully, but these errors were encountered: