Skip to content

feat(site): kernels section, each contract's speedup over its baseline on main - #319

Merged
zhenhuang12 merged 4 commits into
mainfrom
feat/kernels-site-section
Nov 23, 2026
Merged

zhenhuang12 merged 4 commits into
mainfrom
feat/kernels-site-section

Conversation

@RuibinCheung

@RuibinCheung RuibinCheung commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The Pages site has no view of what the committed kernels deliver. This PR adds a kernels/ section: for every contract, the speedup over its baseline at each Point that dispatch serves on main. AKLR-CI rebuilds the section after every push to main.

Scope

  • benchmarks/kernels/kernels_report (new): reads main's committed schemas and builds the section.
    • Which kernels: kernels that target gfx950/MI355X.
    • Winner per Point: chosen by the runtime's own DispatchTable.from_schemas at AKLR_MIN_SPEEDUP. An op without a baseline serves every Point that has not failed.
    • Measurement source: taken from the newest perf: measurements on … bot commit that touched each schema file.
    • Output: index.html, one table with a row per contract; contracts/<id>.html, with the per-Point table and a speedup chart; data.json and section.json.
    • Display rules: Points that are not served show "—". Geomean and range count served Points only.
    • Runtime code: only imported, not modified.
  • CI:
    • ci.yaml: a new publish-kernels job runs after publish-measurement on pushes to main, using the bot App token and the site-data concurrency group. It checks out main's tip and commits kernels/ through commit_site_data.sh.
    • site.yaml: now also deploys after AKLR-CI push runs.
    • build_site.py: adds the "Not served" and "Not measured" status labels.
  • Tests:
    • tests/benchmarks/test_kernels_report.py: new, 7 test functions on [email protected].
    • test_agentx_publish.py: updated for the second workflow.
    • pyproject.toml: adds benchmarks/kernels to the pytest path.
    • tests/AGENTS.md: adds the layout exception for the new test.

Verification

Environment: head 4a4ceb51, CPU only (no GPU needed), Python 3.12
Gate overrides: none

Code

  • pytest tests/benchmarks: 350 passed, including the new test_kernels_report.py.
  • pre-commit on the changed files passes (ruff, yaml, tests layout).
  • Real data on this head: PYTHONPATH=benchmarks/kernels python3 -m kernels_report --run-id local <dir> gives 62 contracts and 3481/4691 points served. Contract status counts: ok 33, partial 21, not-measured 8.
  • Full site build: I copied that output into a clone of the current site-data branch. build_site.py then builds the home page with both sections, agentx and kernels.
  • No change to aklr/core, so no schema or measurement version changes.

Not run

  • publish-kernels and the site.yaml trigger have not run on GitHub yet. They run only on pushes to main after merge.
  • aiter-test, sglang-test and vllm-test: no kernel, schema or aklr/ code changed. Left to this PR's CI.

Risk

Affects: the Pages site and AKLR-CI on main pushes (one more job, after publish-measurement); no kernel or runtime behavior
AgentX: none
If wrong: publish-kernels fails or writes a wrong kernels/ section; it cannot change main's code or the agentx section
Undo: git revert; the kernels/ directory already on site-data stays until removed by hand

@RuibinCheung
RuibinCheung marked this pull request as ready for review November 22, 2026 03:54
Copilot AI max review requested due to automatic review settings November 22, 2026 03:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The report subprocess receives a GitHub App token with unnecessary pull-request write permissions, while unresolved benchmark, provenance, and dispatch-eligibility errors can misrepresent results.

11 open issues
What changed in this PR

Adds a kernel-performance section to AKLR’s Pages site, summarizing gfx950/MI355X kernels from committed main schemas using runtime dispatch selection, without modifying runtime code.

Changes:

  • Collects dispatch winners, served-point statistics, and measurement provenance.
  • Generates bilingual index and contract pages, speedup charts, and JSON output.
  • Adds main-push publication, extends Pages deployment, and introduces report tests.
File Description
tests/​benchmarks/​test_kernels_report.py Tests collection, dispatch summaries, provenance parsing, and rendering.
tests/​benchmarks/​test_agentx_publish.py Updates expected deployment workflow names.
tests/​AGENTS.md Documents the kernels-report test layout exception.
pyproject.toml Adds the report package to pytest’s import path.
benchmarks/​kernels/​kernels_report/​render.py Generates bilingual pages, charts, and JSON files.
benchmarks/​kernels/​kernels_report/​collect.py Collects target schemas, dispatch results, and provenance.
benchmarks/​kernels/​kernels_report/​__main__.py Provides the report-generation command and run metadata.
benchmarks/​kernels/​kernels_report/​__init__.py Defines the report package’s purpose.
.github/​workflows/​site.yaml Adds deployment after AKLR-CI main-push runs.
.github/​workflows/​ci.yaml Adds kernel-section publication after measurement publishing.
.github/​scripts/​build_site.py Adds labels for unserved and unmeasured statuses.

Review effort: Max

Comment thread .github/workflows/ci.yaml Resolved
Comment thread .github/workflows/ci.yaml
Comment on lines +623 to +626
publish-kernels:
needs: publish-measurement
if: >-
!cancelled() && github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.AKLR_BOT_LOGIN != ''
parser.add_argument("--repo-url", default=f"{server}/{repository}")
parser.add_argument("--ref", default=os.environ.get("GITHUB_REF", ""))
parser.add_argument("--event", default=os.environ.get("GITHUB_EVENT_NAME", ""))
parser.add_argument("--min-speedup", type=float, default=DEFAULT_MIN_SPEEDUP)
SERVED = "served"
# Contract status keys, as section.json's status_counts holds them.
STATUSES = ("ok", "partial", "not-served", "not-measured")
BOT_SUBJECT = re.compile(r"perf: measurements on (?P<hardware>\S+) \(run (?P<run>\d+)\)")
]
# the rank dispatch serves the key at: the lowest among its any_size workloads
workload = min(same, key=schema.rank_key)
row = (SERVED, schema.name, schema.kernel.language, path, workload.speedup, workload.microseconds)
if match := MEASURED_LINE.fullmatch(line.strip()):
found.setdefault(
match["path"],
Measurement(subject["run"], fields[1], match["sha"], subject["hardware"]),
errors += found
for path, schema in schemas:
# a definition (no kernel sources) declares a scenario; it serves nothing
if schema.kernel.sources and DeviceTarget.matches_target(target, schema.kernel.targets):
Comment on lines +279 to +282
newest = max(
(measurements[path] for path, _ in schemas if path in measurements),
key=lambda m: m.measured_at,
default=None,
Comment on lines +313 to +325
dots = "".join(
f'<circle cx="{x(i):.1f}" cy="{y(p.speedup):.1f}" r="{radius}" '
f'fill="{"#34d399" if p.speedup >= 1 else "#fbbf24"}" tabindex="0" '
f'data-point-tooltip="{escape(dims_text(p.dims))}&#10;{p.speedup:.3f}× · {escape(p.kernel or "")}"/>'
for i, p in enumerate(served)
)
caption = tr(
lang,
f"{len(served)} served points by speedup, log scale; dashed lines at 1× and the threshold",
f"{len(served)} 个生效点,按 speedup 排序,对数刻度;虚线为 1× 与生效门槛",
)
axis = f'<text class="axis" x="{(left + width - right) / 2}" y="{height - 8}" text-anchor="middle">{caption}</text>'
return f'<svg class="chart" viewBox="0 0 {width} {height}" role="img">{grid}{refs}{dots}{axis}</svg>'
@zhenhuang12
zhenhuang12 merged commit 685a1bb into main Nov 23, 2026
12 checks passed
zhenhuang12 added a commit that referenced this pull request Nov 25, 2026
…at the rebase leaves

Main's kernels report (#319) reads the contract registry: its test and the publish-kernels job are
out until it reads the schema files, as the plugins' tests are, and its imports sort as ruff now
sees the removed package.

TODO.md: what core reads of aklr/plugins/aiter, and what of main's #293 and #322 is not carried
(float32 references but biased_grouped_topk's, the common tolerance and SQNR bounds, the shorter
bench_cudagraph).
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.

3 participants