Skip to content

[examples][xegpu] Add gridsearch and genetic algorithm autotuners#79

Merged
tkarna merged 9 commits intollvm:mainfrom
tkarna:xegpu-autotune
Mar 24, 2026
Merged

[examples][xegpu] Add gridsearch and genetic algorithm autotuners#79
tkarna merged 9 commits intollvm:mainfrom
tkarna:xegpu-autotune

Conversation

@tkarna
Copy link
Copy Markdown
Contributor

@tkarna tkarna commented Mar 16, 2026

Adds tune_matmul_gridsearch.py and tune_matmul_ga.py methods. See README.md for instructions.

@tkarna tkarna force-pushed the xegpu-autotune branch 3 times, most recently from 71b7980 to 513f36b Compare March 20, 2026 12:51
@tkarna tkarna marked this pull request as ready for review March 20, 2026 12:56
@tkarna
Copy link
Copy Markdown
Contributor Author

tkarna commented Mar 20, 2026

Thanks to #63 we can now trace the schedule module to construct the search space, enumerate it, and also automatically check the validity of a given set of parameters (what check_constraints does in the present implementation). This PR does not use this functionality yet, it will be addressed in a forthcoming PR.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds two autotuning entrypoints for the XeGPU matmul example (exhaustive grid search + genetic algorithm), along with shared utilities and documentation updates to support running/recording tuning experiments.

Changes:

  • Add tune_matmul_gridsearch.py for exhaustive parameter search and CSV logging.
  • Add tune_matmul_ga.py + genetic_algorithm.py for GA-based adaptive sampling.
  • Refactor matmul.py CLI parsing to share args with tuners and add JSON parameter loading; update README and lit excludes.

Reviewed changes

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

Show a summary per file
File Description
examples/xegpu/tune_matmul_gridsearch.py Implements exhaustive search, constraints filtering, timed execution, CSV logging, and JSON dumping.
examples/xegpu/tune_matmul_ga.py Implements GA-driven tuning using the shared search-space + logging utilities.
examples/xegpu/matmul.py Extracts shared CLI parser and adds --json parameter loading path.
examples/xegpu/lit.local.cfg Excludes non-test helper/tuner scripts from lit discovery.
examples/xegpu/genetic_algorithm.py New GA + population/search-space utility implementation.
examples/xegpu/csv_logger.py New small CSV logger utility used by both tuners.
examples/xegpu/README.md Documents new tuning workflows and updates matmul CLI usage examples.

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

Copy link
Copy Markdown
Contributor

@rolfmorel rolfmorel left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@fschlimb fschlimb left a comment

Choose a reason for hiding this comment

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

Nice!

@tkarna tkarna merged commit 386b407 into llvm:main Mar 24, 2026
3 checks passed
@tkarna tkarna deleted the xegpu-autotune branch March 24, 2026 11:32
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.

4 participants