JuliaGPU / JuliaGPU/CUDA.jl

Add `@non_differentiable` rules for basic random functions

Open
#2,153 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
Julia
Stars
1.4k
Forks
281
Avg merge
1d 7h
Merged PRs (30d)
30

Description

I need to have these lines in my codes to make AD works.

@non_differentiable CUDA.zeros(::Any...)
@non_differentiable CUDA.rand(::Any...)
@non_differentiable CUDA.randn(::Any...)

Can we add them to the extension? Adapting from
https://github.com/JuliaDiff/ChainRules.jl/blob/main/src/rulesets/Random/random.jl

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the CUDA.jl extension and compare the requested rules with ChainRules.jl's src/rulesets/Random/random.jl. Confirm how @non_differentiable is used for CUDA.zeros, CUDA.rand, and CUDA.randn, then verify that automatic differentiation no longer requires users to define these rules manually.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.