Skip to content

MNT Fix LDA test in the face of parallelism - #35524

Closed
itamarst wants to merge 1 commit into
scikit-learn:mainfrom
itamarst:35313-lda
Closed

itamarst wants to merge 1 commit into
scikit-learn:mainfrom
itamarst:35313-lda

Conversation

@itamarst

Copy link
Copy Markdown
Contributor

Related to #35313

It's a "fix" but I think this makes sense.

@itamarst

Copy link
Copy Markdown
Contributor Author

After further looking into other failing parallel LDA tests... maybe it is a real bug? Will revisit.

@itamarst itamarst closed this Nov 25, 2026
@itamarst

Copy link
Copy Markdown
Contributor Author

What I've learned trying to figure out why LDA check_fit_idempotent fails, for when I get back to this:

  • With Loky parallelism, random_state is copied, so the original is never changed. So it keeps generating the same random numbers over and over again! Unclear if this is intentional or not.
  • With threading, though, the random_state is not copied, it is shared and called by multiple threads. and maybe... different tasks get different values as a result across runs, since there's race between different tasks calling it?

And that may apply to all tsets, including one in original version of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant