Repository navigation
Add CI job to create PR updating binary-builder Dockerfile with PGO+BOLT toolchain - #97031
Conversation
…+BOLT toolchain After the OptimizeToolchain workflow builds PGO+BOLT optimized clang for both amd64 and aarch64, a new job now automatically creates a PR that updates `TOOLCHAIN_COMMIT` in the `binary-builder` Dockerfile. The Dockerfile gains a conditional download block: when `TOOLCHAIN_COMMIT` is set to a commit SHA, it fetches the optimized toolchain from S3 and extracts to `/usr/local/`, where it shadows the apt-installed `clang-21` via PATH priority. The default value `none` preserves backward compatibility. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
@zamazan4ik, one question - if we profiled using ClickHouse release build, will it be meaningful to improve other build types (clang-tidy, debug, asan, ubsan, msan, tsan...)? |
TL;DR - yes, it will be a good idea, but some performance opportunities could be missed compared to more precise PGO profiles per workload. @alexey-milovidov as always - "it depends" :) Your current training workload for Clang is just compiling ClickHouse itself by Clang. So other Clang's code patgs besides the regular compilation routine are not covered currently. I have no data regarding speeding up sanitizers somehow by PGO - never tested it. At very least, for sanitizer build you can reuse your regular "compilation" training data - it should work fine, since sanitizers doesn't involve large additional large and CPU-consuming code paths inside Clang compared to a regular build routine, AFAIK. Optimizing Clang-Tidy with PGO is a viable option, yes, and here I have PGO-related Clang Tidy benchmarks. I cannot say how much perf you can get if you collect a dedicated training set for Clang Tidy workloads compared to your current "build only" training profile - Clang Tidy inside executes a large amount of additional code compared to a vanilla Clang. In my tests I used Clang Tidy-specific PGO training set. |
After the OptimizeToolchain workflow builds PGO+BOLT optimized clang for both amd64 and aarch64, a new job now automatically creates a PR that updates
TOOLCHAIN_COMMITin thebinary-builderDockerfile.The Dockerfile gains a conditional download block: when
TOOLCHAIN_COMMITis set to a commit SHA, it fetches the optimized toolchain from S3 and extracts to/usr/local/, where it shadows the apt-installedclang-21via PATH priority. The default valuenonepreserves backward compatibility.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Use the PGO-optimized LLVM/Clang build in CI, which should give 20..30% build speed improvement.
Version info
26.2.1.771