Skip to content

Fix bugs in CUB#2636

Merged
take-cheeze merged 4 commits intocupy:masterfrom
leofang:cub_bug_fix
Nov 18, 2019
Merged

Fix bugs in CUB#2636
take-cheeze merged 4 commits intocupy:masterfrom
leofang:cub_bug_fix

Conversation

@leofang
Copy link
Copy Markdown
Member

@leofang leofang commented Nov 13, 2019

UPDATE: closes #2634.

cc: @grlee77 @anaruse @kmaehashi

@leofang leofang changed the title [WIP] Fix bugs in CUB Fix bugs in CUB Nov 13, 2019
@leofang leofang marked this pull request as ready for review November 13, 2019 17:39
@leofang
Copy link
Copy Markdown
Member Author

leofang commented Nov 13, 2019

@grlee77, if you have time, could you confirm that this PR resolves all of the bugs you found? Thanks!

@leofang
Copy link
Copy Markdown
Member Author

leofang commented Nov 13, 2019

Note: as a bug fix that involves minimal code changes (at the Cython level), this PR meets the original intention for supporting C-contiguous arrays. However, with proper reduction axes (or axis=None) F-contiguous arrays can also use CUB. I will address this in the next PR.

@grlee77
Copy link
Copy Markdown
Member

grlee77 commented Nov 14, 2019

I can confirm the c-contiguity fix works. I haven't tested the others yet

@grlee77
Copy link
Copy Markdown
Member

grlee77 commented Nov 14, 2019

I can confirm that all of the previously failing cases from #2634 pass with these changes. Thanks for the quick fix @leofang!

@grlee77
Copy link
Copy Markdown
Member

grlee77 commented Nov 14, 2019

Not related to the test failures, but I think there is still a "bug" in terms of not using cub for some compatible axis combinations in _routines_statistics.pyx. This one is just a performance loss for cases where the user has specified the axis

specifically the two places with:

if axis is None and cub.can_use_device_reduce(

should just be

if cub.can_use_device_reduce(

can_use_device_reduce will check the axis via _cub_device_reduce_axis_compatible.

Probably worth just fixing that here as well

grlee77 added a commit to grlee77/cupy that referenced this pull request Nov 14, 2019
@leofang
Copy link
Copy Markdown
Member Author

leofang commented Nov 14, 2019

Good catch, @grlee77! That was a residual from the segmented reduce experiment. I just stole your commit and corrected it 🤣

@take-cheeze
Copy link
Copy Markdown
Member

Jenkins, test this please!

Copy link
Copy Markdown
Member

@take-cheeze take-cheeze left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@take-cheeze
Copy link
Copy Markdown
Member

Jenkins, test this please!

@chainer-ci
Copy link
Copy Markdown
Member

Jenkins CI test (for commit 291b2a3, target branch master) succeeded!

@take-cheeze take-cheeze merged commit ce200de into cupy:master Nov 18, 2019
@leofang leofang deleted the cub_bug_fix branch November 18, 2019 15:28
@leofang
Copy link
Copy Markdown
Member Author

leofang commented Nov 18, 2019

Thank you @grlee77 for finding those bugs and testing this fix and @take-cheeze for review!

@leofang
Copy link
Copy Markdown
Member Author

leofang commented Nov 19, 2019

@take-cheeze I suppose this PR can be tagged with v7.0.0?

@take-cheeze take-cheeze added this to the v7.0.0 milestone Nov 20, 2019
@take-cheeze
Copy link
Copy Markdown
Member

@leofang Thank you for noticing. Should be added now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CUB-related test failures

5 participants