Skip to content

Comment on Show HN: Parsing CSV files with GPU

Comments

I like your creativity in applying the GPU to a less typical task.

Is it the case that the CPU version could be sped up dramatically by using multiple cores and a variation on the line splitting technique?

You could use a lockfree queue, fill it, and spawn a suitable number of consumers that will put the parsed data back into a new queue. If the data order matters, then some extra boilerplate is needed, and I do not know how it's done on the GPU, or if it's needed at all.

Seeing that it takes 14.5s with the handrolled code to parse 750GB, I however doubt the optimization is needed - it's more than 50GB every second and you need some really really exotic hardware to generate that much data. You still need to do something with the data and it's likely significantly more computational intensitive - that should be on a different thread.

That said, using the GPU would free up the CPU to do meaningful work with the data. But to be fair, assuming 1GB/s datarate, it's still 12,5m to read it all and you only gain 14.5s or less than 2% speedup if you're CPU bound.

It should be 750MB, not 750GB. There is no way a single hard drive can read 750GB in 14 seconds.

Heh, you cant even DMA 750GB from memory to the graphics card (assuming 16GB/s, using 32 lanes) in 14s.

Well, that makes a lot more sense.

Yes, CPU version can be accelerated as well, depending on availability of SSE extensions.

Shouldn't that be the default assumption? It's pretty rare to not have SSE.

On X86_64 it's impossible not to have SSE. So unless you develop for 32bit X86 systems you can assume the availability of vector instructions.

SSE is probably more common than a $1000 GPU.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.