mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-14 02:02:46 +00:00
Update pre-commit to fixed versions, run remod for ck_tile (#2895)
* Fix ruff linter errors
* Fix remod dos2unix command
* Clang format
* Ignore utility in remod
* Run remod
* Specify clang-format version in pre-commit
* Specify ruff version
* Include PoolKernelArgs in reference_pool
* Add calculate_total_elements to reference batched contraction
* Fix calculate_total_elements declaration
* Refactor remod pre-commit hook
* Fix Aquant tests
---------
Co-authored-by: Illia Silin <98187287+illsilin@users.noreply.github.com>
[ROCm/composable_kernel commit: d40b50b9d5]
This commit is contained in:
@@ -14,43 +14,69 @@ Features:
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
def run_dependency_parser(args):
|
||||
from src.enhanced_ninja_parser import main as ninja_main
|
||||
|
||||
sys.argv = ["enhanced_ninja_parser.py"] + args
|
||||
ninja_main()
|
||||
|
||||
|
||||
def run_selective_test_filter(args):
|
||||
from src.selective_test_filter import main as filter_main
|
||||
|
||||
sys.argv = ["selective_test_filter.py"] + args
|
||||
filter_main()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Unified Ninja Dependency & Selective Testing Tool")
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Unified Ninja Dependency & Selective Testing Tool"
|
||||
)
|
||||
subparsers = parser.add_subparsers(dest="command", required=True)
|
||||
|
||||
# Dependency parsing
|
||||
parser_parse = subparsers.add_parser("parse", help="Parse build.ninja and generate dependency mapping")
|
||||
parser_parse = subparsers.add_parser(
|
||||
"parse", help="Parse build.ninja and generate dependency mapping"
|
||||
)
|
||||
parser_parse.add_argument("build_ninja", help="Path to build.ninja")
|
||||
parser_parse.add_argument("--ninja", help="Path to ninja executable", default="ninja")
|
||||
parser_parse.add_argument("--workspace-root", help="Path to workspace root", default=None)
|
||||
parser_parse.add_argument(
|
||||
"--ninja", help="Path to ninja executable", default="ninja"
|
||||
)
|
||||
parser_parse.add_argument(
|
||||
"--workspace-root", help="Path to workspace root", default=None
|
||||
)
|
||||
|
||||
# Selective testing
|
||||
parser_test = subparsers.add_parser("select", help="Selective test filtering between git refs")
|
||||
parser_test = subparsers.add_parser(
|
||||
"select", help="Selective test filtering between git refs"
|
||||
)
|
||||
parser_test.add_argument("depmap_json", help="Path to dependency mapping JSON")
|
||||
parser_test.add_argument("ref1", help="Source git ref")
|
||||
parser_test.add_argument("ref2", help="Target git ref")
|
||||
parser_test.add_argument("--all", action="store_true", help="Include all executables")
|
||||
parser_test.add_argument("--test-prefix", action="store_true", help="Only include executables starting with 'test_'")
|
||||
parser_test.add_argument("--output", help="Output JSON file", default="tests_to_run.json")
|
||||
parser_test.add_argument(
|
||||
"--all", action="store_true", help="Include all executables"
|
||||
)
|
||||
parser_test.add_argument(
|
||||
"--test-prefix",
|
||||
action="store_true",
|
||||
help="Only include executables starting with 'test_'",
|
||||
)
|
||||
parser_test.add_argument(
|
||||
"--output", help="Output JSON file", default="tests_to_run.json"
|
||||
)
|
||||
|
||||
# Code auditing
|
||||
parser_audit = subparsers.add_parser("audit", help="List all files and their dependent executables")
|
||||
parser_audit = subparsers.add_parser(
|
||||
"audit", help="List all files and their dependent executables"
|
||||
)
|
||||
parser_audit.add_argument("depmap_json", help="Path to dependency mapping JSON")
|
||||
|
||||
# Build optimization
|
||||
parser_opt = subparsers.add_parser("optimize", help="List affected executables for changed files")
|
||||
parser_opt = subparsers.add_parser(
|
||||
"optimize", help="List affected executables for changed files"
|
||||
)
|
||||
parser_opt.add_argument("depmap_json", help="Path to dependency mapping JSON")
|
||||
parser_opt.add_argument("changed_files", nargs="+", help="List of changed files")
|
||||
|
||||
@@ -73,9 +99,12 @@ def main():
|
||||
elif args.command == "audit":
|
||||
run_selective_test_filter([args.depmap_json, "--audit"])
|
||||
elif args.command == "optimize":
|
||||
run_selective_test_filter([args.depmap_json, "--optimize-build"] + args.changed_files)
|
||||
run_selective_test_filter(
|
||||
[args.depmap_json, "--optimize-build"] + args.changed_files
|
||||
)
|
||||
else:
|
||||
parser.print_help()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user