Repository navigation
feat(site): kernels section, each contract's speedup over its baseline on main - #319
Merged
Merged
Conversation
RuibinCheung
marked this pull request as ready for review
November 22, 2026 03:54
RuibinCheung
requested review from
irvineoy,
jiejingzhangamd,
kyle-256,
xiaobochen-amd and
zhenhuang12
as code owners
November 22, 2026 03:54
There was a problem hiding this comment.
🟡 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
Restrict the GitHub App token to contents write · New Rebuild the site after delayed bot PR merges · New Honor AKLR_MIN_SPEEDUP when choosing the default threshold · New Accept legacy bot commit subjects when parsing provenance · New Do not report non-baseline speedups as baseline comparisons · New Normalize measurement timestamps to UTC before storing · New Preserve measurement provenance when publishing carried-forward results · New Account for kernel requirements when reporting the serving kernel · New Track provenance per selected schema, not per contract · New Name the chart and remove unlabeled dot tab stops · New Do not derive baseline latency from speedup confidence bounds · New
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 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))} {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>' |
…LR_MIN_SPEEDUP, no speedup without a baseline, show kernel.requires, drop Baseline µs
…render.py -> report_render.py
zhenhuang12
approved these changes
Nov 23, 2026
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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 onmain. AKLR-CI rebuilds the section after every push tomain.Scope
benchmarks/kernels/kernels_report(new): readsmain's committed schemas and builds the section.DispatchTable.from_schemasatAKLR_MIN_SPEEDUP. An op without a baseline serves every Point that has not failed.perf: measurements on …bot commit that touched each schema file.index.html, one table with a row per contract;contracts/<id>.html, with the per-Point table and a speedup chart;data.jsonandsection.json.ci.yaml: a newpublish-kernelsjob runs afterpublish-measurementon pushes tomain, using the bot App token and thesite-dataconcurrency group. It checks outmain's tip and commitskernels/throughcommit_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/benchmarks/test_kernels_report.py: new, 7 test functions on[email protected].test_agentx_publish.py: updated for the second workflow.pyproject.toml: addsbenchmarks/kernelsto 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.12Gate overrides: none
Code
pytest tests/benchmarks: 350 passed, including the newtest_kernels_report.py.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.site-databranch.build_site.pythen builds the home page with both sections, agentx and kernels.aklr/core, so no schema or measurement version changes.Not run
publish-kernelsand thesite.yamltrigger have not run on GitHub yet. They run only on pushes tomainafter merge.aklr/code changed. Left to this PR's CI.Risk
Affects: the Pages site and AKLR-CI on
mainpushes (one more job, afterpublish-measurement); no kernel or runtime behaviorAgentX: none
If wrong:
publish-kernelsfails or writes a wrongkernels/section; it cannot changemain's code or the agentx sectionUndo:
git revert; thekernels/directory already onsite-datastays until removed by hand