Skip to content

finegrained-kernels: fix tuner selection and expose phase controls - #1237

Open
IlyasMoutawwakil wants to merge 15 commits into
mainfrom
finegrained-single-trial
Open

IlyasMoutawwakil wants to merge 15 commits into
mainfrom
finegrained-single-trial

Conversation

@IlyasMoutawwakil

@IlyasMoutawwakil IlyasMoutawwakil commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Expose controls for basin probes, refinement iterations, and winner remeasurement through decorator arguments and FINEGRAINED_AUTOTUNE_BASIN_PROBES, FINEGRAINED_AUTOTUNE_MAX_REFINE_ITERS, and FINEGRAINED_AUTOTUNE_RUNOFF. Probes and runoff default to enabled; refinement defaults to five iterations, with zero disabling it. Correctness runs can set the trial budget to one and all three controls to zero. Version 1 accounts for replacing the old refine argument with the iteration limit.

Fix basin anchors that could select extreme K, warp, and stage settings through a lexicographic median. Choose interior candidates across numeric axes and retain a wide output-tile anchor per declared compute path. Cache identity includes the kernel and tuner source hashes plus the effective phase settings.

Choose the runoff winner only from its remeasured finalists. Previously an unremeasured fourth candidate could win using a stale search-time sample. The existing timer remains unchanged.

Validation: ten focused autotuner checks passed, including anchor selection, runoff selection, failed-candidate handling and compile-failure memoization. The runoff regression reproduces the stale winner before the fix. The public API version check, Ruff and diff checks passed.

Supersedes #1243.

Related issue

Requested by a maintainer for huggingface/transformers#49658.

Checklist

  • Linked to a discussed issue
  • Tested locally
  • Mostly or completely generated with an LLM

Limit budget-one searches to one successful measurement, retry failed configurations, and skip refinement and winner runoff. Keep larger budgets unchanged and verify measurement counts through the public loader without GPU kernels.
@github-actions github-actions Bot added the chore Version bumps, releases, misc maintenance label Oct 16, 2026
@github-actions

Copy link
Copy Markdown

This PR changes source code for the following kernel(s): finegrained-kernels.

If you have the kernel-bot build permissions, then trigger /kernel-bot build finegrained-kernels yourself. Otherwise, a maintainer will review the PR and will take an appropriate action. Thanks for your patience.

@IlyasMoutawwakil IlyasMoutawwakil changed the title finegrained-kernels: honor single-trial autotuning for correctness tests finegrained-kernels: expose autotuning search phase controls Oct 16, 2026
@IlyasMoutawwakil IlyasMoutawwakil changed the title finegrained-kernels: expose autotuning search phase controls finegrained-kernels: fix basin anchors and expose tuning phase controls Oct 17, 2026
Comment on lines +59 to +60
# Include the tuner implementation alongside Triton's kernel-source hash.
_TUNER_SOURCE_HASH = hashlib.sha256(Path(__file__).read_bytes()).hexdigest()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

to dismiss cached tunes that used an old version

@IlyasMoutawwakil IlyasMoutawwakil changed the title finegrained-kernels: fix basin anchors and expose tuning phase controls finegrained-kernels: fix tuner selection and expose phase controls Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Version bumps, releases, misc maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant