scikit-learn / scikit-learn/scikit-learn

Threads awaiting for GIL in Forest estimators

Open
#20,666 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

free-threading module:ensemble Performance
Dominant language
Python
Stars
67.3k
Forks
27.4k
Avg merge
1d 15h
Merged PRs (30d)
58

Description

Discussed in https://github.com/scikit-learn/scikit-learn/discussions/20651

In forest algorithms, the preferred parallelization backend is threading. However, it looks that it is not anymore the most appropriate backend. As discussed here, it might be that the GIL is not explicitly released in some part of the code locking the execution of the thread.

We need to investigate more to solve this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading discussion #20651, especially the linked comment, then reproduce the forest-estimator behavior with the threading backend and investigate where threads wait for the GIL. The issue names no files or tests, so use the estimator parallelization paths as the entry point. Done means identifying the blocking code and resolving the backend or GIL-release problem.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.