-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix and reenable optimized Cast kernel #3976
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The bug in binsearch Cast kernel manifested on empty samples - there was mismatch between sample that was assigned to a given block and the block that was assumed by the kernel due to BlockDescriptos not being generated for samples with 0 volume. Now, the empty samples are skipped at the end of the batch and when assigning the lowest blockIdx to a given sample. The binsearch looks for the rightmost sample when searching the descriptors. Test was adjusted to not generate empty samples and another was added to randomly make selected ranges of samples empty. The speedup compared to the old implementation is between 10% and 25%, averaging 16%, depending on the size of the input. Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
!build |
CI MESSAGE: [5045144]: BUILD STARTED |
mzient
reviewed
Jun 8, 2022
start = 0 | ||
end = rng.integers(1, len(input) // 3) | ||
elif empty_volume_policy == "right": | ||
start = rng.integers(1, len(input) * 2 // 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
start = rng.integers(1, len(input) * 2 // 3) | |
start = rng.integers(len(input) * 2 // 3, len(input) - 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mzient
approved these changes
Jun 8, 2022
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
!build |
CI MESSAGE: [5045304]: BUILD STARTED |
CI MESSAGE: [5045304]: BUILD PASSED |
prak-nv
approved these changes
Jun 13, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Category: Bug fix
Description:
The bug in binsearch Cast kernel manifested
on empty samples - there was mismatch between
sample that was assigned to a given block
and the block that was assumed by the kernel
due to BlockDescriptos not being generated
for samples with 0 volume.
Now, the empty samples are skipped at the
end of the batch and when assigning the
lowest blockIdx to a given sample.
The binsearch looks for the rightmost
sample when searching the descriptors.
Test was adjusted to not generate empty samples
and another was added to randomly make
selected ranges of samples empty.
The speedup compared to the old implementation
is between 10% and 25%, averaging 16%, depending
on the size of the input.
Additionally the collapsed shape was reused
for the data volume.
Additional information:
Affected modules and functionalities:
Cast
Key points relevant for the review:
Can I assume that there is at least one non-empty sample?
Should I add a check?
Tests:
and another one was added to do that in controlled manner.
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A