About GStreamer 1.0 application development for beginnersShota TAMURA
Written in Japanese
This slides that was made for me to speak.
so, description in slides may not enough.
Agenda
- Overview
- Data structure
- The basic steps of gstreamer application development
- Tips...
KaiGai's talk at PGconf.EU 2018, Lisbon.
It shows how SSD2GPU Direct SQL of PG-Strom accelerates I/O intensive big-data queries using GPU in contradiction to the common sense.
セル生産方式におけるロボットの活用には様々な問題があるが,その一つとして 3 体以上の物体の組み立てが挙げられる.一般に,複数物体を同時に組み立てる際は,対象の部品をそれぞれロボットアームまたは治具でそれぞれ独立に保持することで組み立てを遂行すると考えられる.ただし,この方法ではロボットアームや治具を部品数と同じ数だけ必要とし,部品数が多いほどコスト面や設置スペースの関係で無駄が多くなる.この課題に対して音𣷓らは組み立て対象物に働く接触力等の解析により,治具等で固定されていない対象物が組み立て作業中に運動しにくい状態となる条件を求めた.すなわち,環境中の非把持対象物のロバスト性を考慮して,組み立て作業条件を検討している.本研究ではこの方策に基づいて,複数物体の組み立て作業を単腕マニピュレータで実行することを目的とする.このとき,対象物のロバスト性を考慮することで,仮組状態の複数物体を同時に扱う手法を提案する.作業対象としてパイプジョイントの組み立てを挙げ,簡易な道具を用いることで単腕マニピュレータで複数物体を同時に把持できることを示す.さらに,作業成功率の向上のために RGB-D カメラを用いた物体の位置検出に基づくロボット制御及び動作計画を実装する.
This paper discusses assembly operations using a single manipulator and a parallel gripper to simultaneously
grasp multiple objects and hold the group of temporarily assembled objects. Multiple robots and jigs generally operate
assembly tasks by constraining the target objects mechanically or geometrically to prevent them from moving. It is
necessary to analyze the physical interaction between the objects for such constraints to achieve the tasks with a single
gripper. In this paper, we focus on assembling pipe joints as an example and discuss constraining the motion of the
objects. Our demonstration shows that a simple tool can facilitate holding multiple objects with a single gripper.
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matchingharmonylab
公開URL:https://arxiv.org/pdf/2404.19174
出典:Guilherme Potje, Felipe Cadar, Andre Araujo, Renato Martins, Erickson R. ascimento: XFeat: Accelerated Features for Lightweight Image Matching, Proceedings of the 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2023)
概要:リソース効率に優れた特徴点マッチングのための軽量なアーキテクチャ「XFeat(Accelerated Features)」を提案します。手法は、局所的な特徴点の検出、抽出、マッチングのための畳み込みニューラルネットワークの基本的な設計を再検討します。特に、リソースが限られたデバイス向けに迅速かつ堅牢なアルゴリズムが必要とされるため、解像度を可能な限り高く保ちながら、ネットワークのチャネル数を制限します。さらに、スパース下でのマッチングを選択できる設計となっており、ナビゲーションやARなどのアプリケーションに適しています。XFeatは、高速かつ同等以上の精度を実現し、一般的なラップトップのCPU上でリアルタイムで動作します。
3. PG-Stromとは?
爆速Webinar#01 - 地理情報を爆速で処理する PG-Strom の新機能3
【機能】
集計/解析ワークロードの透過的なGPU高速化
SQLからGPUプログラムを自動生成し並列実行
SSD-to-GPU Direct SQLによるPCIeバスレベルの最適化
GPUメモリにデータを常駐。OLTPワークロードとの共存
一部PostGIS関数のサポート。位置情報分析を高速化
PG-Strom: GPUとNVME/PMEMの能力を最大限に引き出し、
テラバイト級のデータを高速処理するPostgreSQL向け拡張モジュール
App
GPU
off-loading
for IoT/Big-Data
for ML/Analytics
➢ SSD-to-GPU Direct SQL
➢ Columnar Store (Arrow_Fdw)
➢ GPU Memory Store (Gstore_Fdw)
➢ Asymmetric Partition-wise
JOIN/GROUP BY
➢ BRIN-Index Support
➢ NVME-over-Fabric Support
➢ Inter-process Data Frame
for Python scripts
➢ Procedural Language for
GPU native code (w/ cuPy)
➢ PostGIS Support
NEW
NEW
4. ログ収集デーモン:
ターゲット:IoT/M2Mログの集計・解析処理
爆速Webinar#01 - 地理情報を爆速で処理する PG-Strom の新機能4
Manufacturing Logistics Mobile Home electronics
なぜPostgreSQLか?
シングルノードで処理できるならそっちの方が運用が楽
エンジニアが慣れ親しんが技術で、運用ノウハウの蓄積が豊富
JBoF: Just Bunch of Flash
NVME-over-Fabric
(RDMA)
DB管理者
BIツール(可視化)
機械学習アプリケーション
(E.g, 異常検知など)
共通データ
フレーム PG-Strom
25. Gstore_Fdw外部テーブルの定義
CREATE FOREIGN TABLE ft (
id int,
x float,
y float,
z text
) server gstore_fdw
options (gpu_device_id '1',
base_file '/opt/pgdata-dev/ft.base',
redo_log_file '/opt/pmem-dev/ft.redo’,
max_num_rows '4000000',
primary_key 'id');
(補足)
base_fileはNVMEストレージ上に配置するのが望ましい。
✓ mmap(2)してバイト単位のランダムアクセスが多発するため、
PMEMの微妙なアクセスの遅さが性能差として見えてしまう。
redo_log_fileはPMEM上に配置するのが望ましい。
✓ トランザクションのコミット時にREDOログを永続化する必要があるため。
追記書き出しのみだが、細かい単位でCPUキャッシュをフラッシュする。
(逆にブロックデバイスのようなfsyncは必要ないが)
爆速Webinar#01 - 地理情報を爆速で処理する PG-Strom の新機能25
26. 更新処理のパフォーマンス(1/2)
--- 200万行を投入
INSERT INTO ft (SELECT x, 100*random(),
100*random(),
md5(x::text)
FROM generate_series(1,2000000) x);
--- 以下のクエリを pgbench で投入
--- (クライアント数:20を想定)
UPDATE ft SET x = 100*random(),
y = 100*random()
WHERE id = (SELECT 20*(100000.0*random())::int + :client_id);
--- 実行計画
EXPLAIN ....;
QUERY PLAN
-------------------------------------------------------------------
Update on ft (cost=0.02..100.03 rows=10000 width=58)
InitPlan 1 (returns $0)
-> Result (cost=0.00..0.02 rows=1 width=4)
-> Foreign Scan on ft (cost=0.00..100.01 rows=10000 width=58)
Filter: (id = $0)
Index Cond: id = $0
(6 rows)
爆速Webinar#01 - 地理情報を爆速で処理する PG-Strom の新機能26
27. 更新処理のパフォーマンス(2/2)
$ pgbench -p 6543 postgres -n -f test.sql -c 20 -j 10 -T 10
transaction type: test.sql
scaling factor: 1
query mode: simple
number of clients: 20
number of threads: 10
duration: 10 s
number of transactions actually processed: 1236401
latency average = 0.162 ms
tps = 123631.393482 (including connections establishing)
tps = 123674.819689 (excluding connections establishing)
(補足)
まだ排他ロックで実装している箇所があり、クライアント数が20を越えた辺りで
サチり始める。
➔ Row-Idの払い出しや、REDOログの書き込み位置などロックレス化できるハズ。
PostgreSQLの通常テーブル(on NVME-SSD):
20クライアント 65k TPS、80クライアント160k TPS程度
通常テーブルと外部テーブルの内部ロジックの違いに起因する差異は未検証
爆速Webinar#01 - 地理情報を爆速で処理する PG-Strom の新機能27
28. 検索処理のパフォーマンス(1/2)
--- GpuScan (GPU版PostGIS) + Gstore_Fdw
=# SELECT count(*) FROM ft
WHERE st_contains('polygon ((10 10,90 10,90 12,12 12,12 88,90 88,90 90,¥
10 90,10 10))’, st_makepoint(x,y));
count
-------
94440
(1 row)
Time: 75.466 ms
--- 通常版PostGIS + PostgreSQLテーブル
=# SET pg_strom.enabled = off;
SET
=# SELECT count(*) FROM tt
WHERE st_contains('polygon ((10 10,90 10,90 12,12 12,12 88,90 88,90 90,¥
10 90,10 10))', st_makepoint(x,y));
count
-------
94440
(1 row)
Time: 332.300 ms
200万個のPointから、
指定領域内の数をカウント
爆速Webinar#01 - 地理情報を爆速で処理する PG-Strom の新機能28
34. トランザクションの対応
SAVEPOINT, ROLLBACK TO SAVEPOINT も使用可能
トランザクション分離レベルは Read-Committed のみ
他の GPU-DB では(INSERT/UPDATE/DELETE対応していても)非対応
✓ OmniSCI, Kinetica, SQreamDB, Brytlyt のドキュメントを調査
GPU-DBでは珍しく、トランザクションのRollbackにも対応
=# BEGIN;
BEGIN;
=# INSERT INTO ft VALUES (9999999, random(), random(), 'this is test record');
INSERT 0 1
postgres=# SELECT * FROM ft WHERE id > 9000000;
id | x | y | z
---------+--------------------+--------------------+---------------------
9999999 | 0.4181428498515025 | 0.5861937164356661 | this is test record
(1 row)
postgres=# ABORT;
ROLLBACK
postgres=# SELECT * FROM ft WHERE id > 9000000;
id | x | y | z
----+---+---+---
(0 rows)
爆速Webinar#01 - 地理情報を爆速で処理する PG-Strom の新機能34