Skip to content

Enable determinism check in CI - #85

Merged
joniohtonen merged 7 commits into
mainfrom
84-feature-determinism-check-in-ci
Oct 7, 2026
Merged

joniohtonen merged 7 commits into
mainfrom
84-feature-determinism-check-in-ci

Conversation

@joniohtonen

@joniohtonen joniohtonen commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Enable option to run determinism checks in CI.

Closes #84

Background

Determinism checks were introduced in run.py a short while ago, but there was no support in CI for it.

Goals

Allow running determinism checks while doing benchmarking.

Tasks

  • Implement new input that triggers the script
  • Implement notification system

Tests

  • Test that the parameters works and the script runs, run

Other

This will trigger a run failed email with "Some jobs were not successful", and the email body shows what failed.

@joniohtonen joniohtonen self-assigned this Sep 29, 2026
@joniohtonen joniohtonen added the enhancement New feature or request label Sep 29, 2026
@joniohtonen joniohtonen linked an issue Sep 29, 2026 that may be closed by this pull request
@joniohtonen
joniohtonen force-pushed the 84-feature-determinism-check-in-ci branch 4 times, most recently from 1b425b6 to 6df498b Compare October 1, 2026 12:33
…d in the benchmarking result artifact. Separate jobs for each arch will then check the results. If they fail, the email will that inevitable arrives after the job completes will contain something like "some of the jobs failed", which is good enough indicator for warranting a closer look.
@joniohtonen
joniohtonen force-pushed the 84-feature-determinism-check-in-ci branch from ca0160f to 37fffbd Compare October 2, 2026 08:06
@joniohtonen
joniohtonen marked this pull request as ready for review October 2, 2026 21:43
@joniohtonen
joniohtonen requested review from a team as code owners October 2, 2026 21:43

@lauri9 lauri9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI_RUN_PY_FORCE_DETERMINISM_CHECK vs CI_RUN_PY_FORCE_DETERMINISM_REPORT - what is the difference and why do we need both?

Are the formatting changes necessary in run.py, they make reviewing a bit cumbersome

@joniohtonen

Copy link
Copy Markdown
Contributor Author

CI_RUN_PY_FORCE_DETERMINISM_CHECK vs CI_RUN_PY_FORCE_DETERMINISM_REPORT - what is the difference and why do we need both?

Ah, that's likely now redundant after I changed the approach. Good catch.

Are the formatting changes necessary in run.py, they make reviewing a bit cumbersome

Pre-commit hook doing its thing. I'll bring the old version back and slap the changes on that since there aren't that many, but that reformatting should be done eventually.

@lauri9

lauri9 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Pre-commit hook doing its thing. I'll bring the old version back and slap the changes on that since there aren't that many, but that reformatting should be done eventually.

Sure, I'd be happy to approve a linting only PR since there it's clear that no functional changes are being introduced

@joniohtonen

Copy link
Copy Markdown
Contributor Author

Sure, I'd be happy to approve a linting only PR since there it's clear that no functional changes are being introduced

I'll put it on my list, needs some checking beforehand that nobody else is working on those files because in any of their own branches or it triggers a cornucopia of conflicts that are a huge pain to resolve manually.

@Arech8

Arech8 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

CI_RUN_PY_FORCE_DETERMINISM_CHECK vs CI_RUN_PY_FORCE_DETERMINISM_REPORT - what is the difference and why do we need both?

Are the formatting changes necessary in run.py, they make reviewing a bit cumbersome

@lauri9 , CI_RUN_PY_FORCE_DETERMINISM_CHECK forcefully enables the check. CI_RUN_PY_FORCE_DETERMINISM_REPORT is/WAS a fail-safe mechanism to force report running when it's made ON by default in xDiT and configs don't have additional enablers specified.

import os
from pathlib import Path

REPORT_FILENAME = "determinism_report.json"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you have a single definition for that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Architecturally, the code that works with the determinism check results is spread across the run.py and this file and they became tightly coupled together. Can you maybe instead refactor the machinery in a single file that generates the report for run.py and provide what's needed for this script, so everything that works with the report itself is neatly encapsulated into a single module?

@lauri9 lauri9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense and statuses unavailable and error passing with warnings is okay. The core functionality seems to do what it's advertised to do based on the CI run. Consider if the default should be enabled, but this looks good to me. I suggest to wait for @Arech8 to also approve.

Comment thread .ci/run.py
Comment thread .ci/run.py Outdated
return entry

if 1 != len(det_check):
logger.error("Expected exactly one top-level directory in results report")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this branch also needs entry["status"] = "error"

Instead of setting it all the time, I'd suggest making it the default value and set entry["status"] = "unavailable" under if determinism_check_results is None:

Comment thread .ci/run.py Outdated
Comment thread .ci/run.py
Comment thread .ci/run.py
Comment thread .github/actions/check-determinism-report/scripts/check-determinism.py Outdated
@joniohtonen

Copy link
Copy Markdown
Contributor Author

I got an idea that requires some bigger rewriting but keeps run.py much cleaner, functionally everything stays the same.

@joniohtonen

Copy link
Copy Markdown
Contributor Author

So what changed is that now the determinism report handling is a more monolithic, separate entity and it handles the data side of things. The interpretation and actions inferred from that report is now handled by the separate, arch-specific (i.e. if there's runs for both mi300 and mi355, both will have their determinism report check jobs) job in the workflow.

If the whole report is missing -> job fails
If one or more results are missing from the report -> job fails
The report notes errors or determinism check failure for one or more models -> job fails

Job failure does not prevent the whole workflow from finishing, but it will be noted in the email that lands in the user's inbox.

@Arech8 Arech8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, Joni 👍
Thanks a ton!

@joniohtonen
joniohtonen merged commit 6dbcc22 into main Oct 7, 2026
19 checks passed
@joniohtonen
joniohtonen deleted the 84-feature-determinism-check-in-ci branch October 7, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Determinism check in CI

3 participants