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

Add rehash functionality #380

Merged
merged 14 commits into from
Oct 11, 2023
Merged

Add rehash functionality #380

merged 14 commits into from
Oct 11, 2023

Conversation

sleeepyjack
Copy link
Collaborator

This PR adds the ability to rehash aka resize or regenerate an open addressing container.

Closes #21

@sleeepyjack sleeepyjack added topic: static_map Issue related to the static_map Needs Review Awaiting reviews before merging topic: static_set Issue related to the static_set type: improvement Improvement / enhancement to an existing function labels Oct 6, 2023
@sleeepyjack
Copy link
Collaborator Author

Benchmark Results

static_set_rehash_unique_occupancy

[0] NVIDIA RTX A6000

Key Distribution Occupancy Samples CPU Time Noise GPU Time Noise Elem/s
I32 UNIQUE 0.1 92x 5.502 ms 11.51% 5.497 ms 11.51% 18.192G
I32 UNIQUE 0.2 85x 5.955 ms 7.68% 5.950 ms 7.68% 16.806G
I32 UNIQUE 0.3 72x 7.002 ms 7.35% 6.997 ms 7.35% 14.291G
I32 UNIQUE 0.4 72x 7.015 ms 7.72% 7.010 ms 7.71% 14.265G
I32 UNIQUE 0.5 69x 7.348 ms 0.93% 7.343 ms 0.93% 13.619G
I32 UNIQUE 0.6 58x 8.652 ms 5.26% 8.647 ms 5.26% 11.565G
I32 UNIQUE 0.7 48x 10.496 ms 0.61% 10.491 ms 0.60% 9.532G
I32 UNIQUE 0.8 41x 12.261 ms 4.37% 12.256 ms 4.37% 8.160G
I32 UNIQUE 0.9 31x 16.247 ms 4.28% 16.241 ms 4.28% 6.157G
I64 UNIQUE 0.1 64x 7.864 ms 50.11% 7.858 ms 50.11% 12.726G
I64 UNIQUE 0.2 30x 16.915 ms 82.35% 16.908 ms 82.35% 5.914G
I64 UNIQUE 0.3 30x 17.324 ms 76.86% 17.318 ms 76.86% 5.774G
I64 UNIQUE 0.4 30x 17.535 ms 71.74% 17.529 ms 71.74% 5.705G
I64 UNIQUE 0.5 29x 17.263 ms 73.45% 17.258 ms 73.45% 5.795G
I64 UNIQUE 0.6 28x 18.146 ms 68.96% 18.140 ms 68.96% 5.513G
I64 UNIQUE 0.7 31x 16.364 ms 54.25% 16.358 ms 54.25% 6.113G
I64 UNIQUE 0.8 28x 17.892 ms 44.43% 17.885 ms 44.43% 5.591G
I64 UNIQUE 0.9 27x 18.629 ms 3.34% 18.623 ms 3.34% 5.370G

Elem/s here means traversed slots per second

@sleeepyjack
Copy link
Collaborator Author

Naive kernel without using shared memory for comparison:

Benchmark Results

static_set_rehash_unique_occupancy

[0] NVIDIA RTX A6000

Key Distribution Occupancy Samples CPU Time Noise GPU Time Noise Elem/s
I32 UNIQUE 0.1 65x 7.709 ms 6.71% 7.703 ms 6.71% 12.981G
I32 UNIQUE 0.2 55x 9.106 ms 5.53% 9.101 ms 5.53% 10.988G
I32 UNIQUE 0.3 53x 9.490 ms 5.99% 9.485 ms 5.99% 10.543G
I32 UNIQUE 0.4 52x 9.696 ms 0.15% 9.691 ms 0.13% 10.319G
I32 UNIQUE 0.5 50x 10.009 ms 5.06% 10.003 ms 5.06% 9.997G
I32 UNIQUE 0.6 47x 10.761 ms 4.76% 10.756 ms 4.76% 9.297G
I32 UNIQUE 0.7 43x 11.802 ms 4.29% 11.797 ms 4.29% 8.477G
I32 UNIQUE 0.8 39x 12.876 ms 4.08% 12.871 ms 4.08% 7.769G
I32 UNIQUE 0.9 32x 15.815 ms 3.45% 15.810 ms 3.45% 6.325G
I64 UNIQUE 0.1 53x 9.467 ms 2.33% 9.461 ms 2.33% 10.570G
I64 UNIQUE 0.2 48x 10.503 ms 1.95% 10.498 ms 1.95% 9.526G
I64 UNIQUE 0.3 42x 12.070 ms 41.15% 12.065 ms 41.15% 8.289G
I64 UNIQUE 0.4 28x 18.455 ms 66.72% 18.449 ms 66.72% 5.420G
I64 UNIQUE 0.5 29x 17.632 ms 62.12% 17.627 ms 62.12% 5.673G
I64 UNIQUE 0.6 29x 17.596 ms 54.95% 17.591 ms 54.95% 5.685G
I64 UNIQUE 0.7 29x 17.564 ms 47.58% 17.558 ms 47.58% 5.695G
I64 UNIQUE 0.8 30x 17.153 ms 33.35% 17.147 ms 33.35% 5.832G
I64 UNIQUE 0.9 26x 19.344 ms 4.42% 19.337 ms 4.42% 5.171G

@sleeepyjack sleeepyjack self-assigned this Oct 7, 2023
Copy link
Member

@PointKernel PointKernel left a comment

Choose a reason for hiding this comment

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

First pass

include/cuco/detail/common_kernels.cuh Outdated Show resolved Hide resolved

/**
* @brief Rebuilds the container.
*
Copy link
Member

Choose a reason for hiding this comment

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

docs explaining the difference between two overloads of rehash/rehash_async

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in dcb0536 (I think)

@sleeepyjack
Copy link
Collaborator Author

Cmooon GHA
image

include/cuco/static_map.cuh Outdated Show resolved Hide resolved
include/cuco/static_map.cuh Show resolved Hide resolved
@PointKernel PointKernel added type: feature request New feature request and removed type: improvement Improvement / enhancement to an existing function labels Oct 10, 2023
Copy link
Member

@PointKernel PointKernel left a comment

Choose a reason for hiding this comment

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

Good to go after resolving conflicts.

@sleeepyjack sleeepyjack merged commit 72ca959 into NVIDIA:dev Oct 11, 2023
10 checks passed
@sleeepyjack sleeepyjack deleted the rehash branch October 11, 2023 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review Awaiting reviews before merging topic: static_map Issue related to the static_map topic: static_set Issue related to the static_set type: feature request New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] static_map::rehash
2 participants