chdb-io / chdb

chDB is an in-process OLAP SQL Engine 🚀 powered by ClickHouse
https://clickhouse.com/chdb
Apache License 2.0
2.13k stars 75 forks source link

AVX2 Support #7

Closed lmangani closed 1 year ago

lmangani commented 1 year ago

Great mod and very interesting binding approach! We're also playing with clickhouse-local custom builds towards a slimmer execution engine.

Question: Is there a specific reason for AVX2 to be enabled for Linux systems? This greatly reduces the scope of usage (ie: lambdas, virtualized cpus, etc, fail with Instruction check fail. The CPU does not support AVX2 instruction set.)

Having this disabled (or possibly multiple versions) could broaden compatibility scope enormously. Also the library doesn't seem to be stripped and the distributed .so has 100M+ of trimmable fat.

Thanks!

auxten commented 1 year ago

Thank you for your suggestion. Before, I just thought that most Linux servers should have AVX2 support for performance considerations. Didn't realize usage scenarios like lambdas, virtualized cpus. I'm going to fix this in v0.5.0.

lmangani commented 1 year ago

Thanks! If you would like to support AWS Lambdas and other virtualized system the following patch is also required:

sed -i '/Cannot set thread name/c\' /ClickHouse/src/Common/setThreadName.cpp

Would you accept PRs to the builder?

auxten commented 1 year ago

PR is welcome.

auxten commented 1 year ago

The strip issue is mainly because currently chdb is really new. I need debug info if any crash happens. The shared lib is built in release mode but with -g flag which means not so much(increased the size by approximately 20%) debug info included.

lmangani commented 1 year ago

That makes sense, although the resulting file is really huge. chdb x86_64 library as installed by pip3

-rwxr-xr-x   1 root staff 527420816 Apr 15 15:37 _chdb.cpython-37m-x86_64-linux-gnu.so*

after strip

-rwxr-xr-x   1 root staff 411978416 Apr 15 15:55 _chdb.cpython-37m-x86_64-linux-gnu.so*
lmangani commented 1 year ago

PR open, moving discussion in thread: https://github.com/auxten/chdb/pull/9