Skip to content

autotune: keep CI search opt-in (#770)#788

Merged
coderfeli merged 1 commit into
ROCm:mainfrom
jhinpan:feat/autotune-ci-guard
Jul 23, 2026
Merged

autotune: keep CI search opt-in (#770)#788
coderfeli merged 1 commit into
ROCm:mainfrom
jhinpan:feat/autotune-ci-guard

Conversation

@jhinpan

@jhinpan jhinpan commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Keep broad FlyDSL test runs deterministic:

  • scripts/run_tests.sh explicitly sets FLYDSL_AUTOTUNE=0 before pytest and standalone examples.
  • The GPU-free default/cache-path test exercises that explicit off value and fails if benchmarking is reached.
  • Dedicated autotune tests remain responsible for setting FLYDSL_AUTOTUNE=1 around the forced-search cases they own.

The shared runner is used by both the source and wheel CI workflows, so this is one guard rather than duplicated workflow configuration.

Why this is the right CI boundary

Autotune search is timing-sensitive and expensive. Shared CI should verify deterministic control-flow and correctness contracts, not select or commit a performance winner from noisy runner timing.

The current offline-artifact work in #786 already owns artifact identity, validation, fallback, and emit/load tests. Its artifacts are content-addressed deployment inputs generated on the intended GPU; FlyDSL currently has no committed artifact tree. The previous configs/autotune/ registry and standalone committed-config validator were therefore both stale and unnecessary.

This PR adds no job, runner, config registry, or autotuner API.

Verification

  • python3 -m pytest tests/unit/test_autotune.py -q — 23 passed
  • bash scripts/check_python_style.sh --base upstream/main --include-local
  • bash -n scripts/run_tests.sh
  • git diff --check

Rebased onto current main; the final diff is one commit touching two files.

Refs #770. Complements #786.

Copilot AI review requested due to automatic review settings July 1, 2026 08:04

Copilot AI left a comment

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.

Pull request overview

Adds CI-safe guardrails around FlyDSL’s autotune “offline config” workflow: committed configs are validated in GPU-free unit tests, CI is explicitly documented to avoid running autotune search, and RMSNorm gains an end-to-end autotune integration test path.

Changes:

  • Add a GPU-free regression test that validates every committed configs/autotune/*.json is well-formed and filename/content-consistent.
  • Seed configs/autotune/ with an initial RMSNorm tuned config + add documentation for generating/committing configs.
  • Extend autotune + RMSNorm plumbing/tests to support offline emit/lookup and CI-safe behavior (no search unless explicitly enabled).

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/unit/test_autotune.py GPU-free unit tests covering autotune keying, restore/reset semantics, builder mode, and offline emit/lookup behavior.
tests/unit/test_autotune_configs.py New regression guard ensuring committed offline configs under configs/autotune/ are parseable, loadable, and filename-consistent.
tests/kernels/test_rmsnorm_autotune.py GPU integration tests validating RMSNorm default path, forced-search path, cache reuse, and offline emit/lookup behavior.
python/flydsl/autotune.py Adds CI-safe tuning gating, hardened cache key axes, builder-mode support, restore/reset semantics, and offline config emit/lookup.
kernels/rmsnorm_kernel.py Makes RMSNorm’s build-time BLOCK_THREADS knob explicit and wires known_block_size for >256 threads.
kernels/rmsnorm_config.py Introduces RMSNorm default heuristic + exhaustive config space definition for tuning.
kernels/rmsnorm_autotune.py Adds the autotuned RMSNorm entrypoint using builder-mode autotuning + offline key extraction.
docs/autotune_guide.md New guide documenting default/search/offline modes and CI guidance (“do not tune in CI”).
configs/autotune/rmsnorm,N=8192,dtype=bf16,device_name=AMD_Instinct_MI350X.json Seed committed offline tuned config for RMSNorm.
configs/autotune/README.md Documents the committed-config directory purpose and generation workflow.
.github/workflows/flydsl.yaml Documents that CI must not set FLYDSL_AUTOTUNE and relies on default/offline-lookup paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread python/flydsl/autotune.py Outdated
Comment thread python/flydsl/autotune.py Outdated
Comment thread python/flydsl/autotune.py Outdated
Comment thread configs/autotune/README.md Outdated
@jhinpan
jhinpan force-pushed the feat/autotune-ci-guard branch 10 times, most recently from b5c2305 to 92406ee Compare July 2, 2026 19:28
@jhinpan
jhinpan force-pushed the feat/autotune-ci-guard branch from 92406ee to 61b56ce Compare July 21, 2026 23:55
@jhinpan
jhinpan force-pushed the feat/autotune-ci-guard branch from 61b56ce to 302bc84 Compare July 21, 2026 23:56
@jhinpan jhinpan changed the title [4/5] autotune: CI guard + committed-config regression check (#770) autotune: keep CI search opt-in (#770) Jul 21, 2026
@coderfeli
coderfeli merged commit 1afc0b0 into ROCm:main Jul 23, 2026
10 checks passed
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.

3 participants