Skip to content

Commit 4b7fc65

Browse files
committed
updating structure of changelog
1 parent a4d62c1 commit 4b7fc65

2 files changed

Lines changed: 13 additions & 20 deletions

File tree

perf-changelog.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
changelog:
21
- config-keys:
32
- dsr1-fp8-h200-trt
43
description: Test change abc

utils/process_changelog.py

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import argparse
44

55
from pydantic import BaseModel, ConfigDict, Field
6+
67
from matrix_logic.validation import load_config_files, load_runner_file
78

89
MASTER_CONFIGS = [".github/configs/amd-master.yaml",
@@ -12,15 +13,11 @@
1213
class ChangelogEntry(BaseModel):
1314
model_config = ConfigDict(extra='forbid', populate_by_name=True)
1415

15-
config_key: str = Field(alias='config-key')
16+
config_keys: list[str] = Field(alias='config-keys')
1617
description: str
1718
seq_lens: list[str] = Field(alias='seq-lens')
1819

1920

20-
class Config(BaseModel):
21-
changelog: list[ChangelogEntry]
22-
23-
2421
def main():
2522
parser = argparse.ArgumentParser()
2623
parser.add_argument(
@@ -34,22 +31,19 @@ def main():
3431

3532
master_config_data = load_config_files(MASTER_CONFIGS)
3633

37-
changelog_path = args.changelog_file
38-
with open(changelog_path, 'r') as f:
34+
with open(args.changelog_file, 'r') as f:
3935
changelog_data = yaml.safe_load(f)
36+
37+
for entry_data in changelog_data:
38+
entry = ChangelogEntry.model_validate(entry_data)
4039

41-
changelog_data = Config.model_validate(changelog_data)
42-
43-
# Validate all config-keys actually exist in the master config files
44-
for entry in changelog_data.changelog:
45-
if entry.config_key not in master_config_data.keys():
46-
raise ValueError(
47-
f"Changelog entry with config-key '{entry.config_key}' does not exist in master config files."
48-
)
49-
50-
51-
40+
# Make sure the specfied config keys actually exist in the master config files
41+
for config_key in entry.config_keys:
42+
if config_key not in master_config_data.keys():
43+
raise ValueError(
44+
f"Config key '{config_key}' does not exist in master config files."
45+
)
5246

5347

5448
if __name__ == "__main__":
55-
main()
49+
main()

0 commit comments

Comments
 (0)