Skip to content

Run the amd_release master_head performance comparison in 8 batches - #129176

Closed
groeneai wants to merge 1 commit into
ClickHouse:masterfrom
groeneai:perf-comparison-amd-master-head-8-batches
Closed

groeneai wants to merge 1 commit into
ClickHouse:masterfrom
groeneai:perf-comparison-amd-master-head-8-batches

Conversation

@groeneai

@groeneai groeneai commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #129051

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

Performance Comparison (amd_release, master_head, N/6) jobs now hit their 7200 s timeout. A killed job ends in ERROR without a report, in whatever phase it was (benchmark, confirm, log export, report). In the last 7 days that happened 22 times on master (11 on 2026-11-03) and 15 times on 11 PRs, for example master 5/6 and #129051 4/6.

The suite had 400 tests when it was split into 6 (#89598) and has 844 now. Each amd shard pays about 28 min of fixed setup and teardown plus its share of 418 benchmark minutes. The tests are dealt round-robin over the sorted names, so the heaviest shard depends on the list. Today 5/6 gets 87.3 benchmark minutes, projected at 115.6 min in total (measured p50 110.3), and a slower host pushes it past 120.

This PR raises the amd batch count to 8. Projected from the per-test durations in 154 master job logs, the heaviest shard comes to 83.9 min, and the worst shard of a run stays under 97.3 min at p99. The cost is +56 runner-minutes per master commit (+9.6% of amd perf). On PRs the amd jobs run only with pr-performance/ci-performance or a "Performance Improvement" body. The workflow YAML is regenerated with python3 -m praktika yaml.

arm stays at 6: its heaviest shard (5/6) measures p50 106 min, max 112, on master since the test list last changed, with no timeout on master in 30 days outside the 2026-10-16 CI Logs outage (4 on PRs in the last 7 days). arm runs on every PR, so two more arm batches would cost every PR about 56 runner-minutes. If the suite grows as in October (+21% a month), arm 5/6 passes 120 min in about a month, and the amd shards are near 110 min again in about two.


Workflow [PR]
Sync PR [sync-upstream/pr/129176]

The performance tests were split into 6 batches per architecture in ClickHouse#89598
(2025-11-05), when the suite had 400 tests. It has 844 now. Every amd shard
pays about 28 minutes of fixed work (21.3 min setup, 6.9 min after the
benchmark) on top of its share of the 418 benchmark minutes, and the tests
are dealt round-robin over the sorted file names, so the heaviest shard
depends on the current list. Today 5/6 gets 87.3 benchmark minutes, which
projects to 115.6 min against the 7200 s job timeout (measured p50 110.3 min
since the list changed). A slower host then kills the job in whatever phase
is running, and it reports nothing: 11 true-master kills on 2026-11-03, 22 on
master and 20 on 12 pull requests in the last 7 days, e.g.
https://github.com/ClickHouse/ClickHouse/actions/runs/41725276546/job/126262491921
https://github.com/ClickHouse/ClickHouse/actions/runs/41701684670/job/126237391419

With 8 batches the heaviest amd shard projects to 83.9 min, and the worst
shard of a run stays under 97.3 min at p99 over the measured host-speed
spread. The price is +56 runner-minutes per master commit (+9.6% of amd
perf). On pull requests the amd jobs run only with the `pr-performance` or
`ci-performance` label or a "Performance Improvement" body.

arm stays at 6: it runs the same tests about 15% faster, had no timeout kill
in 30 days (heaviest shard projected at 98.6 min), and runs on every pull
request, so more arm batches would cost every PR that runs perf.

The workflow files are regenerated with `PYTHONPATH=./ci:. python3 -m praktika yaml`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (3 findings, all on the PR text).

# Sev Finding Verdict Evidence / action
1 ⚠️ The arm numbers in the description were a projection (98.6 min) below the measured heaviest shard AGREE, fixed in the description CIDB, master since the test list last changed: arm 5/6 p50 106.2, max 112.0 min (54 runs)
2 💡 The PR timeout count included runs of one branch with a longer job limit AGREE, fixed in the description 15 timeouts at 120.4-120.8 min on 11 PRs in 7 days
3 💡 The growth sentence covered amd only AGREE, fixed in the description arm 5/6 reaches 120 min in about a month at October's growth

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, as a capacity check: a script imports this tree's performance_comparison_with_master_head_jobs, selects tests like performance_tests.py ([batch_num::total_batches]) and projects each shard from per-test medians of 154 master job logs. On the base it always fails: amd 5/6 projects to 115.6 min. CIDB, 7 days: 22 amd timeouts on master and 15 on 11 PRs; 0 arm timeouts on master.
b Root cause explained? 844 tests vs 400 when split into 6 (#89598); about 28 min fixed per shard plus its share of 418 benchmark min; the round-robin draw gives 5/6 87.3 min; a slower host crosses 7200 s.
c Fix matches root cause? Yes: the work no longer fits 6 shards, so it goes over 8. No timeout bump, no test dropped.
d Test intent preserved / new tests added? CI config change: no infrastructure self-test (#119766). The same 844 tests run, in 8 slices.
e Both directions demonstrated? Base (6): fails, worst shard P(>120 min) 28.9%. Fix (8): passes, heaviest shard 83.9 min, p99 97.3. Mutations 7 (pass) and 5 (fail) show the check reads the tree.
f Fix is general across code paths? arm master_head left at 6 and disclosed (heaviest shard p50 106 min on master, no timeout there in 30 days outside the 2026-10-16 CI Logs outage, runs on every PR); release_base, Iceberg and nightly are other configs. Selection, filter_job.py and the phase deadlines do not depend on the batch count.
g Fix generalizes across inputs (params/datatypes/wrappers)? Each k/8 slice is non-empty; the 8 slices are disjoint and cover all 844 tests, and the slicing partitions any list length.
h Backward compatible? (maintainer-approved exception only) CI config only. The amd check names become N/8; no history or threshold query depends on the batch.
i Invariants and contracts preserved? Every amd test runs in exactly one batch that fits the timeout. The workflows are regenerated and in sync. Timeout, runner and artifacts are unchanged.

Session id: cron:clickhouse-impl-slot-41:20261104-043300

@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

cc @egor-click, could you review this and add the can be tested label so CI runs? It splits the amd_release master_head performance comparison into 8 batches instead of 6, because the heaviest amd shard now projects to about 116 of its 120 minutes and slower hosts get killed with no report; arm stays at 6 (trade-off in the description).

@clickhouse-gh

clickhouse-gh Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [9556c55]

Summary: ✅


AI Review

Summary

Splits the amd_release performance comparison against master_head into eight batches instead of six to reduce timeout failures. No actionable findings.

Missing context / blind spots
  • ⚠️ The current CI run skipped all eight amd performance jobs. The stated runtime estimates come from the author's historical-log projections; an eight-batch run would confirm the timeout margin.
Final Verdict

✅ Approve. The documented capacity analysis supports this CI configuration change; no blocking issues identified.

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). can be tested Allows running workflows for external contributors labels Nov 4, 2026
@Algunenano

Copy link
Copy Markdown
Member

@groeneai Can you please audit how we've increased the performance checks lately too?

We should:

  • Reduce long queries (> 1 second)
  • Remove duplicated queries that test the same path (same type, same length)
  • Remove duplicated files (merge them) so we don't run tests unnecessarily.

Also, it's odd that we only increase amd and not arm, so we should also investigate that. Let's open a ticket and start creating smaller PRs addressing these issues, please

@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Acknowledged. I'll open an issue for the audit (queries over 1 s, queries that test the same path, duplicated files, and why only amd needs more batches), link it here, and send one small PR per finding. I'll also come back to this PR with the amd vs arm result.

@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

I opened #129258 with the audit. Two results that matter for this PR:

  • amd vs arm: same tests and same setup, but amd runs on m7i.4xlarge (8 physical cores, both servers pinned to them with max_threads = 8) and arm on m8g.4xlarge (16 cores, max_threads = 12). Single-threaded queries take the same time (amd/arm median 0.96), multi-threaded ones are 13% slower on amd, and amd profiles about twice as many queries as changed. So an amd shard runs about 10 min longer than an arm shard with the same tests.
  • The amd timeouts started with the result digest of Run the performance tests on Iceberg tables #128261 (merged 2026-11-03): it adds about 42 min per architecture per commit, mostly by running FORMAT Null queries with huge results again. amd shards went from p50/p90 92/102 min to 100/113 min, and 13 of 508 amd runs timed out since, against 0 of 336 in the 24 h before.

I'll first send a PR that bounds the digest cost and re-measure the amd shards with it. If they are back near 100 min at p90, I'll close this PR; otherwise it stays as it is.

@egor-click

Copy link
Copy Markdown
Contributor

let me take a look at this today, i’ll check how we can improve this, i have some ideas

@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

I won't send the digest-bound PR: #129279 makes the result digest opt-in and CI does not enable it, so it removes all of the digest's CI cost, not only the part over 200,000 rows. Once #129279 is merged I'll re-measure the amd shards and keep or close this PR as I said above.

Ergus pushed a commit to Ergus/ClickHouse that referenced this pull request Nov 11, 2026
Add separate instrumented shards to `NightlyCoverage`. Reuse `perf.py` to
collect setup, first execution, repeated execution, and teardown coverage,
with expanded-query hashes and snapshot manifests. Export source coverage
through the existing CIDB coverage pipeline; do not publish performance
measurements from instrumented runs.

Context:
ClickHouse#129176
ClickHouse#129303
@groeneai

Copy link
Copy Markdown
Collaborator Author

Re-measured on master after #129279 merged. Since 2026-11-11 the amd_release master_head shards ran p50/p90 86/96 min (92/102 before #128261, 100/113 after it); 2 of 2473 runs timed out, the last on 2026-11-13 04:15Z. Over the last 72 h every amd shard's p99 is at most 103 min, so the two extra batches are not needed now. Closing this PR as I said above.

@groeneai groeneai closed this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants