Skip to content

Include "region" in key names for da.store - #3540

Merged
jakirkham merged 3 commits into
dask:masterfrom
martindurant:store_key_name
Jun 7, 2018
Merged

jakirkham merged 3 commits into
dask:masterfrom
martindurant:store_key_name

Conversation

@martindurant

@martindurant martindurant commented May 29, 2018 •

Copy link
Copy Markdown
Member
  • Tests added / passed
  • Passes flake8 dask

@martindurant

Copy link
Copy Markdown
Member Author

Note that you would still get the same key if you stored data into two different stores, but we can't rightly hash those stores, since, by their nature, they may be massive and/or remote.

Comment thread dask/array/core.py Outdated
slices = [fuse_slice(region, slc) for slc in slices]

name = 'store-%s' % arr.name
name = 'store-%s' % arr.name + tokenize(region)

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.

In other operations we tend to include the input in tokenize rather than extend the name. Otherwise names can grow fairly long.

@mrocklin

Copy link
Copy Markdown
Member

cc @jakirkham for review

@jakirkham

Copy link
Copy Markdown
Member

Thanks @martindurant. Agree this should be fixed.

Think we should consider using a UUID instead as there have been some issues like this one ( #2837 ) where storage doesn't occur if the same Dask Array is written to multiple locations.

Allows storing of data into many targets without clash
@martindurant

Copy link
Copy Markdown
Member Author

@jakirkham , like so?

Comment thread dask/array/core.py
insert_to_ooc(s, t, lock, r, return_stored, load_stored)
for s, t, r in zip(sources2, targets2, regions)
insert_to_ooc(s, t, lock, r, return_stored, load_stored, tok)
for s, t, r, tok in zip(sources2, targets2, regions, toks)

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.

Would it be possible for us to pick up the names used to store these objects instead of hanging onto the UUIDs used to generate them? Admittedly the syntax I've added here makes that a bit hard. Feel free to change this or the insert_to_ooc function as needed.

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.

I don't think so, not easily - the input array name is not useful, because we want to store to multiple outputs, and the outputs don't have names and at best would be hashed. I think uuid is good, and ensures that the write happens even when repeating the identical operation - that seems like the right thing to do to me for something that is essentially a side-effect operation.

@jakirkham

Copy link
Copy Markdown
Member

Thanks @martindurant. Yes the gist is good.

Would say how the UUIDs are being managed currently is a bit convoluted, but this almost certainly my fault because of how the code is structured here currently. Feel free to change things around as needed to get the right behavior from this.

@martindurant

Copy link
Copy Markdown
Member Author

@jakirkham , do you think that this can be considered ready as-is? I don't have much appetite to unravel the graph making.

@jakirkham

Copy link
Copy Markdown
Member

Yeah, I think that is reasonable.

The bugs it fixes are pretty important. The issue noted above is pretty minor and is internal to Dask. We can revisit it later.

Thanks @martindurant. :)

@jakirkham
jakirkham merged commit d45d468 into dask:master Jun 7, 2018
@martindurant

Copy link
Copy Markdown
Member Author

Cool.

@martindurant
martindurant deleted the store_key_name branch June 7, 2018 14:47
convexset added a commit to convexset/dask that referenced this pull request Jun 12, 2018
* master:
  [array.linalg.qr] added sfqr (short-and-fat) as a counterpart to tsqr… (dask#3575)
  Drop Dask Array's `learn` module (dask#3580)
  Adds `isneginf` and `isposinf` (dask#3581)
  Update sizeof definitions (dask#3582)
  BUG: do not raise IndexError for identity slice in array.vindex (dask#3559)
  Correct internal dimension of Dask's SVD (dask#3517)
  Fix check in configuration with env=None (dask#3562)
  Dataframe sample method docstring fix (dask#3566)
  Include "region" in key names for da.store (dask#3540)

# Conflicts:
#	dask/array/linalg.py
#	dask/array/tests/test_linalg.py
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