Skip to content

Add CI job to create PR updating binary-builder Dockerfile with PGO+BOLT toolchain - #97031

Merged
alexey-milovidov merged 1 commit into
masterfrom
toolchain-dockerfile-pr-job
Feb 16, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
toolchain-dockerfile-pr-job

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Feb 15, 2026 •

Copy link
Copy Markdown
Member

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.

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

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

  • Merged into: 26.2.1.771

…+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]>
@clickhouse-gh

clickhouse-gh Bot commented Feb 15, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a193deb]

Summary: ✅

@clickhouse-gh clickhouse-gh Bot added the pr-build Pull request with build/testing/packaging improvement label Feb 15, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

@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...)?

@alexey-milovidov alexey-milovidov mentioned this pull request Feb 15, 2026
@alexey-milovidov alexey-milovidov self-assigned this Feb 16, 2026
@alexey-milovidov
alexey-milovidov merged commit d579c45 into master Feb 16, 2026
137 checks passed
@alexey-milovidov
alexey-milovidov deleted the toolchain-dockerfile-pr-job branch February 16, 2026 00:53
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 16, 2026
@zamazan4ik

zamazan4ik commented Feb 16, 2026 •

Copy link
Copy Markdown

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-build Pull request with build/testing/packaging improvement pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants