Questions about Perforator #7
-
Hi! Firstly, thank you so much for open-sourcing Perforator! Finally, we have an open-source solution for performing Continuous sPGO for different languages. I have a couple of questions about Perforator. Most of them are about sPGO-related functionality but some of them are about the whole system. I didn't create a dozen of various issues because I don't want to burden maintainers with that ;) If for any question the answer is "no", it would be nice if you can describe a bit further like "why we don't do that" or "no, we don't do it yet but we plan to support it in the future". sPGO-related questions:
General questions:
Thank you for your answers. P.S. Search over the documentation works strangely, if works at all, for the English version of the documentation. E.g. it can find nothing for the "PGO" search query, but you definitely have this word in the docs. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Hi! Great to see you here:) These are excellent, deep questions. We'll need some time to prepare a detailed answer, and we'll get back to you soon. |
Beta Was this translation helpful? Give feedback.
-
Regarding producing data for BOLT: if you collect LBR stacks and store them, it's trivial to produce the profile suitable for BOLT. Please take a look at pre-aggregated profile format described here: https://github.com/llvm/llvm-project/blob/fea18afeed39fe4435d67eee1834f0f34b23013d/bolt/include/bolt/Profile/DataAggregator.h#L372-L415
|
Beta Was this translation helpful? Give feedback.
-
I have tried to answer all of your questions. They should really be part of documentation😃 sPGO-related questions:
Yeah, we do not use GCC extensively, so we have not tested this. It looks like that is just a matter of yet another profile converting routine, and we will be happy to accept potential contributions.
Currently we support LBR on specific CPU model if and only if Linux kernel supports it, the documentation is misleading there. There is no CPU vendor-specific code inside Perforator. LBR should work on modern AMD models on Linux 6.1+ after torvalds/linux@703fb76 and ARM64 after https://lwn.net/Articles/951316/.
I think that this is not in our roadmap for now. While differences between executable/profile formats can be solved, our agent heavily relies on eBPF, making it not portable. Maybe we can provide agents for different operating systems, but I'm afraid that without the need and help from the community this will not happen soon.
We have successfully used sPGO using LLVM 16 and LLVM 18. Previous versions will likely work, but we don't have much evidence.
Again, you are right: we didn't test other linkers. They will probably work, but this requires some validation.
Yes. We are testing BOLT now and are already running some BOLTed binaries. However, things didn't go as smoothly with BOLT as with AutoFDO, so we have not mentioned it yet. We are investigating issues we discovered and hopefully soon will provide documentation on complete BOLT integration.
No, for now we use only
I don't have data available now, but we have seen a few percent improvement in performance when aggregating a lot of sPGO profiles (thousands of atomic profiles sampling 99Hz per CPU core for one minute). I suspect that Fortran should already work. I've compiled a simple executable via gfortran and it seems to contain correct
Yes, the sPGO profiles are encoded in the LLVM's extbinary format and are generated via AutoFDO's Maybe @itrofimow can clarify some of my answers regarding sPGO and the LLVM toolchain we use. General questions:
I'm unable to publish exact numbers publicly, but:
Each component provides Prometheus metrics and structured logging, and user-facing components export OpenTelemetry traces. We are going to publish extensive documentation on operating Perforator cluster, including monitoring, logging, tracing and common debugging scenarios. We also think about providing Grafana panels based on our experience inside Yandex.
Our k8s integration is not as mature as the core of the system, because of differences between internal and open-source environments. Internally we deploy each component of the system without downtime. There can be some problems with Helm charts, but we will fix them.
Not yet for both questions for now. Internally we use custom authentication provider, so it is not available in the open-source version. We have decided to wait for the community input and integrate with the most-requested authentication systems. I think it will be great if you can share some details in #8 (e.g. regarding LDAP vs SAML vs OIDC choice). Yes, search over the documentation does not work. Will fix it. |
Beta Was this translation helpful? Give feedback.
-
Hi @zamazan4ik! I've read through a lot of your posts when putting sPGO together in Perforator, thanks for sharing such a valuable information, much appreciated. To add to what @BigRedEye said:
Perforator doesn't really contain much toolchain-specific code w.r.t. sPGO, all Perforator does is aggregating branch records and passing this aggregation to AutoFDO to do its magic. AFAIK AutoFDO supports generating gcc-specific sPGO profiles via
As Sergey said, we rely on the Kernel here, specifically on the
We didn't test other linkers, but the answer is basically the same as for GCC: as long as AutoFDO supports generating profiles in a format the linker of interest understands -- it might work.
Generating profiles for Propeller should be doable, since AutoFDO does support it, however using Propeller itself required llvm19+, which is not yet feasible for us to test, unfortunately.
I don't think the frequency matters here, but rather the amount of branches which goes into resulting sPGO-profile. Why do you think the frequency could be important? |
Beta Was this translation helpful? Give feedback.
I have tried to answer all of your questions. They should really be part of documentation😃
sPGO-related questions:
Yeah, we do not use GCC extensively, so we have not tested this. It looks like that is j…