CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
97 lines
2.9 KiB
Python
97 lines
2.9 KiB
Python
# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
import glob
|
|
import os
|
|
import sys
|
|
|
|
import yaml
|
|
|
|
|
|
NON_UNIT_GROUPS = [
|
|
"ABM",
|
|
"multiproc",
|
|
"performance",
|
|
"stress",
|
|
"TypeQualifiers",
|
|
]
|
|
|
|
_use_color = sys.stderr.isatty() and not os.environ.get("NO_COLOR")
|
|
WARNING = "\033[0;33m" if _use_color else ""
|
|
ERROR = "\033[0;31m" if _use_color else ""
|
|
RESET = "\033[0m" if _use_color else ""
|
|
|
|
|
|
def parse_size_string(size_str):
|
|
"""Convert size string (1K, 1M, 1G) to bytes.
|
|
|
|
Args:
|
|
size_str: Size as string ("1K", "1M", "1G") or int
|
|
|
|
Returns:
|
|
Size in bytes as integer
|
|
"""
|
|
# Handle integers directly (YAML may parse numbers as int)
|
|
if isinstance(size_str, int):
|
|
return size_str
|
|
|
|
size_str = str(size_str).strip().upper()
|
|
multipliers = {'K': 1024, 'M': 1024*1024, 'G': 1024*1024*1024}
|
|
|
|
for suffix, multiplier in multipliers.items():
|
|
if size_str.endswith(suffix):
|
|
return int(float(size_str[:-1]) * multiplier)
|
|
return int(size_str)
|
|
|
|
|
|
def load_definitions(config_path):
|
|
"""Load definitions.yaml and return the full config including cmd_options.
|
|
|
|
Args:
|
|
config_path: Path to the config directory (containing configs/)
|
|
|
|
Returns:
|
|
Dict with 'definitions' and 'cmd_options' keys
|
|
"""
|
|
definitions_path = os.path.join(config_path, "definitions.yaml")
|
|
with open(definitions_path) as file:
|
|
return yaml.safe_load(file)
|
|
|
|
|
|
def load_config(file_path, definitions_text):
|
|
with open(file_path) as file:
|
|
content = file.read()
|
|
# Strip leading document separator so we can prepend definitions
|
|
content = content.lstrip("-").lstrip("\n").lstrip()
|
|
combined = definitions_text + "\n" + content
|
|
return yaml.safe_load(combined)
|
|
|
|
|
|
def iter_group_configs(configs_path):
|
|
"""Yield (group, cases) pairs for all unit and non-unit config files.
|
|
|
|
Iterates unit configs first (sorted alphabetically), then non-unit groups
|
|
in the order defined by NON_UNIT_GROUPS. Empty case entries (YAML keys
|
|
with no value) are yielded as empty dicts rather than ``None``.
|
|
"""
|
|
definitions_path = os.path.join(configs_path, "definitions.yaml")
|
|
with open(definitions_path) as file:
|
|
definitions_text = file.read()
|
|
|
|
def _normalize(cases):
|
|
return {name: (cfg or {}) for name, cfg in (cases or {}).items()}
|
|
|
|
unit_config_dir = os.path.join(configs_path, "unit")
|
|
for config_file in sorted(glob.glob(os.path.join(unit_config_dir, "*.yaml"))):
|
|
config = load_config(config_file, definitions_text)
|
|
group = os.path.splitext(os.path.basename(config_file))[0]
|
|
if group not in config:
|
|
continue
|
|
yield group, _normalize(config[group])
|
|
|
|
for group in NON_UNIT_GROUPS:
|
|
config_file = os.path.join(configs_path, f"{group}.yaml")
|
|
config = load_config(config_file, definitions_text)
|
|
yield group, _normalize(config[group])
|