Skip to content

Remove FROM_DEFAULT, unify initial population on FROM_BEST_AVAILABLE with pad control#1809

Merged
fulvius31 merged 1 commit into
pytorch:mainfrom
fulvius31:from-best-pop
Mar 30, 2026
Merged

Remove FROM_DEFAULT, unify initial population on FROM_BEST_AVAILABLE with pad control#1809
fulvius31 merged 1 commit into
pytorch:mainfrom
fulvius31:from-best-pop

Conversation

@fulvius31
Copy link
Copy Markdown
Collaborator

Summary

  • Remove FROM_DEFAULT initial population strategy since it's a strict subset of FROM_BEST_AVAILABLE with no cache
  • Quick effort now uses from_best_available with best_available_pad_random=False: reuses cached configs when available, degrades to just the default on cold cache
  • Full effort honors population budget when overridden to from_best_available: pads with random configs to fill initial_population
  • HELION_SKIP_CACHE now consistently skips all cache reads, including the config history scan in _find_similar_cached_configs
  • Fixes DE using random_population_flat() which injected a duplicate default config

Benchmark results

Benchmarks on RTX 5090 (torch 2.10.0+cu130, triton 3.6.0) show that FROM_BEST_AVAILABLE with a good cache matches Full Random kernel quality at 13x less tuning cost for MatMul (92s vs 1238s, 7 implementations). The removed FROM_DEFAULT was 19x faster but produced 14-31% slower kernels. For Softmax, results are workload-dependent -- cache-seeding helps when the default config is far from optimal but adds overhead when it's already near-optimal.

Full benchmark details and the original FROM_BEST_AVAILABLE introduction are in #1365.

Test

Adjusted test_best_available accordingly

@fulvius31 fulvius31 requested review from jansel and v0i0 March 24, 2026 21:15
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 24, 2026
log: logging.Logger = logging.getLogger(__name__)


def should_skip_cache() -> bool:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it not possible to access this information from self.settings like other configurations?

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.

@hinriksnaer Thanks for the comment!

I'm following the same behavior as before

if skip_cache or os.environ.get("HELION_SKIP_CACHE", "") not in {
, I just extracted a function out of it in order to be used in base_search . self._skip_cache is also used tho

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Might be cleaner to use the runtime settings if possible but I am not sure if there is anything stopping us from doing that.

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.

yes, HELION_SKIP_CACHE isn't wired through settings unlike the other env vars, maybe because it's only for debug? probably the one that the users need is HELION_FORCE_AUTOTUNE that is in settings already ? The two env vars partially overlap.

I'm not sure if we should add the env var to settings, let's wait for the maintainers to have a look!

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 just opened #1815 related to this topic

…LE with no random padding

- Remove FROM_DEFAULT enum value and all its branches
- Add best_available_pad_random flag: True (full) pads to budget with random configs, False (quick) uses only default + cached
- Quick effort profile now uses from_best_available + pad_random=False, degrading to just the default when no cache exists
- Extract should_skip_cache() helper; make _find_similar_cached_configs respect HELION_SKIP_CACHE and skip_cache param
- Fix DE to use random_flat() instead of random_population_flat() to avoid duplicate default
@jansel
Copy link
Copy Markdown
Contributor

jansel commented Mar 28, 2026

@claude

@fulvius31
Copy link
Copy Markdown
Collaborator Author

@claude

@jansel did you get any review from @claude ?

@jansel
Copy link
Copy Markdown
Contributor

jansel commented Mar 30, 2026

Doesn't look like it is working in this repo yet.

@fulvius31 fulvius31 merged commit 513c650 into pytorch:main Mar 30, 2026
18 checks passed
@fulvius31 fulvius31 deleted the from-best-pop branch March 30, 2026 20:23
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