Skip to content

[CK-Tile] parity#8128

Closed
ozturkosu wants to merge 3 commits into
muozturk/dispatcher-gemm-bridgefrom
muozturk/dispatcher-gemm-parity
Closed

[CK-Tile] parity#8128
ozturkosu wants to merge 3 commits into
muozturk/dispatcher-gemm-bridgefrom
muozturk/dispatcher-gemm-parity

Conversation

@ozturkosu

@ozturkosu ozturkosu commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase-2 parity harness + captured results for the TE→Dispatcher GEMM bridge (stacked on #8123). All artifacts produced through the bridge on gfx942 (MI300X), fp16/rcr.

  • perf_medians.py — performance medians (≥12 runs +3 warmup) per shape; reports median/min/max ms, TFLOPS, CV%.
  • topk_analysis.py — ranks kernels by TFLOPS per problem; optional second CSV for top-K set overlap + Jaccard.
  • supported_problems.json — the 5-shape problem set fed to the driver.
  • sweep_results.csv / sweep_results_b.csv — two independent bridge sweeps (48 cfgs → 32 unique kernels × 5 shapes).
  • PARITY_REPORT.md — consolidated write-up.

Results (Phase-2 parity gate — met)

  • Numeric: bridge == numpy fp32, max_rel ~3–4e-04 (fp16 tol).
  • Perf: CV ≤ 2.9% (stable); 2048³ ~238 TFLOPS default kernel.
  • Top-K: top-1 a 2x2x1-wave compv3 kernel on every shape; reproducible across two runs (1024³/2048³ Jaccard 1.0; smaller shapes lower from <1.5% near-tie churn).
  • Sweep: 128/128 (100%) on pad-compatible shapes; M=257 declined with status -2 by no-pad kernels (default_config.json has pad_*=false); 16/48 codegen-rejected for invalid 4x1x1_32x32x16 geometry. All rejections explained.

Test plan

  • Numeric parity vs fp32 reference (1024³, 257-class shapes)
  • Performance medians ≥10 runs
  • Top-K fastest kernels reproducible
  • fp16/rcr sweep pass rate (100% on supported shapes; rejections explained)

Notes

  • Base is the bridge branch ([CK_TILE] Add Tile Engine -> Dispatcher bridge for GEMM #8123), not develop — the scripts import gemm_utils.py / drive gemm_full_benchmark.py, which only exist on the bridge branch.
  • Old-TE head-to-head deferred: no compiled legacy TE benchmark binary in this env; the bridge reuses the same unified_gemm_codegen, so kernels are byte-identical and ranking parity is shown via reproducibility.

Numeric/perf/top-K/sweep parity scripts driving the TE->Dispatcher GEMM
bridge, plus the captured fp16/rcr sweep CSVs and the consolidated report.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a Phase-2 parity “artifact drop” under projects/composablekernel/parity/ for the TE→Dispatcher GEMM bridge (stacked on #8123), including small analysis scripts plus captured sweep outputs and a consolidated report for gfx942 fp16/rcr.

Changes:

  • Add topk_analysis.py and perf_medians.py scripts to summarize sweep top-K kernel rankings and report timing medians/CV%.
  • Check in captured artifacts (supported_problems.json, sweep_results*.csv) used by the parity write-up.
  • Add PARITY_REPORT.md documenting numeric/perf/top-K/sweep outcomes and interpretation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
projects/composablekernel/parity/topk_analysis.py Script to rank top-K kernels per problem and optionally compute top-K overlap/Jaccard across two runs.
projects/composablekernel/parity/perf_medians.py Script to compute median/min/max latency, TFLOPS, and CV% for a fixed default kernel across selected shapes.
projects/composablekernel/parity/supported_problems.json Declares the 5-shape problem set used for parity runs.
projects/composablekernel/parity/sweep_results.csv Captured sweep results (run A) used by top-K analysis/report.
projects/composablekernel/parity/sweep_results_b.csv Captured sweep results (run B) used for reproducibility/overlap comparisons.
projects/composablekernel/parity/PARITY_REPORT.md Consolidated Phase-2 parity report describing numeric/perf/top-K and sweep pass/rejection behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread projects/composablekernel/parity/topk_analysis.py
Comment thread projects/composablekernel/parity/topk_analysis.py Outdated
Comment on lines +49 to +52
sa, sb = {n for n, _ in ta}, {n for n, _ in tb}
inter, union = len(sa & sb), len(sa | sb)
jac = inter / union if union else 1.0
print(f" top-{args.k} set overlap vs B: {inter}/{args.k} Jaccard={jac:.2f}")
Comment on lines +1 to +2
#!/usr/bin/env python3
"""Task #20 — performance medians (>=10 runs) for the bridge default kernel.
Comment on lines +32 to +34
def main():
runner = GpuGemmRunner(lib_path=str(SO))
print(f"Kernel: {SO.name}")
Comment on lines +54 to +56
if not ok or not times:
print(f"{label:<18}{M:>6}{N:>6}{K:>6} FAILED (status nonzero)")
continue
Comment on lines +20 to +22
max_rel ~3–4e-04 is at fp16 accumulation tolerance. 257³ (K=257) is rejected by the
kernel even with padding — K is the contiguous reduction dim and fp16 needs the inner
vectorized load aligned; this is a genuine kernel constraint, faithfully surfaced.
ozturkosu and others added 2 commits June 5, 2026 14:16
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ozturkosu ozturkosu closed this Jun 28, 2026
@ozturkosu

Copy link
Copy Markdown
Contributor Author

not needed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants