heavyai / heavydb

HeavyDB (formerly OmniSciDB)
https://heavy.ai
Apache License 2.0
2.96k stars 448 forks source link

[GPU Logic Bug] SELECT SUM(<column>) FROM <table> Brings Errors #841

Open qwebug opened 1 month ago

qwebug commented 1 month ago

Describe:

SELECT SUM(\) FROM \

brings different results, when using CPU-only configurations and GPU-used configurations.

SQL with CPU-only Config:

CREATE TABLE t0(c0 FLOAT);
CREATE TABLE t2(c0 smallint);
INSERT INTO t2(c0) VALUES(24857), (-23244), (-3399), (27741), (-28729);
INSERT INTO t0(c0) VALUES(0.87252295);
INSERT INTO t0(c0) VALUES(0.34362268);
INSERT INTO t2(c0) VALUES(24857), (-24572), (-1661);
ALTER SESSION SET EXECUTOR_DEVICE='CPU';
SELECT SUM(t0.c0) FROM t0, t2;

Result:

EXPR$0
9.729166030883789

SQL with GPU-used Config:

ALTER SESSION SET EXECUTOR_DEVICE='GPU';
SELECT SUM(t0.c0) FROM t0, t2;

Result:

EXPR$0
9.729165077209473

Environment:

Docker Deployment

https://hub.docker.com/layers/heavyai/heavyai-ee-cuda/latest/images/sha256-5af3ad3a00cbc5ce09c299b8b81cda96521a27373dbb1e59209c02358cfd9b1f?context=explore

Docker DIGEST: sha256:5af3ad3a00cbc5ce09c299b8b81cda96521a27373dbb1e59209c02358cfd9b1f

HeavyDB Version: 7.1.0-20230821-eae9ec17da

HeavyDB license: Free Edition