Skip to content

Increasing block size dimensions to avoid configs which are slow and poor candidates.#1677

Merged
umechand-amd merged 8 commits intopytorch:mainfrom
umechand-amd:umechand/raise-grid-block-minimums
Mar 25, 2026
Merged

Increasing block size dimensions to avoid configs which are slow and poor candidates.#1677
umechand-amd merged 8 commits intopytorch:mainfrom
umechand-amd:umechand/raise-grid-block-minimums

Conversation

@umechand-amd
Copy link
Copy Markdown
Collaborator

This PR puts a floor on the block sizes by capping the maximum number of blocks in each dimension in a grid, this ensures that we do not test degenerate cases like block size = 1. This will let the autotuning be limited to only the subspace of configs which have block sizes known to give descent performance and not have huge runtime delays.
The thought process is that the known subset of configs (very small block size) which have significantly higher runtime will never be selected by the autotuning bench-marker so exploring those is a waste of autotuning time and compute.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 13, 2026
@umechand-amd umechand-amd marked this pull request as ready for review March 13, 2026 23:17
Comment thread helion/autotuner/config_spec.py Outdated
Comment on lines +526 to +527
if not is_hip() or not self.grid_block_ids:
return
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.

Similar to the other PR, I wonder if it would make sense to do this in a vendor-agnostic way?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I only tested it on AMD devices. I can make it vendor agnostic and see if the CI passes for all devices

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@jansel, I don't have access to Nvidia devices, I did make the changes generic but since the PRs change the autotuning space, there are tests which are failing because they still expect the old configs. Can you review the changes and if it looks good, is there a way to update the. expected file on the CI machines and commit?

@umechand-amd umechand-amd force-pushed the umechand/raise-grid-block-minimums branch from 2d3a9c1 to 4e4b77d Compare March 15, 2026 05:57
@umechand-amd
Copy link
Copy Markdown
Collaborator Author

umechand-amd commented Mar 17, 2026

@jansel, Can you approve the workflows?

@jansel
Copy link
Copy Markdown
Contributor

jansel commented Mar 20, 2026

@umechand-amd yes I approved CI sorry for the delay. Re-request review when you want me to look again.

@umechand-amd umechand-amd force-pushed the umechand/raise-grid-block-minimums branch 4 times, most recently from 33f8a41 to 6dfa634 Compare March 24, 2026 07:27
Comment thread helion/autotuner/config_spec.py Outdated
"""
if not self.grid_block_ids:
return
import math
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.

imports top of file

@jansel
Copy link
Copy Markdown
Contributor

jansel commented Mar 24, 2026

Failing tests and merge conflicts?

@umechand-amd
Copy link
Copy Markdown
Collaborator Author

Failing tests and merge conflicts?

The failing tests need a fix to the expected files, I dont have access to the cuda devices to check the new config and fix the expected files.

@umechand-amd umechand-amd force-pushed the umechand/raise-grid-block-minimums branch from 6dfa634 to 3397e6d Compare March 24, 2026 21:20
@umechand-amd umechand-amd force-pushed the umechand/raise-grid-block-minimums branch from 3397e6d to e6fe78a Compare March 25, 2026 18:21
@umechand-amd umechand-amd merged commit 149dec2 into pytorch:main Mar 25, 2026
29 of 31 checks passed
Comment thread helion/autotuner/config_spec.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants