You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also IMO this discussion should be not be about whether it's possible to parallelize transformers, but rather about whether it's possible to make transformers faster by using parallelization.
For instance, it we take the CountVectorizer example from #7635 (comment)
on the 20 newsgoup dataset using a 4 core CPU, we get,
fit time -> 3.39 s
transform time -> 3.1 s
transform_parallel(.. , n_jobs=4) time -> 11.7 s
so in this case we can parallelize but we definitely don't want to. At least not in this way, there was some prior discussion about parallelizing this estimator in #1401.
In this example there is no speedup with the threading backend probably because CountVectorizer doesn't release the GIL and we get some chunking / concatenation overhead.
Generally dask-ml is a better suited to deal with such parallelization tasks. For instance, I think, dask_ml.wrappers.ParallelPostFit solves this issue. Closing, please comment if you disagree.
Activity
jnothman commentedon Oct 10, 2016
It would need to override
__init__andget_params, but maybe...themrmax commentedon Oct 11, 2016
@jnothman hmm get params looks pretty gnarly ... sure we can't just leave
n_jobsas an argument totransform?jnothman commentedon Oct 11, 2016
Ideally not...
amueller commentedon Oct 13, 2016
This is very closely related to #7448 which proposed the same for
predict.I'm not sure how this would work as a mixin. Would all transformers get it? Then it should be in
TransformerMixin, right?This wouldn't work in pipelines, unless we add this to pipelines...
Why not do it as a meta-estimator? That way we don't have to mess with
Pipeline.mblondel commentedon Oct 18, 2016
Only transformers where
fitdoesn't do anything besides input checking (i.e., stateless transformers).themrmax commentedon Oct 18, 2016
@mblondel i think it should work with stateful transformers too
sukiakiumo commentedon Jun 15, 2018
I'm curious about this myself. Would love to see it happen! Any efforts towards doing so? Or is this issue stale?
jnothman commentedon Jun 15, 2018
rth commentedon Jun 15, 2018
Also IMO this discussion should be not be about whether it's possible to parallelize transformers, but rather about whether it's possible to make transformers faster by using parallelization.
For instance, it we take the
CountVectorizerexample from #7635 (comment)on the 20 newsgoup dataset using a 4 core CPU, we get,
so in this case we can parallelize but we definitely don't want to. At least not in this way, there was some prior discussion about parallelizing this estimator in #1401.
In this example there is no speedup with the threading backend probably because CountVectorizer doesn't release the GIL and we get some chunking / concatenation overhead.
Generally dask-ml is a better suited to deal with such parallelization tasks. For instance, I think,
dask_ml.wrappers.ParallelPostFitsolves this issue. Closing, please comment if you disagree.