Skip to content

Align auto chunks to provided chunks, rather than shape#3679

Merged
mrocklin merged 1 commit intodask:masterfrom
mrocklin:rechunk-align-to-previous-chunks
Jun 29, 2018
Merged

Align auto chunks to provided chunks, rather than shape#3679
mrocklin merged 1 commit intodask:masterfrom
mrocklin:rechunk-align-to-previous-chunks

Conversation

@mrocklin
Copy link
Member

Previously we used to align "auto" chunks to the shape, even if the old chunks
are not well aligned to the shape. Now we align to the previous chunking if it
was consistent.

Here is an example that would change:

import dask
import dask.array as da

x = da.ones(3000, chunks=512).astype('u1')

with dask.config.set({'array.chunk-size': '1kiB'}):
    y = x.rechunk('auto')

>>> y.chunks            # Previously
((1000, 1000, 1000),)
>>> y.chunks            # New
((1024, 1024, 952),)
  • Tests added / passed
  • Passes flake8 dask

Previously we used to align "auto" chunks to the shape, even if the old chunks
are not well aligned to the shape.  Now we align to the previous chunking if it
was consistent.

Here is an example that would change:

```python
import dask
import dask.array as da

x = da.ones(3000, chunks=512).astype('u1')

with dask.config.set({'array.chunk-size': '1kiB'}):
    y = x.rechunk('auto')

>>> y.chunks            # Previously
((1000, 1000, 1000),)
>>> y.chunks            # New
((1024, 1024, 952),)
```
@mrocklin
Copy link
Member Author

Merging this tomorrow if there are no comments

@mrocklin mrocklin merged commit 4efc484 into dask:master Jun 29, 2018
@mrocklin mrocklin deleted the rechunk-align-to-previous-chunks branch June 29, 2018 12:12
convexset added a commit to convexset/dask that referenced this pull request Jul 1, 2018
….com/convexset/dask into fix-tsqr-case-chunk-with-zero-height

* 'fix-tsqr-case-chunk-with-zero-height' of https://github.com/convexset/dask:
  fixed typo in documentation and improved clarity
  Implement .blocks accessor (dask#3689)
  Fix wrong names (dask#3695)
  Adds endpoint and retstep support for linspace (dask#3675)
  Add the @ operator to the delayed objects (dask#3691)
  Align auto chunks to provided chunks, rather than shape (dask#3679)
  Adds quotes to source pip install (dask#3678)
  Prefer end-tasks with low numbers of dependencies when ordering (dask#3588)
  Reimplement argtopk to release the GIL (dask#3610)
  Note `da.pad` can be used with `map_overlap` (dask#3672)
  Allow tasks back onto ordering stack if they have one dependency (dask#3652)
  Fix extra progressbar (dask#3669)
  Break apart uneven array-of-int slicing to separate chunks (dask#3648)
  fix for `dask.array.linalg.tsqr` fails tests (intermittently) with arrays of uncertain dimensions (dask#3662)
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.

1 participant