Repository navigation
feat: enable asan build in quartz - #110
Conversation
done |
b99647c to
050b59e
Compare
050b59e to
b012ca9
Compare
HereThereBeDragons
left a comment
There was a problem hiding this comment.
as you will see in several of my comments i think it is best to have one status json for each build variant (guard by which we want to record) and not mix multiple asan builds into one.
and then is the question if we first ready the prs in therock/rockrel before merging this - which is probably the easier way to go for that version. there is one comment about what extras we need to do there to make it easier for us
| | **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, such as `release`, `asan`, or `asan-debug`. It selects the document: `status.json` for `release`, `status-asan.json` for either ASAN flavor. | |
There was a problem hiding this comment.
remove asan-debug. we dont have this yet in therock. let also just say that "asan" goes in status-asan.json. maybe have status.json for release and anything else is status-<buildvariant>.json
There was a problem hiding this comment.
ok, thought it's good to have for the future. now it's status.json for release and status-<build_variant>.json for anything else.
| | `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 family, all sharing the same | ||
| schema. The normal release build gets the unsuffixed `status.json`; ASAN builds |
There was a problem hiding this comment.
right now we only publish status.json and status-asan.json. not all buildvaraints
There was a problem hiding this comment.
same as above, but ok, making it fit the current behaviour.
| schema. The normal release build gets the unsuffixed `status.json`; ASAN builds | ||
| get `status-asan.json`. The suffix follows TheRock's own `build_variant_suffix`, | ||
| which folds the debug flavor onto its base family, so both `asan` and | ||
| `asan-debug` publish to `status-asan.json` and the document's `build_variant` |
There was a problem hiding this comment.
as said before we probably want to limit this
| | `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 | | ||
|
|
||
| > **The sanitizer endpoints are not published yet.** TheRock's |
There was a problem hiding this comment.
remove that part. adding therock/rockrel to release it will be quick
| "rocm_version": "7.13.0a20260408", | ||
| "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" | "asan" | "asan-debug" | ... ; in status-asan.json this is the one field distinguishing the ASAN flavors; "" when present but no signal yet (before the setup run reports); key absent entirely in pre-2.1 documents |
There was a problem hiding this comment.
lets remove asan-debug here
| return repo_dir / "nightly" / _NIGHTLY_DATE / "status.json" | ||
|
|
||
|
|
||
| def _nightly_sanitizer_status_path(repo_dir: Path) -> Path: |
There was a problem hiding this comment.
| def _nightly_sanitizer_status_path(repo_dir: Path) -> Path: | |
| def _nightly_asan_status_path(repo_dir: Path) -> Path: |
| assert doc.trigger_workflow_run_id == 29079513704 | ||
|
|
||
|
|
||
| def test_ownerless_pytorch_leaf_is_rejected_from_asan_document( |
There was a problem hiding this comment.
there are works to enable asan for pytorch. we should not treat it as special. we should rather deactive pytorch/jax as being skipped for asan for the moment in therock. and work with the quartz tracking id
There was a problem hiding this comment.
ok, didn't know this. good to know
| assert (prerelease_root / "7.14" / "latest-asan.json").readlink() == Path( | ||
| "7.14.0rc1/status-asan.json" | ||
| ) | ||
| assert not (prerelease_root / "latest.json").exists() |
There was a problem hiding this comment.
also assert not status.json?
There was a problem hiding this comment.
made somewhat sense for me. anyway, removed
| ) | ||
| bkc_root = tmp_path / "nightly-bkc" | ||
| version_root = bkc_root / _BKC_NIGHTLY_VERSION | ||
| target = Path(_BKC_DATE) / "status-asan.json" |
There was a problem hiding this comment.
assert not status.json
| _event(asan_orchestrator), repo_dir=tmp_path, commit_and_push=False | ||
| ) | ||
|
|
||
| assert out == _nightly_sanitizer_status_path(tmp_path) |
There was a problem hiding this comment.
lets assert the same thing for both docs
HereThereBeDragons
left a comment
There was a problem hiding this comment.
didnt have a look at scripts/receive_therock/tests/therock_update_status_json_test.py
but i think this are enough comments that need applying first.
for the question about keeping .asan in the version or not - we should double check waht they want to do with python asan wheels. for tarballs the .asan is dropped. might need a larger offline discussion.
| "release_type": "nightly", | ||
| "inputs": { | ||
| "build_variant": "release", | ||
| "quartz_tracking_id": "27797822900;nightly", |
There was a problem hiding this comment.
| "quartz_tracking_id": "27797822900;nightly", | |
| "quartz_tracking_id": "27797822900;nightly;release", |
please also check the other fixtures
| return str(wr.inputs.get("build_variant") or "").strip() | ||
| """The release flavor this run belongs to: "release", "asan", "asan-debug", ... | ||
|
|
||
| Every run of a tracked release reads it from the propagated |
There was a problem hiding this comment.
please rework the comment to only describe what the function does
| | **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. | |
There was a problem hiding this comment.
right now we have status-asan-debug.json
i wonder if for easier parsing status_asan-debug.json would be the better way? any opinion?
| | `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 |
There was a problem hiding this comment.
what are stable pointers? need probably explanation.
might be easier to just write
Each variant has its own stable? endpoints like
latest.json/latest_asan-debug.jsonto point to the latest runs.
| > 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` |
There was a problem hiding this comment.
* vs <v> for the build variant? should be uniform throughout the document
| """Highest-version target across the per-nightly-version `latest_good.json` | ||
| pointers under `bkc_root`, as a path relative to `bkc_root` | ||
| (`<nightly-version>/<bkc-date>/status.json`), or None when none survive. | ||
| def _highest_subdir_good(bkc_root: Path, pointer_name: str) -> Path | None: |
There was a problem hiding this comment.
is this only for latest_good? then lets not use cryptic names like "pointer_name"
| build_variant = c.build_variant.lower() | ||
| if build_variant: | ||
| return build_variant | ||
| if c.pipeline_type == "setup": |
There was a problem hiding this comment.
setup has the build_variant as input.
| return f"{m.group(1)}+bkc.{m.group(2)}" if m else v | ||
|
|
||
|
|
||
| # ASAN wheel versions end in an `asan` marker after the regular version (see |
There was a problem hiding this comment.
we might need to have keep the .asan
but this should be an easy change so can do this last
| Independent of the version string: a bare `7.13.0` may be published to | ||
| the dev bucket, so the version cannot be used to infer the type. | ||
|
|
||
| The one undeclared case is rockrel's scheduled `multi_arch_release_asan.yml`: |
There was a problem hiding this comment.
as i said somehwere else before: lets do it how we do it for the normal release.
latest the top level orchestrator called via workflow call in therock should hav ethe details of the release type
| if has_asan_version_marker(wr.rocm_version or ""): | ||
| return FINALIZING_PHASE_BUILD_VARIANTS["release-asan"] | ||
| return "" | ||
| return tracking.build_variant or "release" |
There was a problem hiding this comment.
dont think we need the "or" part in return tracking.build_variant or "release"
as we will need to merge in therock/rokcrel the changes first before adding them here
HereThereBeDragons
left a comment
There was a problem hiding this comment.
1-2 small changes.
other change srequire:
- merging this pr
- upgrading quartz tracking id in rockrel
- removing the intermittent solutions of accepting the old quartz tracking id
|
|
||
|
|
||
| def _document_rocm_version(workflow_run: WorkflowRunRecord) -> str: | ||
| """The document's `rocm_version`: the release version with the run's ASAN |
There was a problem hiding this comment.
asan == build variant?
| return None | ||
|
|
||
| release_type = workflow_run.release_type or "" | ||
| if release_type not in _TRACKED_RELEASE_TYPES: |
There was a problem hiding this comment.
_TRACKED_RELEASE_TYPES lets remove asan for now from here.
we add the code but wait to activate it until the final decision on the asan version schema has been taken
| derive_build_variant(run) | ||
|
|
||
| def test_setup_input_is_taken_verbatim(self): | ||
| for tracking_id in ("123;nightly;asan-debug", "123;nightly", ""): |
There was a problem hiding this comment.
we should be failing for "123;nightly"
even setup.yml will have a complete quartz_tracking_id with the build variant
that is a todo in the future to drop it. we need a short overlap where we can accept the old 2-entry quartz-trackingid
There was a problem hiding this comment.
ok, won't change anything, just a TO DO.
| f"in quartz_tracking_id={raw!r}" | ||
| ) from exc | ||
| build_variant: TheRockBuildVariant | None = None | ||
| if build_variant_part: |
There was a problem hiding this comment.
we will always have build_variant_part. we will merge first the prs in therock/rockrel.
as such just assume quartz_tracking_id is either empty or contains all the parameters we are requesting
that is a todo in the future to drop it. we need a short overlap where we can accept the old 2-entry quartz-trackingid
| """True when `version` (raw or ROCm segment) carries the ASAN marker.""" | ||
| return bool(_ASAN_VERSION_MARKER_RE.search(_rocm_version_segment(version.strip()))) | ||
| def derive_version_marker(wr: WorkflowRunRecord) -> str: | ||
| """The ASAN marker ending this run's ROCm version, verbatim, or "". |
There was a problem hiding this comment.
i wonder if this should be based on build_variant from teh quartz_tracking_id.
but lets wait until we know what we will do with the asan version before spedning time on it
There was a problem hiding this comment.
ok, same here as above
| Every other run reads it from the third field of the propagated | ||
| `quartz_tracking_id` (`"<run_id>;<release_type>;<build_variant>"`), never | ||
| from its own `build_variant` input: only a run triggered by a release | ||
| orchestrator carries that id, so a manually dispatched workflow cannot claim |
There was a problem hiding this comment.
in theory you can set all the quartz_tracking_id manually.. if you do it correctly
so i would just delete the half sentence
| top_level = is_top_level_orchestrator(wr) | ||
| tracked = str(parse_quartz_tracking_id(wr.inputs).build_variant or "") | ||
| if top_level or c.pipeline_type == "setup": | ||
| declared = str(wr.inputs.get("build_variant") or "").strip() |
There was a problem hiding this comment.
setup already has the correctly set quartz_tracking_id including the build variant as input
that is a todo in the future to drop it. we need a short overlap where we can accept the old 2-entry quartz-trackingid
Motivation
Closes #108.
Merge only after rockrel/TheRock are wired
ASAN releases currently have nowhere to land. Since #77 they are recognised and
then deliberately dropped, so an ASAN nightly produces no published status at
all. PR depends and is based on top of #102
This gives every build variant its own document and its own pointers, so ASAN
results are published without a release build and an ASAN build ever being able
to overwrite one another.
Technical Details
Per-variant documents.
_StatusDocumentKindkeys a document by buildvariant, with the member value doubling as the filename suffix (
""forrelease,"-asan"for ASAN).Per-variant pointers.
_pointer_filenameapplies the same suffix to everylatest/latest_goodpointer, across nightly, nightly-bkc (including thetop-level cross-version pointers) and prerelease. The resulting tree is the one
in the issue.
Finalization.
FINALIZING_PHASESnow includesrelease-asan, so the ASANorchestrator owns and finalizes its own document.
Tracking id.
quartz_tracking_idis extended to<run_id>;<release_type>;<build_variant>.build_pytorch: falseandbuild_jax: falseare passed to thesetup job, so PyTorch and JAX alreadyrender
skippedand willnot hold the ASAN rollup at
in_progress.Test Plan
all three release tiers, independent finalization of the release and ASAN
documents, rejection of unregistered sanitizer families, rejection of ASAN
leaves against a normally-owned document, and the publication gate.
Test Result
580 passed
Submission Checklist