Skip to content

Keep chunksize consistent in reshape - #11273

Merged
phofl merged 18 commits into
dask:mainfrom
phofl:reshape-chunksize
Aug 12, 2024
Merged

phofl merged 18 commits into
dask:mainfrom
phofl:reshape-chunksize

Conversation

@phofl

@phofl phofl commented Aug 5, 2024 •

Copy link
Copy Markdown
Collaborator

cc @dcherian

@phofl phofl changed the title Automatically resize in reshape Keep chunksize consistent in reshape Aug 5, 2024
@github-actions

github-actions Bot commented Aug 5, 2024 •

Copy link
Copy Markdown
Contributor

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

     13 files  ±  0       13 suites  ±0   3h 1m 57s ⏱️ + 8m 21s
 13 147 tests + 16   12 078 ✅ + 15   1 068 💤 ±0  1 ❌ +1 
137 000 runs  +173  117 935 ✅ +172  19 064 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 19eb9ad. ± Comparison against base commit ed5f688.

♻️ This comment has been updated with latest results.

@hendrikmakait
hendrikmakait self-requested a review August 5, 2024 15:50
@dcherian

dcherian commented Aug 7, 2024 •

Copy link
Copy Markdown
Collaborator

Xref #7859 and #10603

@phofl

phofl commented Aug 7, 2024 •

Copy link
Copy Markdown
Collaborator Author

Oh yeah 10603 is fixed now, added this as a test. The other one is probably already fixed for a while now

@phofl phofl mentioned this pull request Aug 8, 2024
3 tasks
phofl added 2 commits August 8, 2024 13:15
…e-chunksize

# Conflicts:
#	dask/array/tests/test_array_core.py
…e-chunksize

# Conflicts:
#	dask/array/tests/test_array_core.py
Comment thread dask/array/reshape.py Resolved
@phofl

phofl commented Aug 8, 2024

Copy link
Copy Markdown
Collaborator Author

cc @hendrikmakait

Comment thread dask/array/tests/test_xarray.py Resolved
Comment thread dask/array/reshape.py Resolved
Comment thread dask/array/reshape.py
Comment on lines +135 to +137
# It's important to ensure that all dimensions before the dimension
# we adjust have to have all-1 chunks to respect C contiguous arrays
# during the reshaping

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.

Honestly, I'm not sure I'm following.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I added an example of the negative case

Comment thread dask/array/reshape.py Outdated
Comment on lines +154 to +155
# This is a trivial case, when we arrive here is the chunk we are
# splitting of length 1 and all previous chunks that are reshaped

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.

How can we split a chunk of length 1?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

bad wording, we only have one chunk along this dimension is what I wanted to say , i.e. if this dimension has length 100 then our chunk size on this dimension is 100 as well. I'll update the docstring

),
]
result_in = _smooth_chunks(ileft, ii, 6, result_inchunks)
expected_in = [(1, 1, 1, 2, 1, 1, 1, 2), (6,), (3, 3)]

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.

Wouldn't we expect dim 0 to be split into all ones?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

thx for catching this, not sure why I thought this was ok. I hard-coded splitting these chunks by a factor of 2 at most, It's fixed now

@hendrikmakait hendrikmakait left a comment

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.

Thanks, @phofl! I have a few nits regarding the documentation, but these are non-blocking. The comments are very much appreciated!

Comment thread dask/array/reshape.py Resolved
Comment thread dask/array/reshape.py Resolved
Comment thread dask/array/reshape.py Resolved
Comment thread dask/array/reshape.py Resolved
Comment thread dask/array/reshape.py Resolved
phofl and others added 4 commits August 12, 2024 19:03
Co-authored-by: Hendrik Makait <[email protected]>
Co-authored-by: Hendrik Makait <[email protected]>
Co-authored-by: Hendrik Makait <[email protected]>
Co-authored-by: Hendrik Makait <[email protected]>
Comment thread dask/array/reshape.py Resolved
@phofl
phofl merged commit 33f07ec into dask:main Aug 12, 2024
@phofl
phofl deleted the reshape-chunksize branch August 12, 2024 18:13
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.

Bug with automatic rechunking on reshape chunks get combined in 4d array reshape

3 participants