4 ms·
How much abstraction overhead does the ArrayFire library introduce? Do you think you could get better performance and simplify the overall system by generating
by panic 10y ago
How much abstraction overhead does the ArrayFire library introduce? Do you think you could get better performance and simplify the overall system by generating CUDA or shader code yourself?
- arcfide 10y agoI would consider ArrayFire a "hard abstraction" that is basically the bottoming out of the system. Previous to this I was using OpenACC. See my talk at the Dyalog User Meeting Last year to see some of the struggles there with Scan. In short, ArrayFire is handling a lot of the core GPU algorithms for me, and that's its main contribution. This prevents me from needing to implement these myself, because this is itself a full time job. Much better to put a hard cutoff point and work on the high-level questions, rather than spending time trying to support three different architectures by myself. There is basically no good way of working at that level that isn't ugly and very very painful. I am glad to have someone else do that for me. The benefit is that I can take better advantage of their platform independent and performance tweaks for individual GPUs (which is still a lot of work with the state of GPU programming today). This leaves me to focus on higher level concerns that are more relevant to the APL programmer.
- pavanky 10y agoNot the author but as someone who worked on the arrayfire library I think I have some input to this question. Currently a lot of math functions are already compiled using a fairly simple just in time compiler inside arrayfire. This results in complex mathematical operations being fused into single kernels. That said, the number of functions that are supported this way are fairly limited and I am going to try and add more of them. Anyway here are a couple of links that may be helpful in trying to understand the overheads involved. The code shown [2] compiles to a single CUDA / OpenCL kernel. [1] https://arrayfire.com/benchmarking-parallel-vector-libraries/ https://arrayfire.com/benchmarking-parallel-vector-libraries... [2] https://arrayfire.com/performance-improvements-to-jit-in-arrayfire-v3-4/ https://arrayfire.com/performance-improvements-to-jit-in-arr...