Repository navigation
Conversation
Benchmark resultsCompared with 3f940e353, the merge base. Times are the minimum time of every benchmark. A change is unusual when it exceeds both three times the benchmark's typical change between consecutive runs on the default branch and a minimum per category (performance 3%, latency 5%, applications 3%, other 3%). A benchmark that starts or stops allocating is listed however few the allocations. A single run can still be a fluke, so rerun before drawing conclusions.
All benchmarks
History: https://juliagpu.org/perf/?pkg=cuda |
3e349e5 to
bf2484e
Compare
… operations GPUArrays 12.3 implements the dispatch from LinearAlgebra's storage-level `mul!` and triangular methods to BLAS routines, and calls hooks that back-ends implement with their library. Replace our copy of that dispatch with methods for those hooks. The gemm hook keeps using gemm! for the mixed-precision products that gemmEx supports. Triangular products and solves with operands that cuBLAS cannot address (views that skip rows, reversed vectors) now use GPUArrays' kernels instead of copying those operands first.
GPUArrays implements the BLAS 1 functions, `A' * A`, matrix additions with transposed operands, transposition, and products with Diagonal matrices, and calls hooks for the BLAS routines. Implement those with cuBLAS and drop our own methods. Our dot kernel for element types cuBLAS lacks becomes a method of the dot hook. GPUArrays 12.4 also implements dot for wrapped arrays, which our catch-all method covered so far.
e7a4f1f to
15da90c
Compare
|
I've reworked this so it can go in with GPUArrays 12.4 (JuliaGPU/GPUArrays.jl#888), and force-pushed; the previous head was e7a4f1f.
AMDGPU.jl#1229 and oneAPI.jl#779 need the same |
|
GPUArrays 12.4 is registered, which was the cause of the earlier CI failures. With it, the Julia 1.10 and 1.13 jobs pass; the CUDA version matrix is still running. |
cuBLAS kept its own copy of the logic that maps LinearAlgebra's products, triangular operations and BLAS 1 functions to BLAS routines: dimension checks, unwrapping adjoints and triangular wrappers into BLAS characters, layout checks for views, and strong zeros. AMDGPU.jl and oneAPI.jl have their own copies, and they had drifted apart, e.g.
axpby!(2, x, false, y)andrmul!(view(x, 1:2:n), false)propagated NaNs fromyandxhere. GPUArrays 12.3 (JuliaGPU/GPUArrays.jl#852) implements that logic once and callsGPUArrays.blas_*hooks for the BLAS routines.This PR deletes our copy and implements the hooks with cuBLAS: gemm (including the mixed-precision products that
gemmExsupports), gemv, symm/symv, hemm/hemv, trmm/trmv, trsm/trsv, syrk, herk, geam, dgmm, and the BLAS 1 routines. Our customdotkernel for element types cuBLAS doesn't support becomes a method of theblas_dothook. It requires GPUArrays 12.4 (JuliaGPU/GPUArrays.jl#888), which implementsdotfor wrapped GPU arrays (dot(UpperTriangular(A), B),dot(Symmetric(A), B), ...), as our catch-alldot(::AnyCuArray, ::AnyCuArray)did.Behavior changes:
falseis a strong zero inmul!,rmul!,axpby!androtate!, anddot(A', B')works (it was aMethodError).A' * Ausessyrkorherk.On an RTX 5080 (minimum of repeated runs):
using CUDAA' * A, 2048²Float32UpperTriangular(view(A, 1:2:2n, :)) \ B, n = 2048UpperTriangular(view(A, 1:2:2n, :)) * B, n = 2048gemm, gemv,
dot,axpy!,norm,transpose!,A ± B',A' ± B'and Diagonal products are unchanged.The cuBLAS tests gain cases for triangular operations on views, strong zeros, and
dotof strided views; the backend-agnosticdotcases are in GPUArrays' test suite.