-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
llvmPackages.bolt: add experimental bolt hook #375435
base: master
Are you sure you want to change the base?
Conversation
1b7ad73
to
27d0f64
Compare
fd1b9b5
to
6554b12
Compare
0ba380f
to
e1a994c
Compare
@@ -211,6 +211,20 @@ let | |||
}; | |||
}; | |||
|
|||
pkgsBolt = nixpkgsFun { |
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.
Do we really need this? I'm not sure every possible thing you can set on a platform needs its own package set, and I especially don't think we need Hydra to build every single-change stdenv.
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 can drop it before merging but for the purposes of testing this PR, I added it in.
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 think this sort of thing is useful to have. For what it's worth. I don't think its existence needs to promise that it will work, much the same as for pkgsStatic and friends as well. It is quite powerful to have a simple name for this thing to reach for from the shell.
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.
The problem is that these things also make it way too easy to use them within Nixpkgs, and then we end up with a layering violation where a single package is going through a whole distinct package set out of convenience.
But that's a general problem that needs to be solved, by making these inaccessible from within Nixpkgs while still being a convenience layer on top, so if this is really useful it can stay. I think there's no justification for building this set on Hydra, though.
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.
The problem is that these things also make it way too easy to use them within Nixpkgs, and then we end up with a layering violation where a single package is going through a whole distinct package set out of convenience.
We can add in a config option similar to the aliases one which enables the subsets. Then have it disabled in Hydra / CI.
But that's a general problem that needs to be solved, by making these inaccessible from within Nixpkgs while still being a convenience layer on top, so if this is really useful it can stay. I think there's no justification for building this set on Hydra, though.
I kinda agree but its also good to ensure things work.
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.
That relies on somebody actively monitoring that on Hydra indefinitely, which has not historically happened for this sort of thing. Hydra isn't really a great system for "ensuring things work" due to the lack of notifications.
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.
The problem is that these things also make it way too easy to use them within Nixpkgs, and then we end up with a layering violation where a single package is going through a whole distinct package set out of convenience.
We can add in a config option similar to the aliases one which enables the subsets. Then have it disabled in Hydra / CI.
Oh that's not a bad idea!
e1a994c
to
ee19a77
Compare
|
95d1bb5
to
3772b12
Compare
3772b12
to
c035fd0
Compare
if ! isELF "$i"; then continue; fi | ||
if ! @readelf@ --program-headers "$i" | grep -q LOAD; then continue; fi | ||
|
||
llvm-bolt "$i" -o $(dirname "$i")/.bolt-$(basename "$i") "${boltFlags[@]-}" |
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.
So far as I understand, for bolt to be able to meaningfully optimize it needs profile data; do you have any plans to have a mechanism to provide that?
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.
Yes, I just am not sure how to integrate that yet.
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.
One problem with profile data is that it has a habit of being non-determinstic. For example, even if you collect profile data through a determistic mechanism, and run it on a workload which is functionally determinstic (such as clang), what controls the bits of the profile is the control flow repeatability inside the workload. See for example the discussion of applying PGO to clang. https://discourse.llvm.org/t/pgo-profile-reproducibility/82861/6.
It is possible to get around this problem to produce a repeatable profile by collecting multiple profiles and figuring out what is common between them (and then making a script that eliminates the non-common parts from the profile), but it is likely quite a bit of effort to make it happen. In particular if things like 'what inode does this include directory have' factor into the computation; since that is something that will vary from one machine to another.
Things done
Experimental concept, this adds a hook which calls bolt on the installed binaries. The idea is this will optimize the installed binaries. We'll test with just
hello
however all packages can be tried by enablinguseBolt
when specifying the cross platform.nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.