-
Notifications
You must be signed in to change notification settings - Fork 0
fix: Quartz mis-reports pytorch/jax matrix-job test results #71
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 all commits
393383d
927d15c
6f2438a
c19a9e1
d9ecc99
ca6495d
7e45584
d6f55af
a36a860
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 |
|---|---|---|
|
|
@@ -1772,6 +1772,12 @@ def test_completed_fanout_build_refreshes_same_run_test_leaves() -> None: | |
| _job("Build | py 3.12 | torch release/2.10 / Test | gfx110X-all"), | ||
| ], | ||
| ) | ||
| # Deliberately mismatched vs. the linux leaf above: this proves the match | ||
| # is keyed on (run_id, run_attempt) alone, not platform. That's safe in | ||
| # practice -- GitHub's run_id is unique per repository across every | ||
| # workflow/platform, so a real linux and windows run can never collide on | ||
| # one -- but it's an isolation technique, not a model of real data; don't | ||
| # read it as "a windows run can update a linux leaf" in production. | ||
| completed_build.classification.platform = "windows" | ||
| tusj._merge_run_into_document( | ||
| doc, completed_build, tusj._create_leaf(completed_build) | ||
|
|
@@ -1784,6 +1790,138 @@ def test_completed_fanout_build_refreshes_same_run_test_leaves() -> None: | |
| assert leaf.variants[0].status is Status.success | ||
|
|
||
|
|
||
| def test_fanout_projection_uses_variant_rollup_not_raw_run_conclusion() -> None: | ||
| # The build run's own top-level GitHub conclusion is not necessarily the | ||
| # worst-of its matrix cells (e.g. a cell whose nested test job failed does | ||
| # not always flip the run's own conclusion). A projected test leaf must | ||
| # take the worst-of its own variants, not the raw run conclusion. | ||
| doc = StatusDocument() | ||
| stale_test = _variant_run( | ||
| pipeline_type="pytorch", | ||
| pipeline_phase="test", | ||
| architectures=["gfx110X-all"], | ||
| run_id=902, | ||
| conclusion=None, | ||
| jobs=[ | ||
| _job("Build | py 3.12 | torch release/2.10 / Build"), | ||
| _job( | ||
| "Build | py 3.12 | torch release/2.10 / Test | gfx110X-all", | ||
| conclusion=None, | ||
| completed=None, | ||
| ), | ||
| ], | ||
| ) | ||
| doc.upsert_leaf( | ||
| "linux", "gfx110X-all", "pytorch", "test", tusj._create_leaf(stale_test) | ||
| ) | ||
|
|
||
| # The run's own conclusion reports success even though its nested test | ||
| # job for this cell failed. | ||
| completed_build = _variant_run( | ||
| pipeline_type="pytorch", | ||
| pipeline_phase="build", | ||
| run_id=902, | ||
| conclusion="success", | ||
| jobs=[ | ||
| _job("Build | py 3.12 | torch release/2.10 / Build"), | ||
| _job( | ||
| "Build | py 3.12 | torch release/2.10 / Test | gfx110X-all", | ||
| conclusion="failure", | ||
| ), | ||
| ], | ||
| ) | ||
| completed_build.classification.platform = "windows" | ||
| tusj._merge_run_into_document( | ||
| doc, completed_build, tusj._create_leaf(completed_build) | ||
| ) | ||
|
|
||
| leaf = doc.pipelines.pytorch.test["linux"]["gfx110X-all"] | ||
| assert leaf.status is Status.failure | ||
| assert leaf.variants is not None | ||
| assert leaf.variants[0].status is Status.failure | ||
|
|
||
|
|
||
| def test_fanout_projection_folds_raw_run_conclusion_into_rollup() -> None: | ||
| # The inverse of the case above: every reported cell looks clean, but the | ||
| # run itself was cancelled (e.g. a cell whose job never even started, so | ||
| # it never shows up in `variants` at all). The projected test leaf must | ||
| # still surface that cancellation rather than reporting the variants' | ||
| # all-success rollup verbatim. | ||
| doc = StatusDocument() | ||
| stale_test = _variant_run( | ||
| pipeline_type="pytorch", | ||
| pipeline_phase="test", | ||
| architectures=["gfx110X-all"], | ||
| run_id=903, | ||
| conclusion=None, | ||
| jobs=[ | ||
| _job( | ||
| "Build | py 3.12 | torch release/2.10 / Test | gfx110X-all", | ||
| conclusion=None, | ||
| completed=None, | ||
| ), | ||
| ], | ||
| ) | ||
| doc.upsert_leaf( | ||
| "linux", "gfx110X-all", "pytorch", "test", tusj._create_leaf(stale_test) | ||
| ) | ||
|
|
||
| # Same platform as the stale leaf above: this test is about the | ||
| # cancellation-folding logic, not about the (run_id, run_attempt)-only | ||
| # matching (already covered by | ||
| # test_completed_fanout_build_refreshes_same_run_test_leaves), so it | ||
| # doesn't need a platform mismatch to make its point. | ||
| cancelled_build = _variant_run( | ||
| pipeline_type="pytorch", | ||
| pipeline_phase="build", | ||
| run_id=903, | ||
| conclusion="cancelled", | ||
| jobs=[ | ||
| _job( | ||
| "Build | py 3.12 | torch release/2.10 / Test | gfx110X-all", | ||
| conclusion="success", | ||
| ), | ||
| ], | ||
| ) | ||
| tusj._merge_run_into_document( | ||
| doc, cancelled_build, tusj._create_leaf(cancelled_build) | ||
| ) | ||
|
|
||
| leaf = doc.pipelines.pytorch.test["linux"]["gfx110X-all"] | ||
| assert leaf.status is Status.cancelled | ||
|
|
||
|
|
||
| def test_variant_job_name_matches_uppercase_ancestor_segment() -> None: | ||
| # A calling orchestrator (e.g. rockrel) can wrap TheRock's own build job | ||
| # in a differently-cased ancestor segment, e.g. | ||
| # "Release | py 3.12 | JAX 0.11.0 / Build | py 3.12 | jax rocm-jaxlib-v0.11.0" | ||
| # The build job's own tail (lowercase, full ref) must still win over that | ||
| # ancestor. A nested test sub-job has no (py, ref) segment of its own and | ||
| # must fall back to the uppercase ancestor instead of being dropped. | ||
| run = _variant_run( | ||
| pipeline_type="jax", | ||
| pipeline_phase="build", | ||
|
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. as it is build phase shouldnt it kick out jobs that are "test"?
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. No -- this is intentional and predates this PR (see
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. PyTorch/JAX test coverage runs as a reusable workflow_call nested inside the delegated build orchestrator so build and test jobs share one job list/run id, and _variants_from_jobs intentionally groups them together per py, ref cell so test outcomes can be seen before the top-level run finishes. |
||
| jobs=[ | ||
| _job( | ||
| "build_jax_wheels / Release | py 3.12 | JAX 0.11.0 / " | ||
| "Build | py 3.12 | jax rocm-jaxlib-v0.11.0" | ||
| ), | ||
| _job( | ||
| "build_jax_wheels / Release | py 3.13 | JAX 0.11.0 / " | ||
| "Test | gfx94X-dcgpu | linux-gfx942-1gpu-ccs-csp-ossci-rocm / " | ||
| "Test JAX | gfx94X-dcgpu", | ||
| conclusion="cancelled", | ||
| ), | ||
| ], | ||
| ) | ||
| variants = tusj._derive_variants(run) | ||
| by_py = {v.matrix["py"]: v for v in variants} | ||
| assert by_py["3.12"].matrix["jax_ref"] == "rocm-jaxlib-v0.11.0" | ||
| assert by_py["3.12"].status is Status.success | ||
| assert by_py["3.13"].matrix["jax_ref"] == "0.11.0" | ||
| assert by_py["3.13"].status is Status.cancelled | ||
|
|
||
|
|
||
| def test_skip_workflow_names_are_all_disregarded(tmp_path: Path) -> None: | ||
| # Guards the generic `_SKIP_WORKFLOW_NAMES` mechanism itself, not just the | ||
| # one workflow it was introduced for: whatever is in the set must be | ||
|
|
||
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.
i think here is an error
if i understand the test correctly:
pytorch test for gfx110X-all
have a in_progress run on linux
have a successful test run but cancel the entire pytorch testing run on windows
now at the end when checking the status of linux should copy from windows and show cancelled?
that does not make sense because windows and linux have separate pytorch workflows. so this kind of rollup should only happen within a platform.
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.
No, no. agree it reads as confusing, since it looks like it's testing platform mixing when it's really testing field-independence. the reason the test sets cancelled_build.classification.platform = "windows" while the stale leaf is "linux" (both keyed to the same run_id=903) is to deliberately prove the matching predicate really is just (run_id, run_attempt) and doesn't silently depend on platform equality. I'll drop the platform override in my new test (default to "linux", matching the stale leaf).
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.
but it should depend on the platform. pytorch test on windows are totally independent of linux - even for the same arch