8000 DOC minor broken links fix in parallelism docs (#19151) · scikit-learn/scikit-learn@990bf98 · GitHub
[go: up one dir, main page]

Skip to content

Commit 990bf98

Browse files
NicolasHugthomasjpfan
authored andcommitted
DOC minor broken links fix in parallelism docs (#19151)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
1 parent 4f36b88 commit 990bf98

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

doc/computing/parallelism.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ threads than the number of CPUs on a machine. Over-subscription happens when
114114
a program is running too many threads at the same time.
115115

116116
Suppose you have a machine with 8 CPUs. Consider a case where you're running
117-
a :class:`~GridSearchCV` (parallelized with joblib) with ``n_jobs=8`` over
118-
a :class:`~HistGradientBoostingClassifier` (parallelized with OpenMP). Each
119-
instance of :class:`~HistGradientBoostingClassifier` will spawn 8 threads
117+
a :class:`~sklearn.model_selection.GridSearchCV` (parallelized with joblib)
118+
with ``n_jobs=8`` over a
119+
:class:`~sklearn.ensemble.HistGradientBoostingClassifier` (parallelized with
120+
OpenMP). Each instance of
121+
:class:`~sklearn.ensemble.HistGradientBoostingClassifier` will spawn 8 threads
120122
(since you have 8 CPUs). That's a total of ``8 * 8 = 64`` threads, which
121123
leads to oversubscription of physical CPU resources and to scheduling
122124
overhead.
@@ -129,9 +131,10 @@ is the default), joblib will tell its child **processes** to limit the
129131
number of threads they can use, so as to avoid oversubscription. In practice
130132
the heuristic that joblib uses is to tell the processes to use ``max_threads
131133
= n_cpus // n_jobs``, via their corresponding environment variable. Back to
132-
our example from above, since the joblib backend of :class:`~GridSearchCV`
133-
is ``loky``, each process will only be able to use 1 thread instead of 8,
134-
thus mitigating the oversubscription issue.
134+
our example from above, since the joblib backend of
135+
:class:`~sklearn.model_selection.GridSearchCV` is ``loky``, each process will
136+
only be able to use 1 thread instead of 8, thus mitigating the
137+
oversubscription issue.
135138

136139
Note that:
137140

0 commit comments

Comments
 (0)
0