[ENHANCEMENT]: `for_each` on containers without duplicates keeps probing after the match
メンテナーはふだん 2 日以内に返信
関連するプルリクエストがすでにマージされています。
- #859 @PointKernel による — マージ済み
評価
調査の方向性
open_addressing_ref_impl のスカラー版および協調版の for_each から始め、equal_result::EQUAL のケースで、そこで allows_duplicates がどのように使われているかを読んでください。提案する変更では、重複を許さないコンテナについてはコールバックの後にプロービングを停止し、multiset と multimap の経路には手を加えません。static_set、static_map、static_multiset、static_multimap のテストを実行してください。テストが通り、ヒットするルックアップが高速化されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
On static_set/static_map, ref.for_each(key, cb) keeps probing after calling cb on the match, up to the next empty slot, although a key is held at most once there (find and contains already stop at the match). Every hit pays for the rest of its cluster:
// static_map<uint64_t, uint64_t> ref with cuco::op::for_each, 64 dependent lookups per thread
for (int i = 0; i < 64; ++i) {
uint64_t next = ~0ull;
ref.for_each(key, [&](auto const& slot) { next = slot.second; });
key = next;
}
RTX 4090, load factor 0.5, 167,936 threads, 2^17 slots: hits take 0.589 ms, 0.226 ms with the change below; misses are unchanged (0.34 ms).
Describe the solution you'd like
End the probe at the match when the container has no duplicates, in the scalar and cooperative for_each of open_addressing_ref_impl:
case detail::equal_result::EQUAL: {
callback_op(bucket_slots[i()]);
+ if constexpr (not allows_duplicates) { should_return = true; } // cooperative: empty = true
The multiset and multimap paths are unchanged. With it the static_set, static_map, static_multiset and static_multimap tests pass (415/415, sm_89).
🤖 Generated with Claude Code
- 主要言語
- Cuda
- スター
- 671
- フォーク
- 122
- 平均マージ
- 4日 19時間
- マージ済み PR(30日)
- 10
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/cuCollections のほかの issue
-
Add cuco::detail::stream_sync(cuda::stream_ref) to centralize CCCL version-specific API naming再び着手できるかも @0z5a が 25 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NVIDIA/cuCollections#840 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
nvidia-runners
難易度 1/5 1〜3時間 初心者へのやさしさ 25/100
NVIDIA/cuCollections#853 ·
メンテナーはふだん 2 日以内に返信
-
topic: performance type: feature request
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
NVIDIA/cuCollections#817 · コメント 7 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
good first issue P2: Nice to have type: improvement
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
NVIDIA/cuCollections#805 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
-
[FEA] Add MPSC/MPMC concurrent queue再び着手できるかも @sleeepyjack が 265 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンtype: feature request
NVIDIA/cuCollections#791 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
NVIDIA/cuCollections の issue をすべて見る
似ている issue
-
status: waiting-for-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
AOT compilation fails for derived delete queries returning Set対応中かも @ryujungkyun が今日担当しました。 オープンstatus: waiting-for-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
spring-projects/spring-data-jpa#4387 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
datajoint/datajoint-python#1586 ·
メンテナーはふだん 1 日以内に返信