Repository navigation
CUDA: fewer memory bank conflicts for mul_mat_q - #2458
Conversation
7cd929b to
5073b0f
Compare
|
Do the |
|
They definitely do for the more complicated kernels where they allow the compiler to optimize out some instructions that can have no effect depending on tile size. I added them to the more simple kernels too because that was less work than to manually check performance for each kernel. |
|
error: identifier "__builtin_assume" is undefined This is a somewhat older CUDA but worked fine so far, please review. |
|
If you want help, provide more detailed debugging information. |
|
Yeah, but I don't know the first thing about cuda/cublas. It's this package: libcublas10:amd64 10.1.243-3 I guess just install it, and you'll probably see why it doesn't compile. |
|
__builtin_assume is only available as of CUDA 11.2. I suppose you could write a macro around __builtin_unreachable. |
|
Due to recent changes, another regression occured: ggml-cuda.cu(6299): error: identifier "CUBLAS_COMPUTE_16F" is undefined |
This PR replaces the simple code for loading data into shared memory tiles for mul_mat_q kernels with mode complicated code that reduces memory bank conflicts as much as possible. The exception is q4_0 and q8_0 where the performance was slightly worse (I'm keeping the corresponding code commented out because it will probably be useful when employing asynchronous data loading). These are the performance numbers on my system:
For reference: cuBLAS performance is ~1300 t/s on an RTX 3090 and ~460 t/s on a P40.