[CI] Parity: discover job topology from workflow YAML - #3535
Conversation
Read CUDA and ROCm shard totals from workflow YAML at the tested commit, self-heal renamed job prefixes, and follow reusable-workflow artifacts to their hosting run.
| if job_key in seen: | ||
| return None | ||
| seen.add(job_key) | ||
| job = jobs.get(job_key, {}) |
There was a problem hiding this comment.
Can we confirm that the job_key will have the value linux-jammy-rocm-py3_10-build and not linux-jammy-rocm-py3.10-mi350 in trunk.yml?
There was a problem hiding this comment.
Confirmed. _matrix_for_job_prefix matches either the displayed name or YAML key, but it deliberately carries (key, job) and passes key into _literal_test_matrix. For trunk, that means job_key is the YAML identifier such as linux-jammy-rocm-py3_10-build, while linux-jammy-rocm-py3.10-mi350 is only used to select that job by its displayed name. I exercised the updated helper against trunk.yml at upstream SHA cf18dda7; it followed the build job output and resolved a non-empty default matrix. I also added workflow-run and architecture scoping in 71e3f00 so same-SHA workflows cannot contribute an unrelated prefix.
Keep topology discovery aligned with the scheduled rocm-preview lane and remove the retired nightly key.
Prevent same-SHA jobs from another ROCm workflow from self-healing to the wrong prefix by traversing nested reusable runs and filtering candidates by architecture.
Summary
num_shardsvalues from the authoritative test matrixWhy
parity_job_config.jsonremainsThe workflow YAML is now authoritative for shard counts, but the JSON still supplies information that cannot yet be discovered from one resolved workflow file: the ordered workflow candidates and architecture-specific fallbacks, seed job prefixes used to locate the right family before self-healing, CUDA test-job kinds, and check-run/workflow regexes used by
parity-auto.ymlbefore dispatch. Removing the file now would require moving those hardcoded values elsewhere or separately redesigning workflow discovery and gating; it would not actually remove the configuration. A follow-up can remove the JSON once those remaining consumers derive their topology dynamically.Test plan
Preview topology update
This branch now uses
previewonly and validates topology discovery against the scheduledrocm-previewmi3508/3/2 lane. #3406 owns the canonical Preview config; reconcile the duplicate config lines when rebasing after #3406 lands. This PR remains the prerequisite for #3536 and #3397.Prefix safety update
Ported the fork #6 safety fix in
71e3f00d61f: check-runs are scoped to the selected workflow and nested reusable runs, candidates are ROCm-only and architecture-filtered, and Preview uses a distinctrocm-previewtoken.Validation covers Python compilation, live trunk/Preview YAML matrix resolution at upstream SHA
cf18dda7, scoped check-run selection, and rejection of a same-SHA MI350 candidate when resolving Preview.Alignment landing order
Depends on #3554. Land before #3536 and before downloader resilience/automation PRs. Prefix safety includes nested reusable-run scoping and architecture filtering; validated against live trunk and Preview workflow YAML at
cf18dda7.