Skip to content

DOC Update parallelsm docs for joblib 1.7 - #35521

Draft
itamarst wants to merge 1 commit into
scikit-learn:mainfrom
itamarst:update-parallelism-documentation-for-joblib-1.7
Draft

itamarst wants to merge 1 commit into
scikit-learn:mainfrom
itamarst:update-parallelism-documentation-for-joblib-1.7

Conversation

@itamarst

Copy link
Copy Markdown
Contributor

This should only be merged once joblib 1.7 is released.

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here is some feedback but overall LGTM.

Comment on lines +37 to +38
later this will take into account nested thread pools, so available cores will
be smaller in worker pools.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's assume that joblib 1.7.0 has been released when scikit-learn users read this.

Suggested change
later this will take into account nested thread pools, so available cores will
be smaller in worker pools.
later this takes into account nested thread pools, so available cores will
be smaller in worker pools.

the threading backend will be enabled in additional cases.

On free-threaded Python (sometimes identified by a "t" suffix on the version,
e.g. "3.15t"), the threaded backend will often be faster than ``loky``.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
e.g. "3.15t"), the threaded backend will often be faster than ``loky``.
e.g. "3.15t"), the threaded backend is often faster than ``loky``.

Comment on lines +84 to +85
processes. Subsequent calls will be faster as they reuse the existing pool
of workers.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
processes. Subsequent calls will be faster as they reuse the existing pool
of workers.
processes and importing the necessary packages in the new processes.
Subsequent calls will be faster as they reuse the existing pool of warm
workers.


.. code-block:: console
Within a single Python thread, you can control the exact number of threads that
are used via `threadpoolctl` as explained by `this piece of documentation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
are used via `threadpoolctl` as explained by `this piece of documentation
are used via `threadpoolctl` as explained by the `threadpoolctl documentation

Comment on lines +108 to +109
1.7 and later will manage OpenMP limits appropriately (earlier versions only
managed process pools).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
1.7 and later will manage OpenMP limits appropriately (earlier versions only
managed process pools).
1.7 and later manage OpenMP limits appropriately (earlier versions only managed
OpenMP limits when using process-based joblib backends).

Starting with ``joblib`` v1.7 both are much less of a concern, though some
configuration may be required.

For nested parallel algorithms, as long as you configure the inner algorithms

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
For nested parallel algorithms, as long as you configure the inner algorithms
For nested joblib parallel calls, as long as you configure the inner algorithms

Comment on lines +185 to +188
in `this document from Thomas J. Fan
<https://thomasjpfan.github.io/parallelism-python-libraries-design/>`_; some of
the details may be out of date, given subsequent work on ``joblib`` and
``threadpoolctl``.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
in `this document from Thomas J. Fan
<https://thomasjpfan.github.io/parallelism-python-libraries-design/>`_; some of
the details may be out of date, given subsequent work on ``joblib`` and
``threadpoolctl``.
in `this document from Thomas J. Fan
<https://thomasjpfan.github.io/parallelism-python-libraries-design/>`_; some of
the details may be out of date, as it was written before ``joblib`` 1.7
implemented more comprehensive oversubscription protection by default.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that the following resources is expected to keep being updated (compared to @thomasjpfan's blog post:

https://pypackaging-native.github.io/key-issues/native-dependencies/blas_openmp/

However, I like the blog post narration better. Maybe we can keep it for now.

This branch has not been deployed

No deployments
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.

2 participants