Skip to content

Add CI job with threaded parallelism on by default, to catch obvious threading bugs, and fix all bugs #35313

Open

Description

@itamarst

Warning

This issue is not yet ready for a PR. If you are interested in contributing to scikit-learn, please have a look at our contributing guidelines, and in particular the sections for new contributors and the "Needs triage" label.

Given free-threaded Python, threading is going to become a lot more commonly used. Per discussion at a recent meeting, it'd be useful to have a CI runner that:

  • Uses free-threaded Python.
  • Sets backend to threading.
  • Sets n_jobs to -1.

The idea is to catch any blatantly non-thread-safe code. This is a preliminary to longer-term ideas like setting default backend to threading on free-threaded Python; the threaded backend tends to be faster than Loky, or will be once new joblib is released.

@ogrisel suggested opening a PR for each bug fix, so that one controversial one doesn't stall other fixes. As such, I'm going to follow this development process:

Activity

  1. added
    Needs Triage
    on Nov 4, 2026
  2. added
    Parallelism and scalability
    and removed
    Needs Triage
    on Nov 5, 2026
  3. added
    Needs Investigation
    on Nov 5, 2026
  4. changed the title [-]Add CI job with threaded parallelism on by default, to catch obvious threading bugs[/-] [+]Add CI job with threaded parallelism on by default, to catch obvious threading bugs, and fix all bugs[/+] on Nov 5, 2026
  5. monahgh commented on Nov 9, 2026

    @monahgh

    Hey, I would like to work on the proposed fix if not claimed yet.

  6. itamarst commented on Nov 9, 2026

    @itamarst
    ContributorAuthor

    Hey, I would like to work on the proposed fix if not claimed yet.

    Sorry, I've already started work on this.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Build / CINeeds InvestigationParallelism and scalability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions