NVIDIA / spark-rapids

Spark RAPIDS plugin - accelerate Apache Spark with GPUs
https://nvidia.github.io/spark-rapids
Apache License 2.0
797 stars 232 forks source link

[FEA] Improve `GpuJsonToStructs` performance #11560

Open ttnghia opened 2 weeks ago

ttnghia commented 2 weeks ago

The performance of our current GpuJsonToStructs is not good. When running the profiling, it looks like this:

Image

In the particular test case for the profiling above, the only useful work is only what to the end of the read_json range (just above 300ms), which is less than 50% of the entire GpuJsonToStructs projection (>800ms). The rest are just overhead, but it consists mostly of hundreds of small kernel calls and stream syncs due to pure copying data from the intermediate result to the final output.

We can do a lot better by reducing the unnecessary overhead, or improving them by a way that they can run in a much less time. If we divide the runtime of GpuJsonToStructs into sections:

Image

The improvement can be done by the following tasks:

karthikeyann commented 1 week ago

After discussion with @ttnghia, Here are the improvements planned for different sections: