FluxML / NNlib.jl

Neural Network primitives with multiple backends
Other
201 stars 121 forks source link

Migrate to KernelAbstractions.jl for handwritten kernels #479

Open pxl-th opened 1 year ago

pxl-th commented 1 year ago

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

CarloLucibello commented 1 year ago

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

vchuravy commented 1 year ago

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

pxl-th commented 1 year ago

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.

ToucheSir commented 1 year ago

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

ToucheSir commented 1 year ago

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

vchuravy commented 1 year ago

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

ToucheSir commented 1 year ago

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

vchuravy commented 1 year ago

Yeah you can just use Atomix.@atomic.

vchuravy commented 1 year ago

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

pxl-th commented 1 year ago

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