[ConditionalEuclideanClustering::segment] std::(multi)thread (only) 21-46% faster on non organzied clouds, much faster appearantly on organized clouds
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- cpp
調査の方向性
ConditionalEuclideanClustering::segment から始め、fork ブランチ attemptConditionalEuclideanMT のマルチスレッド実装を確認してください。issue に記載された 4 つのベンチマーク設定を再現し、スレッド処理のアプローチを比較してください。issue では、受け入れられる具体的な変更や完了基準は定義されていません。
索引モデルが issue の本文から書いたものです。
説明
I have implemented a std multithread version of ConditionalEuclideanClustering::segment and called it
void
segmentMT (IndicesClusters &clusters, const size_t threadNumber=2);
on my fork branch attemptConditionalEuclideanMT
on my PC it improves of only 21-38% the time to produce the results using 3 or 4 threads
12th Gen Intel(R) Core(TM) i7-12700 2.10 GHz
20 Logical CPUs - 32.0 GB
Windows 10 Pro
Setting1:
cloud is dense and NOT organized and has 2 million points XYZRGB
so the search used is pcl::search::OrganizedNeighbor
which takes 350 msec just to execute searcher_->setInputCloud
11 clusters are segmented
5 threads: 2.1-2.3 sexc
4 threads: 1.9-2.2 sec
3 threads: 1.8-2 sec
2 threads: 2.1 sec
1 thread: 2.4sec
21% improvement
Setting2:
cloud is dense and NOT organized and has 300 000 points XYZRGB
3 threads: 268-295 msec
1 thread: 420msec
4 clusters are found
32% improvement
Setting3:
cloud is NOT dense and NOT organized and has 485 000 points XYZRGB
3 threads: 480-500 msec
1 thread: 790msec
1 clusters is found
38% improvement
Setting 4: like Setting 1 but running on a different computer, a laptop less stable (less reliable for benchmark) because with heavy sw running in background:
4 threads: 2.9-3.4 sec
1 thread: 5.6-6.1 sec
46% improvement
I am still investigating the reasons for this limited improvement. On a first analysis the main reason could be that the algorithm is intinsecally not much parallelizable. I can split in parallel the growing of the clusters by splitting the point sequence in subsequences, but then at the end I have to reconnect the clusters that have grown separately in different threads ( I record the connections to be made at the end)
you can check I have quite optimized the critical scetions using also shared_mutexes
still I think it would be an interesting alternative to openMP or CUDA also for other tools/features that like this one do not look feasible for openMP or CUDA
I have tried 3 versions one with a searcher for each thread, one with a unique searcher prpeared by the main thread and one with a unique searcher prepared by the first launched thread. The latter would be faster but once in a while it gets much slower, probably because I had to implement it with a std::condition_variable that when triggered probably it slows down the thread pool. So in the end I opted for the 2nd solution (no std::condition_variable)
- 主要言語
- C++
- スター
- 11.2k
- フォーク
- 4.7k
- 平均マージ
- 5日 8時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PointCloudLibrary/pcl のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
PointCloudLibrary/pcl#6509 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
kind: bug status: triage
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
PointCloudLibrary/pcl#6395 ·
メンテナーはふだん 4 日以内に返信
-
[sample_consensus] Migrated the SSE and AVX implementations of countWithinDistance to RISC-V RVV 1.0オープンkind: request status: triage
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
PointCloudLibrary/pcl#6385 · リアクション 1 件 ·
メンテナーはふだん 4 日以内に返信
-
2 tests fail対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
PointCloudLibrary/pcl#6373 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 4 日以内に返信
-
kind: question kind: request
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
PointCloudLibrary/pcl#6370 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
PointCloudLibrary/pcl の issue をすべて見る
似ている issue
-
good first issue invalid
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
DanielJerolm/gpcc#74 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
patrick-hudson/put.gd-desktop#808 ·
メンテナーはふだん 1 日以内に返信
-
DPI change is not fully handled in the cascading window on Windows対応中かも @yukawa が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 4 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
enhancement Ready for final check
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
mpogue2/SquareDesk#1818 · コメント 1 件 ·