Skip to content

Stabilize SDCA logistic regression test - #7677

Open
matouskozak wants to merge 3 commits into
mainfrom
matouskozak-investigate-flaky-7343
Open

Stabilize SDCA logistic regression test#7677
matouskozak wants to merge 3 commits into
mainfrom
matouskozak-investigate-flaky-7343

Conversation

@matouskozak

@matouskozak matouskozak commented Aug 27, 2026

Copy link
Copy Markdown
Member

Fixes #7343.

The strict SdcaLogisticRegression quality assertions now use a single training thread, making their results deterministic. A separate four-thread test retains correctness coverage of SDCA's nondeterministic parallel path by preserving the original AUC requirement and verifying that its LogLoss outperforms a featureless Prior baseline.

My theory is that the macOS arm64 runners have more threads than the Windows/Linux runners which leads to more non-determinism, triggering the flaky failure.

Make strict quality assertions deterministic and retain explicit coverage of multithreaded SDCA training. Fixes #7343.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cf5862a0-24ff-48b6-bd23-a5fa8d0053f7
Copilot AI lite review requested due to automatic review settings August 27, 2026 08:55

Copilot AI 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.

Pull request overview

This PR addresses flakiness in SdcaLogisticRegression test assertions by making the “quality gate” test deterministic while keeping a separate test that still exercises SDCA’s multithreaded (nondeterministic) training path.

Changes:

  • Switches the strict SdcaLogisticRegression quality test to use NumberOfThreads = 1 to stabilize metrics like LogLoss.
  • Adds a new multithreaded smoke test (NumberOfThreads = 4) that validates predictions are finite/calibrated and that the model learns the dataset’s class signal.
  • Updates the trainer construction to use the SdcaLogisticRegressionBinaryTrainer.Options overload (to set NumberOfThreads).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.88%. Comparing base (240a849) to head (6b91e62).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7677   +/-   ##
=======================================
  Coverage   69.88%   69.88%           
=======================================
  Files        1487     1487           
  Lines      276214   276240   +26     
  Branches    28287    28287           
=======================================
+ Hits       193019   193056   +37     
+ Misses      75708    75698   -10     
+ Partials     7487     7486    -1     
Flag Coverage Δ
Debug 69.88% <100.00%> (+<0.01%) ⬆️
production 64.07% <ø> (+<0.01%) ⬆️
test 89.83% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../Microsoft.ML.Tests/TrainerEstimators/SdcaTests.cs 97.77% <100.00%> (+0.37%) ⬆️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Require the four-thread trainer to preserve the original AUC quality and outperform a featureless prior model on LogLoss.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cf5862a0-24ff-48b6-bd23-a5fa8d0053f7
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cf5862a0-24ff-48b6-bd23-a5fa8d0053f7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SdcaLogisticRegression failing with LogLoss value above 0.5 on Apple M1

2 participants