Skip to content

Can RNG be moved to GPUArraysCore? #556

Open
@avik-pal

Description

@avik-pal

From the definition of the struct, it seems like it should be as simple as copy-pasting it over. I can open a PR for this, but wanted to know if there was any reason not to do this previously.

Metal and oneAPI default_rng return RNG objects, so it is very useful (in the deep learning context) to define dispatches on RNG to initialize data directly on the device (for weight initialization, functions that need random numbers on runtime, etc.). To do this I end up defining weakdeps like:

  1. https://github.com/LuxDL/WeightInitializers.jl/blob/main/ext/WeightInitializersGPUArraysExt.jl
  2. https://github.com/LuxDL/MLDataDevices.jl/blob/main/ext/MLDataDevicesGPUArraysExt.jl

Moving to GPUArraysCore makes it significantly easier, since that is quite lightweight to not need extensions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions