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

Fix HashBuild unspilling stuck #8715

Closed
wants to merge 1 commit into from

Conversation

Yuhta
Copy link
Contributor

@Yuhta Yuhta commented Feb 9, 2024

Summary:
When the input of HashBuild is from spilling, they all come from the
same partition. That means the spill partition bits are all same for the hashes
from these rows. In case the hash table is large, there could be overlap between the hash bits
we use to calculate bucket index and the bits for spill partitioning. These
bits are fixed for all rows and because they are higher bits, we end up
restricting ourselves to a smaller region of the hash table. This results in
heavy hash collision and the hash build will take super long time and block
driver threads.

Fix this by adding a check to make sure that there will be no overlap between
the spill partitioning bits and the bits used for bucket indexing, and increase
the default spill start partition bit to 48.

Differential Revision: D53589502

Copy link

netlify bot commented Feb 9, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 314f24c
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/65c68e4cebf12c00086d2418

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 9, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D53589502

@aditi-pandit
Copy link
Collaborator

@Yuhta : Thanks for this fix. We noticed this slowdown internally as well. Will retry. Appreciate it.
@mbasmanova

Yuhta added a commit to Yuhta/velox that referenced this pull request Feb 9, 2024
Summary:

When the input of `HashBuild` is from spilling, they all come from the
same partition.  That means the spill partition bits are all same for the hashes
from these rows.  In case the hash table is large, there could be overlap between the hash bits
we use to calculate bucket index and the bits for spill partitioning.  These
bits are fixed for all rows and because they are higher bits, we end up
restricting ourselves to a smaller region of the hash table.  This results in
heavy hash collision and the hash build will take super long time and block
driver threads.

Fix this by adding a check to make sure that there will be no overlap between
the spill partitioning bits and the bits used for bucket indexing, and increase
the default spill start partition bit to 48.

Reviewed By: oerling

Differential Revision: D53589502
Summary:

When the input of `HashBuild` is from spilling, they all come from the
same partition.  That means the spill partition bits are all same for the hashes
from these rows.  In case the hash table is large, there could be overlap between the hash bits
we use to calculate bucket index and the bits for spill partitioning.  These
bits are fixed for all rows and because they are higher bits, we end up
restricting ourselves to a smaller region of the hash table.  This results in
heavy hash collision and the hash build will take super long time and block
driver threads.

Fix this by adding a check to make sure that there will be no overlap between
the spill partitioning bits and the bits used for bucket indexing, and increase
the default spill start partition bit to 48.

Reviewed By: oerling

Differential Revision: D53589502
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D53589502

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D53589502

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 9cf0ef0.

Copy link

Conbench analyzed the 1 benchmark run on commit 9cf0ef0f.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

FelixYBW pushed a commit to FelixYBW/velox that referenced this pull request Feb 12, 2024
Summary:
Pull Request resolved: facebookincubator#8715

When the input of `HashBuild` is from spilling, they all come from the
same partition.  That means the spill partition bits are all same for the hashes
from these rows.  In case the hash table is large, there could be overlap between the hash bits
we use to calculate bucket index and the bits for spill partitioning.  These
bits are fixed for all rows and because they are higher bits, we end up
restricting ourselves to a smaller region of the hash table.  This results in
heavy hash collision and the hash build will take super long time and block
driver threads.

Fix this by adding a check to make sure that there will be no overlap between
the spill partitioning bits and the bits used for bucket indexing, and increase
the default spill start partition bit to 48.

Reviewed By: oerling

Differential Revision: D53589502

fbshipit-source-id: 969fe24f09a04ea3abaa4ff750de4541e438d988
FelixYBW pushed a commit to FelixYBW/velox that referenced this pull request Feb 12, 2024
Summary:
Pull Request resolved: facebookincubator#8715

When the input of `HashBuild` is from spilling, they all come from the
same partition.  That means the spill partition bits are all same for the hashes
from these rows.  In case the hash table is large, there could be overlap between the hash bits
we use to calculate bucket index and the bits for spill partitioning.  These
bits are fixed for all rows and because they are higher bits, we end up
restricting ourselves to a smaller region of the hash table.  This results in
heavy hash collision and the hash build will take super long time and block
driver threads.

Fix this by adding a check to make sure that there will be no overlap between
the spill partitioning bits and the bits used for bucket indexing, and increase
the default spill start partition bit to 48.

Reviewed By: oerling

Differential Revision: D53589502

fbshipit-source-id: 969fe24f09a04ea3abaa4ff750de4541e438d988
FelixYBW pushed a commit to FelixYBW/velox that referenced this pull request Feb 12, 2024
Summary:
Pull Request resolved: facebookincubator#8715

When the input of `HashBuild` is from spilling, they all come from the
same partition.  That means the spill partition bits are all same for the hashes
from these rows.  In case the hash table is large, there could be overlap between the hash bits
we use to calculate bucket index and the bits for spill partitioning.  These
bits are fixed for all rows and because they are higher bits, we end up
restricting ourselves to a smaller region of the hash table.  This results in
heavy hash collision and the hash build will take super long time and block
driver threads.

Fix this by adding a check to make sure that there will be no overlap between
the spill partitioning bits and the bits used for bucket indexing, and increase
the default spill start partition bit to 48.

Reviewed By: oerling

Differential Revision: D53589502

fbshipit-source-id: 969fe24f09a04ea3abaa4ff750de4541e438d988
facebook-github-bot pushed a commit that referenced this pull request May 7, 2024
Summary:
#8715 made a modification to the hash tag in the hash value. The hash tag was changed from (32,38] to (38,44]. We should also update the documentation of the hash table to reflect this change.

Pull Request resolved: #9699

Reviewed By: xiaoxmeng

Differential Revision: D57072452

Pulled By: bikramSingh91

fbshipit-source-id: 4048ee5e536ca90d7145efad59f85cc5c33d1d0f
Joe-Abraham pushed a commit to Joe-Abraham/velox that referenced this pull request May 8, 2024
…9699)

Summary:
facebookincubator#8715 made a modification to the hash tag in the hash value. The hash tag was changed from (32,38] to (38,44]. We should also update the documentation of the hash table to reflect this change.

Pull Request resolved: facebookincubator#9699

Reviewed By: xiaoxmeng

Differential Revision: D57072452

Pulled By: bikramSingh91

fbshipit-source-id: 4048ee5e536ca90d7145efad59f85cc5c33d1d0f
Joe-Abraham pushed a commit to Joe-Abraham/velox that referenced this pull request Jun 7, 2024
…9699)

Summary:
facebookincubator#8715 made a modification to the hash tag in the hash value. The hash tag was changed from (32,38] to (38,44]. We should also update the documentation of the hash table to reflect this change.

Pull Request resolved: facebookincubator#9699

Reviewed By: xiaoxmeng

Differential Revision: D57072452

Pulled By: bikramSingh91

fbshipit-source-id: 4048ee5e536ca90d7145efad59f85cc5c33d1d0f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants