News for hackers. Stuff that matters.
Re:BlazingDB uses GPUs to manipulate huge databases in no time by sitkack on Monday September 12, 2016 @09:16PM (#12485006)
You would need a GPU with an onboard SSD (exists). Or GPUs and drivers with the ability to talk directly to infiniband hardware (exists).

Or the ability to not be ridiculously wasteful of existing resources (also exists).

Your naysaying doesn't make you smart. Your naysaying makes you cut off from learning a different, better way of doing things.

Re:BlazingDB uses GPUs to manipulate huge databases in no time by hendzen on Monday September 12, 2016 @09:53PM (#12485112)
Database workloads tend to be very branch heavy, e.g. string comparisons. If you've ever programmed a GPU you know that taking a data-dependent branch serializes the execution of the GPU stream processing units. So already the 70-100x benefit GPUs give on vectorized floating point workloads is greatly reduced. Add in the memory bandwidth penalty and it's a complete waste for IO intensive database workloads.

Save the GPUs for training neural nets and physics simulations. When the fundamental hardware capabilities of GPUs make them worth investing in for database workloads, I'll change my opinion. Until then, any budget for expensive DB hardware is much better spent on NVMe storage.

Re:BlazingDB uses GPUs to manipulate huge databases in no time by zlynx on Monday September 12, 2016 @11:22PM (#12485423)
You can write code to compare strings without branches. Imagine comparing one string to every string in a database column. Pad to a fixed size first (if you find an ambiguous match later you can do a full string compare then). Subtract the strings, aka compare, and store the result. At the end of all the commparisons you have a memory structure of negative, zero, or positive values. Then you can do something with the matching values.

There have been some very sweet algorithms for doing B+ tree searches for Itanium and for AVX and those work just as well, if not better on GPU.

With some thinking, branch operations can be converted into math and applied to masses of data without checking for branch conditions. This wastes some work but is still faster than branching.

Re:BlazingDB uses GPUs to manipulate huge databases in no time by hendzen on Monday September 12, 2016 @11:33PM (#12485463)
That sounds like an interesting technique - but it unfortunately does not apply on a majority of real-world data.

In particular I mean sorting non-English text which any serious database needs to be able to do. Subtracting characters doesn't work when you're dealing language specific Unicode collation [0].

[0] - http://www.unicode.org/reports/tr10/

Re:BlazingDB uses GPUs to manipulate huge databases in no time by zlynx on Wednesday September 14, 2016 @03:32PM (#12500457)
Yeah, well, you just can't do it that way and be fast at the same time. I mean seriously fast.

What you can do is decide how your comparison should be collated and preprocess your strings into a sort key form that is strictly big-endian binary (first byte has highest weight). Or little-endian I suppose, whichever works best for your hardware.

Your sort key doesn't have to be the actual string.

Re:BlazingDB uses GPUs to manipulate huge databases in no time by felipe_aramburu on Tuesday September 13, 2016 @02:43AM (#12486060)
Yes data dependent branch serialzizes the execution of the gpu stream processing units (this is not true for amd actually). Yes it sucks operating on string sometimes on gpu and we don't always do it because of this. But we are ignoring certain aspects. Long strings are dictionary encoded in our database usually (no one picks this an optimizer finds the best cascading compression scheme and imposes this). Dictionary encodings are sorted so that each dicitionary value's key is in sorted order. So guess what you can already do comparison and equality checks on much smaller datasizes. A long string can be encoded in 8, 4 ,2 sometimes even 1 byte. Many times we have to do string comparisons on strings that we hhave not encoded ie

select * from table where column1 = "some awesome text here"

In this case we actually do a comparison between hashes of the data. Hashing is cheap, fast, and makes comparisons on the GPU's be a breeze. So long story short, we have no data dependent branching. We do this by never using certain statements inside of kernel code.

the use of "if" is expressly forbidden at blazing for any gpu code and it's use is punished viciously (said individual usually has to be the one that captures meaningful input from one the 80 log files of our 80 gpu cluster ).

Editing to mention the way you can encode a long string down to a 1 byte is by doing a dictionary compression and then bit packing the keys. On gpu the way you do this is getting the max key (min key is always 0) and then you can store this data in 1 byte (if max(key) < 255).

Re:BlazingDB uses GPUs to manipulate huge databases in no time by sitkack on Wednesday September 14, 2016 @10:30AM (#12497187)
The whole point of making things fast is to remove all the if statements. People complain that their current if-heavy algorithm can't run on GPUs therefor GPUs suck. Of course then the algorithms need to be reworked to have less branches.
Re:BlazingDB uses GPUs to manipulate huge databases in no time by cowsandmilk on Monday September 12, 2016 @09:25PM (#12485035)
BlazingDB is advertising as being run on AWS, Azure, Softlayer; do the GPUs on these systems have these hardware features?
Re:BlazingDB uses GPUs to manipulate huge databases in no time by brianwawok on Monday September 12, 2016 @09:23PM (#12485028)
Seems like a smarter response to me. Go ahead and use a GPU database if you want?? I have yet to see a good use case of one though.
Re:BlazingDB uses GPUs to manipulate huge databases in no time by felipe_aramburu on Tuesday September 13, 2016 @09:38AM (#12488062)
We have seen many.

Big joins are our best use case. Joins are hard for many databases to optimize when they have not seen them before or are not "expecting" them like when you let amazon know how to partition your different tables onto the same physical machines so that redshift can return your query in a reasonble amount of time. But most SQL operations can be accelerated by the use of GPU's. Order by (holy smokes it helps), arithmetic or date transformations (20-30x for comparable cpu code), predicates, group by. All of these operations are happening over vectors of data. SIMD rock out when it comes to running these kinds of loads. The only use cases that we actually think are very poorly suited to gpus thus far (and this is a nut someone will one day probably crack) is wild card string searches. Some of our competitors handle this by caching all the data in GPU RAM but we consider that to be "cheating" since you would never be able to justify the pcie transfer to do wild card string searches.

Re:BlazingDB uses GPUs to manipulate huge databases in no time by brianwawok on Wednesday September 14, 2016 @10:43AM (#12497351)
This seems more like an analytics workload.. you are querying a bunch of things you can't index ahead of time.

Why not put GPUs on your analytics machines? Or a cluster of them with SPARK. Or heck, distribute the spark cluster on top of your database.

Re:BlazingDB uses GPUs to manipulate huge databases in no time by felipe_aramburu on Wednesday September 14, 2016 @11:18AM (#12497802)
We are an Analytical database not a transactional one. We would love to integrate with more tools like spark alas we are a small team of 5 working on the engine and making the engine itself has taken most of our time to date.