NNlib.jl icon indicating copy to clipboard operation
NNlib.jl copied to clipboard

Migrate to KernelAbstractions.jl for handwritten kernels

Open pxl-th opened this issue 2 years ago • 10 comments

Motivation and description

New backends will get the existing functionality basically for free, once KernelAbstraction.jl supports them.

On master branch the restriction for Julia was lowered to 1.6, but on release-0.8 it is still 1.7. @vchuravy does it mean that KA now runs on 1.6 or was it by mistake?

And do we care about new features for 1.6 or do we take similar approach to NNlibCUDA.jl -> extension migration, where old versions will receive only bugfixes via backports. If not, then we don't need to wait for new KA release and can start migration which will add existing functionality for AMDGPU.

Possible Implementation

No response

pxl-th avatar Mar 01 '23 13:03 pxl-th

If the migration comes with no performance hit, then let's do it. Bumping the julia compact to v1.7 shouldn't be a problem

CarloLucibello avatar Mar 03 '23 06:03 CarloLucibello

On 1.6 method overlays are not reliable, butnon the other hand I had CI for 1.6 forever so I am slightly confused for why I have introduced 1.7 as a restriction.

Of note is that we can support AMD on 1.6 reliable and I would wait for KA 0.9. That release has the goal of being a dependency for GPUArrays

vchuravy avatar Mar 03 '23 08:03 vchuravy

and I would wait for KA 0.9

That was my next question :) Then we also need to wait on https://github.com/JuliaGPU/AMDGPU.jl/pull/374 for AMDGPU.

pxl-th avatar Mar 03 '23 14:03 pxl-th

@vchuravy are/will the KA atomics be supported on 1.6?

ToucheSir avatar Mar 03 '23 14:03 ToucheSir

KA 0.9 has been tagged! My question above still stands though.

ToucheSir avatar Mar 10 '23 15:03 ToucheSir

Where do you need atomics? On the CPU? Or on the GPU? On the GPU atomics will be supported from 1.6 onwards.

vchuravy avatar Mar 10 '23 15:03 vchuravy

On the GPU to replace CUDA.@atomic. Thanks for the answer!

ToucheSir avatar Mar 10 '23 16:03 ToucheSir

Yeah you can just use Atomix.@atomic.

vchuravy avatar Mar 10 '23 21:03 vchuravy

KA 0.9 and CUDA 4.1 are out so this is now feasible to attempt

vchuravy avatar Mar 24 '23 16:03 vchuravy

AMDGPU#master now supports KA 0.9, I'll attempt this.

pxl-th avatar Apr 05 '23 11:04 pxl-th