Skip to content

[CI][DO NOT MERGE] Probe: LLVM pin bump on top of #1071 - #1072

Draft
Phil-amd wants to merge 3 commits into
mainfrom
ci/base-llvm-baseline-probe-1051
Draft

[CI][DO NOT MERGE] Probe: LLVM pin bump on top of #1071#1072
Phil-amd wants to merge 3 commits into
mainfrom
ci/base-llvm-baseline-probe-1051

Conversation

@Phil-amd

Copy link
Copy Markdown
Member

Throwaway probe for #1071. Do not merge, do not review as a change — it exists only to drive CI down the pin-bump path. #1051 is untouched; its commit is cherry-picked here.

Contents: #1071 (the baseline-MLIR change) plus @Phil-amd's commit from #1051 (33d9959, LLVM e2a39f50 -> 941a04e6 and the gpu.launch_func adaptation).

What this run can prove

  • Resolve base LLVM pin reports pin_changed=true (verified locally against this exact tree).
  • The gated steps run instead of skipping.
  • On a baseline cache miss, the run degrades as designed: the skip notice names the base pin, vs latest tag still runs, and the PR stays green.

What it cannot prove yet, and why

The baseline cache will miss, and that is expected — not a bug.

The entry it looks for is keyed ...4087a417 (main's three LLVM inputs under the new content-derived formula). Nothing has saved that yet: caches created by a PR are scoped to that PR's merge ref, so #1071's own run cannot warm it for anyone else. Only a push to main saves an entry other PRs can read.

So the positive control — cache hit, baseline wheel built against the old MLIR, a printed current vs main table — needs this order:

  1. Merge [CI] Build the benchmark baseline wheel against the base commit's LLVM #1071.
  2. Let main's push run save the MLIR install under the new key.
  3. Re-run this PR's checks.

Until step 2, a skip here is the correct behaviour, and today it is also what #1051 gets on main.

Expected on the first run

Resolve base LLVM pin pin_changed=true, base_llvm_hash=e2a39f50…
Restore baseline MLIR cache miss
Unpack and verify baseline MLIR notice: no cached install for e2a39f50…, vs-main skipped
base wheel built against the PR MLIR, fails to compile (the #1051 symptom), existing warning
BASELINE_LLVM marker absent, so the table stays main@<sha> with no (llvm …) suffix
vs latest tag runs normally

Also note prepare-mlir cold-builds LLVM here: the key formula changed, so the old cache does not apply. That cost is stated in #1071.

Close this once #1071 lands and the positive control has been observed.

prepare-mlir builds one shared MLIR install from the PR's pin and uses it
for both wheels. An LLVM pin bump also carries the source adaptation that
the new pin requires, so the base commit cannot compile against it and the
baseline wheel is never produced. The run ends at "No usable main benchmark
baseline found" (run 32954898547, PR #1051), losing the vs-main comparison
for exactly the PRs whose performance impact is least predictable.

When the LLVM inputs differ from the base commit's, restore the MLIR install
belonging to the base pin and build the baseline wheel against that.

- ci_mlir_cache_key.sh derives the cache key from file contents, making it
  computable for the base commit. It replaces hashFiles() and serves both
  call sites, so the two keys cannot drift.
- The baseline entry is restored before the shared one and under the same
  path. actions/cache derives its version from the path list, so a renamed
  restore would miss whatever the key said.
- The unpacked install is checked against its VCSRevision.h. A wrong-pin
  baseline is worse than none: it yields a plausible number nobody queries.
- prepare-mlir marks the wheel with the LLVM it was really built against,
  and the table is labelled from that marker. Deriving it from the pinned
  hashes would mislabel a bump that needed no source adaptation.

A cache miss means no baseline. The wanted entry is the one every non-bump
PR restores on every run, so a miss is the exception.

Changing the key formula invalidates the cache, so every PR cold-builds LLVM
until main's next push saves an entry under the new one.
…wering

Move the upstream LLVM pin from e2a39f504fee to 941a04e69ee8.

Upstream merged the two gpu::LaunchFuncOp builders taking a SymbolRefAttr
kernel into one, inserting `Value asyncObject` before `clusterSize`.
LaunchFuncOpLowering chose between the two old signatures, so neither call
matched any more; FlyToROCDL.cpp was the only translation unit that failed to
build. Collapse both branches into one call against the merged builder.

This also stops an op carrying both an asyncObject and an async token from
losing the token: the old asyncObject builder never pushed an AsyncTokenType
onto the result types.

Signed-off-by: Phil Li <haicli@amd.com>
Throwaway, for PR #1072 only. Never merge this commit.

The baseline entry #1072 needs is keyed on main's LLVM inputs, and nothing
has saved it: caches a PR creates are scoped to that PR's merge ref, so
#1071 cannot warm it for another PR. Only a push to main can.

Rather than block the positive control on that merge, build the base pin
here and save it under the base key at this PR's own scope, which the PR
can read back:

- First run: baseline restore misses, the scaffolding builds the base
  commit's LLVM and saves it. Everything downstream then runs against a
  real base MLIR - the base wheel compiles where it cannot on main today,
  the BASELINE_LLVM marker is written, and the vs-main table prints.
- Re-run: the restore hits, exercising the real cache path end to end.

The second llvm-project source and build tree are dropped as soon as the
tarball is packaged, so the wheel build does not run with both on disk.
@Phil-amd

Copy link
Copy Markdown
Member Author

Added probe scaffolding (bd8a6ec) so this PR can produce the positive control without waiting on #1071.

The entry this PR wants is keyed on main's LLVM inputs and nothing has saved it — PR caches are scoped to their own merge ref, so #1071 cannot warm it for another PR. But refs/pull/1072/merge is this PR's own scope, and it can both write and read there. So: build the base pin here, save it under the base key, read it back on a re-run.

Run 1 (this push) — baseline restore misses, scaffolding builds LLVM e2a39f50, saves it. Everything downstream then runs against a real base MLIR:

  • Building base wheel from /tmp/flydsl-ci-base (MLIR: /llvm-project/mlir_install_base)
  • the base wheel compiles, where on main it dies at no matching function for call to 'gpu::LaunchFuncOp::create(...)'
  • Baseline MLIR verified at LLVM e2a39f50…
  • BASELINE_LLVM marker written, table header main@<sha> (llvm e2a39f50), current vs main prints

Run 2 (re-run all jobs) — the restore hits and the same chain runs off the cache rather than a fresh build. That is the real path.

Scaffolding is three steps plus a cache save, all continue-on-error, all confined to this branch. #1071 is unchanged at 770cf11. The second llvm-project source and build tree are dropped as soon as the tarball is packaged, so the wheel build does not run with both on disk.

Still not covered by any of this: that a push to main saves an entry the next PR can read. That is GitHub's own cache-scope behaviour, not something this change introduces.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant