Repository navigation
feat: enable asan build in quartz #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
b012ca9
e9baa7e
30e8226
6930ff8
a85b769
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -52,6 +52,7 @@ directly to keys in the document: | |||||
| | **architecture** | A GPU target, for example `gfx942` or `gfx1201` (the same identifiers ROCm uses). | | ||||||
| | **pipeline** | One product built from a release: `rocm` (the ROCm stack itself), `pytorch`, `jax`, and `native_packages`. A release can produce several. | | ||||||
| | **phase** | A stage of a pipeline: `build` and `test`. For `native_packages`, `rpm` or `deb` instead. | | ||||||
| | **build variant** | The release flavor, `release` or `asan-debug`. It selects the document: `status.json` for `release`, `status-<build_variant>.json` otherwise. | | ||||||
| | **variant** | For PyTorch/JAX, one cell of the version matrix (for example Python 3.12 with a given Torch branch). Relevant only to consumers of PyTorch/JAX detail. | | ||||||
|
|
||||||
| Not every pipeline runs on every platform, and `native_packages` is a special | ||||||
|
|
@@ -70,36 +71,46 @@ below. | |||||
|
|
||||||
| ## Endpoints | ||||||
|
|
||||||
| Quartz publishes one `status.json` per release build (nightly/nightly-bkc/prerelease), plus stable pointers to the | ||||||
| most recent builds. | ||||||
|
|
||||||
| | Endpoint | Points to | | ||||||
| | ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | | ||||||
| | `nightly/<date>/status.json` | A specific nightly, for example `nightly/20260707/status.json` | | ||||||
| | `nightly/latest.json` | The most recent nightly (any result, including still in progress) | | ||||||
| | `nightly/latest_good.json` | The most recent fully-passing nightly | | ||||||
| | `nightly-bkc/<nightly-version>/<bkc-date>/status.json` | A specific bkc nightly, for example `nightly-bkc/10.1.0a20260825/20260831/status.json` | | ||||||
| | `nightly-bkc/<nightly-version>/latest.json` | The most recent bkc nightly for that nightly version (any result, including still in progress) | | ||||||
| | `nightly-bkc/<nightly-version>/latest_good.json` | The most recent fully-passing bkc nightly for that nightly version | | ||||||
| | `nightly-bkc/latest.json` | The most recent build of the highest bkc nightly version (by version number, not build date) | | ||||||
| | `nightly-bkc/latest_good.json` | The highest-versioned fully-passing bkc build (may trail `latest.json` when the highest nightly version is not green) | | ||||||
| | `prerelease/<major.minor>/<full>/status.json` | A specific prerelease, for example `prerelease/7.14/7.14.0rc1/status.json` | | ||||||
| | `prerelease/latest.json` | The highest-versioned prerelease across all release lines (by version number, not build date) | | ||||||
| | `prerelease/<major.minor>/latest.json` | The highest-versioned prerelease in one release line, e.g. `prerelease/7.14/latest.json` | | ||||||
| Quartz publishes one document per build variant, all sharing the same schema: | ||||||
| `status.json` for the release build and `status-asan-debug.json` for the ASAN | ||||||
| build. Each variant has its own stable pointers, so a build of one never moves | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what are stable pointers? need probably explanation. might be easier to just write
|
||||||
| the other's. | ||||||
|
|
||||||
| Below, `<v>` stands for the variant suffix: empty for the release build, | ||||||
| `-asan-debug` for ASAN. So `status<v>.json` is either `status.json` or | ||||||
| `status-asan-debug.json`. | ||||||
|
|
||||||
| The ASAN build is filed under the same version and date as the release build | ||||||
| it was cut alongside: its `rocm_version` omits the `.asan` / `+asan` marker its | ||||||
| packages carry (for example `10.2.0a20261005`, not `10.2.0a20261005.asan`). | ||||||
|
|
||||||
| | Endpoint | Points to | | ||||||
| | --------------------------------------------------------- | ------------------------------------------------------------------------------- | | ||||||
| | `nightly/<date>/status<v>.json` | A specific nightly build of that variant | | ||||||
| | `nightly/latest<v>.json` | The most recent build of that variant (including still in progress) | | ||||||
| | `nightly/latest_good<v>.json` | The most recent fully-passing build of that variant | | ||||||
| | `nightly-bkc/<nightly-version>/<bkc-date>/status<v>.json` | A specific BKC nightly build of that variant | | ||||||
| | `nightly-bkc/<nightly-version>/latest<v>.json` | The most recent BKC build of that variant for the nightly version | | ||||||
| | `nightly-bkc/<nightly-version>/latest_good<v>.json` | The most recent fully-passing BKC build of that variant for the nightly version | | ||||||
| | `nightly-bkc/latest<v>.json` | The most recent build of that variant for the highest BKC nightly version | | ||||||
| | `nightly-bkc/latest_good<v>.json` | The highest-versioned fully-passing BKC build of that variant | | ||||||
| | `prerelease/<major.minor>/<full>/status<v>.json` | A specific prerelease build of that variant | | ||||||
| | `prerelease/latest<v>.json` | The highest-versioned prerelease of that variant across all release lines | | ||||||
| | `prerelease/<major.minor>/latest<v>.json` | The highest-versioned prerelease of that variant in one release line | | ||||||
|
|
||||||
| Each is served as raw content. The raw URL form is: | ||||||
|
|
||||||
| ```text | ||||||
| https://raw.githubusercontent.com/ROCm/quartz/main/nightly/latest.json | ||||||
| ``` | ||||||
|
|
||||||
| > **Note on the pointer files:** Every `latest.json` and `latest_good.json` pointer | ||||||
| > is a git symlink to the dated `status.json` it currently points at. Raw GitHub | ||||||
| > serves a symlink as its target path (a one-line body like `20260707/status.json`), | ||||||
| > not the file it points to, so a plain fetch returns that path rather than JSON. The | ||||||
| > Python helper `load_status` follows this pointer for you transparently; if you | ||||||
| > fetch it yourself, resolve the returned path against the pointer URL and fetch | ||||||
| > again. | ||||||
| > **Note on the pointer files:** Every `latest*.json` and `latest_good*.json` | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
| > pointer is a git symlink to the concrete `status*.json` it currently points | ||||||
| > at. Raw GitHub serves a symlink as its target path (a one-line body like | ||||||
| > `20260707/status-asan-debug.json`), not the file it points to, so a plain fetch | ||||||
| > returns that path rather than JSON. The Python helper `load_status` follows | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
is this better?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. naming wise, I'll always take your solutions :) |
||||||
| > this pointer for you transparently; if you fetch it yourself, resolve the | ||||||
| > returned path against the pointer URL and fetch again. | ||||||
|
|
||||||
| > **Note on `latest_good.json`:** "Fully passing" means the build's | ||||||
| > `summary.overall_status` is `success` (a worst-of rollup, so this implies the | ||||||
|
|
@@ -108,9 +119,10 @@ https://raw.githubusercontent.com/ROCm/quartz/main/nightly/latest.json | |||||
| > regresses to an in-progress or failed build. Because it points at the live | ||||||
| > document rather than a copy of it, a build can stop being green after the | ||||||
| > pointer was written (a re-run re-opens it, or a late leaf fails it); the pointer | ||||||
| > is then withdrawn until some build is green again, so treat a missing | ||||||
| > `latest_good.json` as "nothing good to offer right now". Prerelease has no | ||||||
| > `latest_good.json` pointer yet. | ||||||
| > then falls back to the newest build of that variant still passing, and is | ||||||
| > dropped entirely when none is left, so treat a missing pointer as "nothing good | ||||||
| > to offer right now". Prerelease has no `latest_good.json` pointer yet, for | ||||||
| > any build variant. | ||||||
|
|
||||||
| > These endpoints go live as TheRock release workflows are instrumented to report | ||||||
| > to Quartz. Until a given release type is instrumented, its files may be absent. | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| // Reference layout for status.json v2. | ||
| // Reference layout for status.json and status-asan-debug.json v2. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dont think we need to add this here? the layout should be the same independent of the build variant |
||
| // NOTE: This file is a human-readable spec and contains `//` comments. The | ||
| // real status.json emitted by Quartz is strict JSON with comments stripped. | ||
| // | ||
|
|
@@ -21,9 +21,9 @@ | |
| { | ||
| "schema_version": "2.1", | ||
| "release_type": "nightly", // "nightly" | "rc" | "dev" | ||
| "rocm_version": "7.13.0a20260408", | ||
| "rocm_version": "7.13.0a20260408", // the release version without the ASAN `.asan` / `+asan` package marker, so both variants share one value | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think we need an offline discussion about this |
||
| "build_date": "20260408", // the date this build is filed under; for nightly-bkc it is the bkc run date from the version's `+bkc.<date>` suffix, not the nightly date the build was cut from | ||
| "build_variant": "release", // (schema 2.1) build flavor: "release" | "asan" | ... ; "" when present but no signal yet (before the setup run reports); key absent entirely in pre-2.1 documents | ||
| "build_variant": "release", // (schema 2.1) build flavor: "release" (status.json) | "asan-debug" (status-asan-debug.json); "" when present but no signal yet (before the setup run reports); key absent entirely in pre-2.1 documents | ||
| "therock_commit": "db2fd412ed7fcadf306cdcf19f09cdd998544197", // (schema 2.1) 40-hex TheRock commit the release was built from; "" until the setup run resolves it; key absent entirely in pre-2.1 documents | ||
| "trigger_workflow_run_id": 12340000, // run_id of the orchestrator (multi_arch_ci) | ||
| "trigger_run_attempt": 1, // attempt of the owning orchestrator run; ownership is the (trigger_workflow_run_id, trigger_run_attempt) pair, so a GitHub re-run (same run id, higher attempt) supersedes the run before it | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| from therock_classify import ( | ||
| classify, | ||
| derive_architectures, | ||
| derive_build_variant, | ||
| derive_deb_urls, | ||
| derive_effective_owner_run_id, | ||
| derive_platform_and_pipeline, | ||
|
|
@@ -84,6 +85,29 @@ def test_framework_composite_stripped_to_rocm_part(self): | |
| rec = _make_record(rocm_version="torchvision-0.23.0a0+rocm7.14.0a20260520") | ||
| self.assertEqual(derive_release_version(rec), "7.14.0a20260520") | ||
|
|
||
| def test_asan_marker_is_dropped(self): | ||
| # ASAN versions from TheRock#7508: `.asan` appended, or `+asan` when the | ||
| # version has no local segment yet. | ||
| cases = { | ||
| "10.2.0a20261005.asan": "10.2.0a20261005", | ||
| "10.2.0a20261005+asan": "10.2.0a20261005", | ||
| "10.2.0rc1.asan": "10.2.0rc1", | ||
| "10.2.0rc1+asan": "10.2.0rc1", | ||
| "10.1.0a20260811+bkc.20260813.asan": "10.1.0a20260811+bkc.20260813", | ||
| "2.12.0+rocm10.1.0a20260823.asan": "10.1.0a20260823", | ||
| "2.13.0+rocm10.1.0a20260811.bkc.20260813.asan": ( | ||
| "10.1.0a20260811+bkc.20260813" | ||
| ), | ||
| } | ||
| for raw, expected in cases.items(): | ||
| with self.subTest(raw=raw): | ||
| rec = _make_record(rocm_version=raw) | ||
| self.assertEqual(derive_release_version(rec), expected) | ||
|
|
||
| def test_asan_inside_a_version_is_not_a_marker(self): | ||
| rec = _make_record(rocm_version="7.10.0.dev0+asanfeature") | ||
| self.assertEqual(derive_release_version(rec), "7.10.0.dev0+asanfeature") | ||
|
|
||
| def test_torch_version_fallback_end_to_end(self): | ||
| # test_pytorch_wheels_full.yml only carries `torch_version` (see | ||
| # WorkflowRunRecord.from_dict's rocm_version fallback chain); confirm | ||
|
|
@@ -162,6 +186,29 @@ def test_independent_of_version_string(self): | |
| rec = _make_record(rocm_version="7.13.0", release_type="dev") | ||
| self.assertEqual(derive_release_type(rec), "dev") | ||
|
|
||
| def test_scheduled_asan_orchestrator_is_nightly(self): | ||
| # rockrel's scheduled run reports `toJSON(inputs) == {}`. | ||
| run = _orchestrator_run(".github/workflows/multi_arch_release_asan.yml") | ||
| run.trigger_event = "schedule" | ||
| self.assertEqual(derive_release_type(run), "nightly") | ||
|
|
||
| def test_dispatched_asan_orchestrator_keeps_its_declared_type(self): | ||
| run = _orchestrator_run(".github/workflows/multi_arch_release_asan.yml") | ||
| run.trigger_event = "workflow_dispatch" | ||
| run.release_type = "prerelease" | ||
| self.assertEqual(derive_release_type(run), "prerelease") | ||
|
|
||
| def test_undeclared_type_is_only_inferred_for_scheduled_asan_orchestrator(self): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i will probably elaborate on this later. but i drop it here so i dont forget: asan releases and normal releases have the same setup in the workflow. so we should not do the special treatement here in quartz for asan. claude:
|
||
| dispatched = _orchestrator_run(".github/workflows/multi_arch_release_asan.yml") | ||
| dispatched.trigger_event = "workflow_dispatch" | ||
| release = _orchestrator_run() | ||
| release.trigger_event = "schedule" | ||
| leaf = _leaf_run() | ||
| leaf.trigger_event = "schedule" | ||
| for run in (dispatched, release, leaf): | ||
| with self.subTest(path=run.path, event=run.trigger_event): | ||
| self.assertEqual(derive_release_type(run), "") | ||
|
|
||
|
|
||
| _THEROCK_SHA = "0123456789abcdef0123456789abcdef01234567" | ||
|
|
||
|
|
@@ -763,6 +810,11 @@ def test_top_level_orchestrator_is_self(self): | |
| run.workflow_run_id = 29079513704 | ||
| self.assertEqual(derive_effective_owner_run_id(run), 29079513704) | ||
|
|
||
| def test_top_level_asan_orchestrator_is_self(self): | ||
| run = _orchestrator_run(".github/workflows/multi_arch_release_asan.yml") | ||
| run.workflow_run_id = 29079513705 | ||
| self.assertEqual(derive_effective_owner_run_id(run), 29079513705) | ||
|
|
||
| def test_descendant_uses_quartz_tracking_id(self): | ||
| # Every triggered workflow carries the top-level owner in the propagated | ||
| # id, regardless of its immediate GitHub parent. | ||
|
|
@@ -774,16 +826,25 @@ def test_descendant_uses_quartz_tracking_id(self): | |
| } | ||
| self.assertEqual(derive_effective_owner_run_id(run), 29079513704) | ||
|
|
||
| def test_run_id_parsed_without_release_type_suffix(self): | ||
| # The `;<release_type>` half must not leak into the run id, and a bare | ||
| # id with no separator still parses. | ||
| semi = _leaf_run() | ||
| semi.inputs = {"quartz_tracking_id": "29079513704;"} | ||
| self.assertEqual(derive_effective_owner_run_id(semi), 29079513704) | ||
| def test_three_field_id_supplies_the_owner(self): | ||
| run = _leaf_run() | ||
| run.inputs = {"quartz_tracking_id": "29079513704;nightly;asan-debug"} | ||
| self.assertEqual(derive_effective_owner_run_id(run), 29079513704) | ||
|
|
||
| def test_too_few_tracking_id_fields_raise(self): | ||
| # The release type is required; a bare run id is a producer bug. | ||
| for value in ("29079513704", "29079513704;"): | ||
| with self.subTest(value=value): | ||
| run = _leaf_run() | ||
| run.inputs = {"quartz_tracking_id": value} | ||
| with self.assertRaises(ValueError): | ||
| derive_effective_owner_run_id(run) | ||
|
|
||
| bare = _leaf_run() | ||
| bare.inputs = {"quartz_tracking_id": "29079513704"} | ||
| self.assertEqual(derive_effective_owner_run_id(bare), 29079513704) | ||
| def test_too_many_tracking_id_fields_raise(self): | ||
| run = _leaf_run() | ||
| run.inputs = {"quartz_tracking_id": "29079513704;nightly;asan;extra"} | ||
| with self.assertRaises(ValueError): | ||
| derive_effective_owner_run_id(run) | ||
|
|
||
| def test_no_quartz_tracking_id_returns_none(self): | ||
| # Untracked runs (CI, tracking disabled) carry no owner: the immediate | ||
|
|
@@ -799,6 +860,71 @@ def test_empty_quartz_tracking_id_returns_none(self): | |
| self.assertIsNone(derive_effective_owner_run_id(run)) | ||
|
|
||
|
|
||
| class DeriveBuildVariantTest(unittest.TestCase): | ||
| def test_tracking_id_wins_over_direct_input(self): | ||
| # A run's own `build_variant` input never picks the document: only the | ||
| # orchestrator-stamped id does. | ||
| run = _leaf_run() | ||
| run.inputs = { | ||
| "build_variant": "release", | ||
| "quartz_tracking_id": "123;nightly;asan-debug", | ||
| } | ||
| self.assertEqual(derive_build_variant(run), "asan-debug") | ||
|
|
||
| def test_tracking_id_supplies_descendant_variant(self): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets also test too many elements or too little in the tracking id |
||
| run = _leaf_run() | ||
| run.inputs = {"quartz_tracking_id": "123;nightly;asan-debug"} | ||
| self.assertEqual(derive_build_variant(run), "asan-debug") | ||
|
|
||
| def test_two_field_tracking_id_is_release(self): | ||
| run = _leaf_run() | ||
| run.inputs = { | ||
| "quartz_tracking_id": "123;nightly", | ||
| "build_variant": "asan-debug", | ||
| } | ||
| self.assertEqual(derive_build_variant(run), "release") | ||
|
|
||
| def test_untracked_run_has_no_variant(self): | ||
| # A direct input without a tracking id (manual dispatch, CI) claims nothing. | ||
| run = _leaf_run() | ||
| run.inputs = {"build_variant": "asan-debug"} | ||
| self.assertEqual(derive_build_variant(run), "") | ||
|
|
||
| def test_untracked_run_with_asan_version_is_asan_debug(self): | ||
| # e.g. an ownerless PyTorch test leaf carrying only an ASAN torch version. | ||
| for version in ("2.12.0+rocm10.1.0a20260823.asan", "10.2.0a20261005+asan"): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have the quartz tracking id. |
||
| with self.subTest(version=version): | ||
| run = _leaf_run() | ||
| run.rocm_version = version | ||
| self.assertEqual(derive_build_variant(run), "asan-debug") | ||
|
|
||
| def test_too_few_tracking_id_fields_raise(self): | ||
| run = _leaf_run() | ||
| run.inputs = {"quartz_tracking_id": "123"} | ||
| with self.assertRaises(ValueError): | ||
| derive_build_variant(run) | ||
|
|
||
| def test_too_many_tracking_id_fields_raise(self): | ||
| run = _leaf_run() | ||
| run.inputs = {"quartz_tracking_id": "123;nightly;asan;extra"} | ||
| with self.assertRaises(ValueError): | ||
| derive_build_variant(run) | ||
|
|
||
| def test_release_orchestrator_is_release(self): | ||
| run = _orchestrator_run() | ||
| run.inputs = {"build_variant": "asan-debug"} | ||
| self.assertEqual(derive_build_variant(run), "release") | ||
|
|
||
| def test_asan_orchestrator_is_always_asan_debug(self): | ||
| # rockrel's report carries no `build_variant` input (a scheduled run | ||
| # carries no inputs at all); any input it does carry is ignored. | ||
| for inputs in ({}, {"build_variant": "asan"}): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no. |
||
| with self.subTest(inputs=inputs): | ||
| run = _orchestrator_run(".github/workflows/multi_arch_release_asan.yml") | ||
| run.inputs = inputs | ||
| self.assertEqual(derive_build_variant(run), "asan-debug") | ||
|
|
||
|
|
||
| class ClassifyOwnerNormalizationOrderingTest(unittest.TestCase): | ||
| """`classify()` must normalize the owner AFTER deriving source_run_id. | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -23,6 +23,7 @@ | |||||
| "release_type": "nightly", | ||||||
| "inputs": { | ||||||
| "build_variant": "release", | ||||||
| "quartz_tracking_id": "27797822900;nightly", | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
please also check the other fixtures |
||||||
| "release_type": "nightly", | ||||||
| "prerelease_version": "", | ||||||
| "linux_amdgpu_families": "all", | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now we have
status-asan-debug.jsoni wonder if for easier parsing
status_asan-debug.jsonwould be the better way? any opinion?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will give it a try