Skip to content
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

unsnap: busy wait a number of cycles #8073

Merged
merged 4 commits into from
Apr 28, 2021

Conversation

vuule
Copy link
Contributor

@vuule vuule commented Apr 27, 2021

Busy replacement for nanosleep.

@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Apr 27, 2021
@codecov
Copy link

codecov bot commented Apr 27, 2021

Codecov Report

Merging #8073 (6ea88b0) into branch-0.19 (bbeb2aa) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##           branch-0.19    #8073   +/-   ##
============================================
  Coverage        82.74%   82.74%           
============================================
  Files              103      103           
  Lines            17702    17702           
============================================
  Hits             14648    14648           
  Misses            3054     3054           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bbeb2aa...6ea88b0. Read the comment docs.

Copy link
Member

@harrism harrism left a comment

Choose a reason for hiding this comment

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

Minor suggestions. Otherwise looks fine.

@@ -280,7 +291,7 @@ __device__ void snappy_decode_symbols(unsnap_state_s *s, uint32_t t)
if (t == 0) {
s->q.prefetch_rdpos = cur;
#pragma unroll(1) // We don't want unrolling here
while (s->q.prefetch_wrpos < min(cur + 5 * batch_size, end)) {}
while (s->q.prefetch_wrpos < min(cur + 5 * batch_size, end)) { busy_wait(10); }
Copy link
Member

Choose a reason for hiding this comment

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

Why 10 in some places and 20 in others?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original times in nanoseconds were 50 or 100. I noticed a significant perf regression when using the same number of cycles (compared to no waits). Divided all wait cycles by 5 and got great perf results. Went with this to make the PR available for testing ASAP.
In short, the numbers are not carefully chosen, I'm open to suggestions on the values to use here.

@harrism harrism added ! - Hotfix Hotfix is a bug that affects the majority of users for which there is no reasonable workaround bug Something isn't working non-breaking Non-breaking change labels Apr 27, 2021
vuule and others added 2 commits April 27, 2021 15:41
@abellina
Copy link
Contributor

With this change, the hang reported #8055 is not seen anymore. We've tested small batches of queries, and last night triggered a much wider run and didn't see issues. So far so good @vuule.

@vuule vuule marked this pull request as ready for review April 28, 2021 16:50
@vuule vuule requested a review from a team as a code owner April 28, 2021 16:50
@vuule vuule requested review from cwharris and codereport and removed request for a team April 28, 2021 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
! - Hotfix Hotfix is a bug that affects the majority of users for which there is no reasonable workaround bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Removal of nanosleep causes regression in RAPIDS Accelerator for Apache Spark
6 participants