Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the tuning test suite to align with current config-merge behavior, reduce e2e tuning pipeline flakiness, and clarify how to run individual tuner tests.
Changes:
- Update
update_config_filesunit test to expect CSVs with differing columns to merge (with missing columns filled) instead of raising. - Add a pre/post tuner-run cleanup helper for stale JIT lock files and simplify the
--compare --update_improvede2e test invocation/shape set. - Expand tuning test README with guidance for running specific tuner tests (mp=1 vs mp=default).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
op_tests/tuning_tests/test_tuner_infra.py |
Updates config-merge unit test expectations for mismatched CSV columns. |
op_tests/tuning_tests/test_tune_pipeline.py |
Adds lock-file cleanup, consolidates compare pipeline test, adjusts args/timeouts/shapes. |
op_tests/tuning_tests/README.md |
Documents running individual tuner tests and clarifies pipeline coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+56
to
+72
| def _cleanup_stale_lock_files(): | ||
| """Remove stale FileBaton lock files left by killed subprocesses.""" | ||
| build_dir = os.path.join(AITER_ROOT, "aiter", "jit", "build") | ||
| if not os.path.isdir(build_dir): | ||
| return | ||
| lock_patterns = [ | ||
| os.path.join(build_dir, "lock_*"), | ||
| os.path.join(build_dir, "*", "build", "lock"), | ||
| os.path.join(build_dir, "lock_3rdparty_*"), | ||
| ] | ||
| for pattern in lock_patterns: | ||
| for lock_file in glob.glob(pattern): | ||
| try: | ||
| os.remove(lock_file) | ||
| print(f"Cleaned up stale lock file: {lock_file}", flush=True) | ||
| except OSError: | ||
| pass |
Comment on lines
+58
to
+65
| build_dir = os.path.join(AITER_ROOT, "aiter", "jit", "build") | ||
| if not os.path.isdir(build_dir): | ||
| return | ||
| lock_patterns = [ | ||
| os.path.join(build_dir, "lock_*"), | ||
| os.path.join(build_dir, "*", "build", "lock"), | ||
| os.path.join(build_dir, "lock_3rdparty_*"), | ||
| ] |
| "shapes": [(1, 1024, 512), (16, 1536, 7168)], | ||
| "shapes": [(1, 1024, 512)], | ||
| "keys": ["cu_num", "M", "N", "K"], | ||
| "timeout": 3600, |
Comment on lines
+549
to
+573
| def test_compare_and_update(self): | ||
| """--compare --update_improved: tune, compare, update tuned CSV.""" | ||
| cfg = self.CONFIGS["a8w8_blockscale"] | ||
| timeout = cfg.get("timeout", 900) | ||
| tmp = tempfile.mkdtemp() | ||
| untuned = os.path.join(tmp, "untuned.csv") | ||
| tuned = os.path.join(tmp, "tuned.csv") | ||
| _write_csv(untuned, cfg["header"], cfg["shapes"]) | ||
|
|
||
| extra = ["--compare"] | ||
| if update_improved: | ||
| extra.append("--update_improved") | ||
| result = _run_tuner( | ||
| cfg["script"], untuned, tuned, extra_args=extra, timeout=900 | ||
| ) | ||
| return result, tuned, tmp | ||
|
|
||
| def test_compare_only(self): | ||
| """--compare runs pre/post benchmark and prints comparison.""" | ||
| result, tuned, tmp = self._run_compare("a8w8_blockscale", update_improved=False) | ||
| try: | ||
| untuned = os.path.join(tmp, "untuned.csv") | ||
| tuned = os.path.join(tmp, "tuned.csv") | ||
| _write_csv(untuned, cfg["header"], cfg["shapes"]) | ||
|
|
||
| result = _run_tuner( | ||
| cfg["script"], | ||
| untuned, | ||
| tuned, | ||
| extra_args=[ | ||
| "--compare", | ||
| "--update_improved", | ||
| "--libtype", | ||
| "ck", | ||
| "--batch", | ||
| "1", | ||
| ], | ||
| timeout=timeout, | ||
| mp=1, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist