Skip to content

Replace dill with cloudpickle #847

Closed

Description

@mrocklin

Should we make this switch? Cloudpickle handles a few pragmatic cases that dill does not, notably closures that include globals, e.g.

>>> import numpy as np
>>> def f(x):
...     return np.sin(x) + np.cos(x)   # closed over np, a global

This can be switched with the experimental dill.settings['recurse'] = True setting, but I've found that this causes some very strange behavior (functions like int are sometimes lost.)

I've switched to cloudpickle in distributed and have so far been satisfied with the change.

Activity

  1. eribean commented on Nov 25, 2015

    @eribean

    This is beneficial for my projects, Im in favor of this change.

  2. PedroMDuarte commented on Dec 4, 2015

    @PedroMDuarte
    Contributor

    @mrocklin I started out by adding a test for something like the example you gave above:

    https://github.com/PedroMDuarte/dask/compare/fd5a8b88433b...e3ffdea46ce9

    That test ran successfully in Travis (https://travis-ci.org/PedroMDuarte/dask/builds/94812034).

    Is there perhaps another way to expose the undesired behavior in dill? Or maybe is the preference for cloudpickle based on performance but not functionality?

    @eribean Could you elaborate on a case where you would prefer cloudpickle rather than dill?

  3. mrocklin commented on Dec 4, 2015

    @mrocklin
    MemberAuthor

    This will only happen when using dask interactively.

  4. mrocklin commented on Dec 4, 2015

    @mrocklin
    MemberAuthor

    This commit from the distributed project might be helpful. dask/distributed@6dc1f3f

  5. cowlicks commented on Dec 4, 2015

    @cowlicks
    Member

    A user can still change the default serialization with dask.set_options right?

  6. mrocklin commented on Dec 4, 2015

    @mrocklin
    MemberAuthor

    Yes

  7. mrocklin commented on Jan 5, 2016

    @mrocklin
    MemberAuthor

    This happened. Closing

  8. added this to the 0.7.6 milestone on Jan 7, 2016
  9. added a commit that references this issue on Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions