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

(JP) GpuSortの結果不正 #33

Closed
kaigai opened this issue Jun 6, 2014 · 1 comment
Closed

(JP) GpuSortの結果不正 #33

kaigai opened this issue Jun 6, 2014 · 1 comment

Comments

@kaigai
Copy link
Contributor

kaigai commented Jun 6, 2014

PostgreSQL標準のソートと一部結果が異なる場合がある。

pgstrom_test=# explain select id from bytea_test where bin between '\xff00'::byt ea and '\xffff'::bytea order by id;
LOG: (gpusort.c:633) colmeta[0] attname=id {attnotnull=0, attalign=8, attlen=8, cs_ofs=48}
QUERY PLAN



Custom (GpuSort) (cost=129657.73..129701.35 rows=17449 width=8)
Sort keys: id
Sort keys width: 8
Rows per chunk: 21408
-> Custom (GpuScan) on bytea_test (cost=10000.00..129645.44 rows=17449 width=8)
Filter: ((bin >= '\xff00'::bytea) AND (bin <= '\xffff'::bytea))
Host References: id, bin
Device References:
Filter: ((bin >= '\xff00'::bytea) AND (bin <= '\xffff'::bytea)) Planning time: 1.464 ms
(10 rows)

pg_strom.enabled = on | off を切り替えて実行したところ、

--- /home/kaigai/hoge1.out 2014-06-06 15:46:38.120934370 +0900
+++ /home/kaigai/hoge2.out 2014-06-06 15:46:48.200885168 +0900

(略)

@@ -18735,5 +18724,16 @@ SET
4999537 | \xff5b9eb9c3c6193e6dbc4a4c636ff5a9f17917f89d957e584cd9c2ac8f744f8ecfed48
4999632 | \xffe5754d7a75737cb2773a0a896cebddbf0670629c610c132d9408287dd94d7cbec2c93838
4999963 | \xffe2ec08910173855918

  • 1068228 |
  • \xff2664eb27a52e88f64bacc7b25f969af1755634f080a6224beb67c2c2aba4c1d109
  • 3372313 |
  • \xffee9cbc11a8d2067ea31faf7788dc477d8a4dda9cfb6e545cd21582976eaa975d47
  • 536eef26756d
  • 835694 | \xff233d
  • 3448895 |
  • \xfffde6eafde83992e06cf55346016e48174d928b6fee8cd52a5e41e16000c860feae
  • 4afb96838d
  • 1072362 | \xffe79b37f7
  • 2941594 | \xff98faf2
  • 1810923 |
  • \xffeaa06f929bdf3921676ecd0d68e1c2106fb558af6e2b072fde4a7feab5f7ea9f97
  • 593132396b54a0d921ad41026f527225aa2193d528
  • 1504858 |
  • \xff7101a02d513e8718f82695b301e07c98e13f037a94b1beb889332d924d6091bf61
  • 31ecb27073ca6899601b9a40973321d7
  • 2741685 | \xff01ef05e3e608cbc2f705efb6e8c253876ba7e99cf1a9
  • 3317789 | \xffa5669fe3336c5efb
  • 2685612 |
  • \xffcb90b10796cf0470bde8567a8bd2d69f4fc752b5a32e3d800ffa98e5e6fee4b18e
  • 95b82564
    (18734 rows)

最後の方に少しソートされていない要素が発生している。
実行計画からわかるように、GpuScanの処理結果をGpuSortに回すような構造に
なっており、データの件数は 18734 件。これを GTX のブロックサイズ 32 で
割った余りは 14 なので、kernelを起動する際のworkgroup-sizeが少し臭い。

@kaigai
Copy link
Contributor Author

kaigai commented Oct 27, 2014

コードベースが非常に古いので、一旦クローズ扱いとします。

@kaigai kaigai closed this as completed Oct 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant