Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add joblib backend - #122

Merged
minrk merged 8 commits into
ipython:masterfrom
minrk:joblib-backend
Mar 22, 2016
Merged

Add joblib backend#122
minrk merged 8 commits into
ipython:masterfrom
minrk:joblib-backend

Conversation

@minrk

@minrk minrk commented Mar 15, 2016

Copy link
Copy Markdown
Member

In joblib/joblib#306, joblib adds support for custom backends.

This provides such a backend from a LoadBalancedView.

Simplest version using all the defaults:

import ipyparallel.backend

Or registering an existing View:

view.register_joblib_backend([name])

minrk added 4 commits March 15, 2016 11:45
Default:

    import ipyparallel.backend

Specific View:

    view.register_joblib_backend()
@minrk minrk added this to the 5.1 milestone Mar 15, 2016
Comment thread ipyparallel/client/_joblib.py Outdated
In general working on larger data chunks is more efficient (less
scheduling overhead and better use of CPU cache prefetching heuristics)
as long as all the workers have enough work to do.
"""

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.

Big monobloc docstring. Did you forgot aa white line ?

Doesn't seem bad if you want to keep it as is though. Just wondering.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the upstream docstring unmodified.

@Carreau

Carreau commented Mar 15, 2016

Copy link
Copy Markdown
Member

Minor comment/questions, +1 regardless of answers .

Comment thread ipyparallel/joblib.py Outdated
return register_parallel_backend(name, IPythonParallelBackend, make_default=make_default)

# importing ipyparallel.joblib sets up the default `ipyparallel` backend
register()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Personally I don't like imports with implicit side effects. I would rather document the following idiom:

from ipyparallel.joblib import register; register()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Declaring a backend as available doesn't instantiate anything, does it? Is there a downside to joblib knowing about ipyparallel?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But the user has to import that module explicitly to register the backend no? My point is that instead of asking the user to do:

from joblib import Parallel, delayed, parallel_backend
import ipyparallel.joblib  # registered the ipyrallel joblib backend implicitly

with parallel_backend('ipyparallel'):
    Parallel(n_jobs=4)(delayed(func)(task) in tasks)

do the backend registration explicitly

from joblib import Parallel, delayed, parallel_backend
from ipyparallel.joblib import register; register()

with parallel_backend('ipyparallel'):
    Parallel(n_jobs=4)(delayed(func)(task) in tasks)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fair enough. Moved to ipp.register_joblib_backend()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

removes implicit register on `ipyparallel.joblib`
since it changes the behavior of other tests

will open a new PR adding `use_pickle` method
minrk added a commit that referenced this pull request Mar 22, 2016
@minrk
minrk merged commit a869ddc into ipython:master Mar 22, 2016
@minrk
minrk deleted the joblib-backend branch March 22, 2016 13:46
@minrk

minrk commented Mar 22, 2016

Copy link
Copy Markdown
Member Author

Thanks, @Carreau, @ogrisel!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants