Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autotune for matmul #52

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

junjihashimoto
Copy link
Collaborator

This PR implements autotune for matmul.
To skip unacceptable parameters with runtime-exception, it also implements additional exception-hander to catch exceptions on main-thread.

@austinvhuang
Copy link
Contributor

Pretty excited to incorporate some autotuning functionality in the library.

On the exception handler, I need to have a closer look. What are the condition where the exception gets thrown? Some additional discussion on errors here #49 (comment) - can chat more in the discord chat.

I was thinking about a more generic mechanism for autotuning. There could be some higher order function that takes:

  1. A list of parameter sets to sweep through (a consumer of this could setup the product set of their parameters). Note the parameter set would be a value-level map (parameter name -> parameter -> value).
  2. a function that takes one specific parameter set, a number N of replications per parameter set.

The autotuner then sweeps through each parameter set and runs it N times. It then returns, for each parameter set, the N values of running times. Something like hyperfine https://github.com/sharkdp/hyperfine except operating on a parameter set and a function as input.

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.

2 participants