Skip to content

Fix race detected in Parquet writer - #14598

Merged
rapids-bot[bot] merged 4 commits into
NVIDIA:branch-24.02from
etseidl:block_reduce_sync
Dec 9, 2023
Merged

rapids-bot[bot] merged 4 commits into
NVIDIA:branch-24.02from
etseidl:block_reduce_sync

Conversation

@etseidl

@etseidl etseidl commented Dec 8, 2023

Copy link
Copy Markdown
Contributor

Description

While investigating #14597 it was found that there was a race introduced by #14000. Adding a sync between invocations of a block reduce resolves the error.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@etseidl
etseidl requested a review from a team as a code owner December 8, 2023 17:59
@etseidl
etseidl requested review from nvdbaranec and vyasr December 8, 2023 18:00
@copy-pr-bot

copy-pr-bot Bot commented Dec 8, 2023

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the libcudf Affects libcudf (C++/CUDA) code. label Dec 8, 2023
@davidwendt davidwendt added bug Something isn't working 3 - Ready for Review Ready for review by team cuIO cuIO issue non-breaking Non-breaking change labels Dec 8, 2023
@davidwendt

Copy link
Copy Markdown
Contributor

/ok to test

@PointKernel PointKernel 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.

LGTM

__syncthreads();
auto const total_len = block_reduce(reduce_storage).Sum(len);
auto const total_len = block_reduce(reduce_storage).Sum(len);
__syncthreads();

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.

Right, I hesitated to bring this up since the CI didn't complain. Generally, a sync in-between is required when the same temp storage is used for different reductions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was worried too, but dug into the Sum code and saw that there were syncthreads inside and convinced myself it was ok :(

Comment on lines 208 to +210
__syncthreads();
auto const total_len = block_reduce(reduce_storage).Sum(len);
auto const total_len = block_reduce(reduce_storage).Sum(len);
__syncthreads();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So we really need two sync like this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

perhaps the first one is unecessary, but now I'm scared to change it 😬

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hm, maybe we should remove it if racecheck does not complain

@etseidl etseidl Dec 8, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll try removing it and see...

Yep, no racecheck problems (beyond the nvcomp and decode ones) without the first sync.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is racecheck?

@vuule vuule Dec 8, 2023 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll try removing it and see

trying this on my end as well

What is racecheck?

racecheck tool in compute-sanitizer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

remove?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no racecheck errors, and, looking at the code, no shared data is modified before the reductions. IMHO we should be good to remove the first sync.

@vuule vuule left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for looking into this issue promptly!
Hopefully that's the last of the ManyFragments failures.

@PointKernel

Copy link
Copy Markdown
Member

/ok to test

@shwina shwina mentioned this pull request Dec 8, 2023
3 tasks done
@vuule

vuule commented Dec 9, 2023

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit 899e392 into NVIDIA:branch-24.02 Dec 9, 2023
@etseidl
etseidl deleted the block_reduce_sync branch December 9, 2023 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Ready for Review Ready for review by team bug Something isn't working cuIO cuIO issue libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants