NVIDIA / NVIDIA/cutile-python

[FEA]: Generalize autotuning to dynamically generated kernels

Open
#91 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request status: triaged
Dominant language
Python
Stars
2.2k
Forks
155
PR merge metrics
No merged PRs in 30d

Description

Is this a new feature, an improvement, or a change to existing functionality?

Improvement

How would you describe the priority of this feature request?

Low (would be nice)

Please provide a clear description of problem this feature solves

Currently, exhaustive_search takes a single fixed kernel and construct arguments from an arbitrary sequence of configurations. That it takes a fixed kernel makes it unusable in its current form if the config objects themselves generates the kernel.

Feature Description

I'm currently using cutile and metaprogramming to generate kernels, with much better success and less pain than other frameworks. However, I can't use exhaustive_search in its current form, but need to modify it to take kernel generating functions.

Describe your ideal solution

The proposal is essentially to change exhaustive_search, or add a separate case, where we generate the kernel candidate from a config, i.e:

    ... 
    for i, cfg in enumerate(search_space):
        if not quiet and isatty:
            progress(0, i, total, len(errors))
        grid = grid_fn(cfg)
        kernel = kernel_fn(cfg)
        hints = hints_fn(cfg) if hints_fn is not None else {}
        updated_kernel = kernel.replace_hints(**hints)
        candidate = _TimingCandidate(
            config=cfg,
            grid=grid,
            kernel=updated_kernel,
            get_args=lambda _cfg=cfg: args_fn(_cfg),
        )
     ...
Describe any alternatives you have considered

No response

Additional context

No response

Contributing Guidelines
  • I agree to follow cuTile Python's contributing guidelines
  • I have searched the open feature requests and have found no duplicates for this feature request

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the exhaustive_search entry point and _TimingCandidate usage described in the issue, then trace how configurations currently produce kernels, grids, hints, and arguments. The work is complete when exhaustive_search can support kernels and arguments generated from each configuration while preserving existing fixed-kernel behavior and autotuning candidates.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.