Skip to content

Fix blockwise concatenate for array with some dimension=1.#6342

Merged
TomAugspurger merged 1 commit intodask:masterfrom
Carreau:blockwise
Jul 6, 2020
Merged

Fix blockwise concatenate for array with some dimension=1.#6342
TomAugspurger merged 1 commit intodask:masterfrom
Carreau:blockwise

Conversation

@Carreau
Copy link
Contributor

@Carreau Carreau commented Jun 23, 2020

This is an attempt at trying to understand and fix issue #6340,
this part of the codebase is relatively complex, so it is likely that
the fix is incorrect/incomplete.

Right now when we look at whether chunks should be concatenated. If so
we avoid generating the extra dummy [0] which are of help with
broadcasting as otherwise multiple copies of the arrays would be
concatenated.

  • Tests added / passed
  • Passes black dask / flake8 dask

assert set(numblocks) == block_names

dummy_indices = all_indices - set(out_indices)
dummy_indices = sorted(all_indices - set(out_indices))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to make the internal deterministic, and was helpful for debugging, as later iteration/enumeration were changing order on each re-run.

Copy link
Member

Choose a reason for hiding this comment

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

Just to be conservative, can you revert this? I don't know what the performance costs of this are for large graphs, and I don't trust our benchmarks to pick them up.

@Carreau
Copy link
Contributor Author

Carreau commented Jun 23, 2020

there are a few whiteline changes the pre commit hooks does. Not sure why, new version of black ?

assert_eq(z, x)


def test_blockwise_1_in_shape_I():
Copy link
Member

Choose a reason for hiding this comment

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

@mrocklin can you confirm that these tests look correct to you? I still struggle with the blockwise syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can also try to be clearer and in test_f make sure that the shape of a and b are compatible and can be broadcasted together.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the delay here. I probably won't get to this until this weekend.

Copy link
Member

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

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

@Carreau sorry for the delay. I'm going to trust that this doesn't break anything since our tests pass. If you could make the one requested change I'll get this merged.

assert set(numblocks) == block_names

dummy_indices = all_indices - set(out_indices)
dummy_indices = sorted(all_indices - set(out_indices))
Copy link
Member

Choose a reason for hiding this comment

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

Just to be conservative, can you revert this? I don't know what the performance costs of this are for large graphs, and I don't trust our benchmarks to pick them up.

This is an attempt at trying to understand and fix issue dask#6340,
this part of the codebase is relatively complex, so it is likely that
the fix is incorrect/incomplete.

Right now when we look at whether chunks should be concatenated. If so
we avoid generating the extra dummy [0] which are of help with
broadcasting as otherwise multiple copies of the arrays would be
concatenated.
@Carreau
Copy link
Contributor Author

Carreau commented Jul 6, 2020

@Carreau sorry for the delay. I'm going to trust that this doesn't break anything since our tests pass. If you could make the one requested change I'll get this merged.

No problem, sorted(...) reverted.

@TomAugspurger
Copy link
Member

TravisCI finished, just didn't report back. Thanks @Carreau!

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