Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cos/exp on AMDGPU.jl #977

Closed
vchuravy opened this issue Aug 1, 2023 · 1 comment
Closed

cos/exp on AMDGPU.jl #977

vchuravy opened this issue Aug 1, 2023 · 1 comment
Labels

Comments

@vchuravy
Copy link
Member

vchuravy commented Aug 1, 2023

These are currently failing due to missing adjoints for the OCL functions

Enzyme.jl/test/amdgpu.jl

Lines 41 to 72 in 0995d7a

# @testset "exp_kernel" begin
# A = AMDGPU.ones(64,)
# @roc groupsize=length(A) exp_kernel(A)
# A = AMDGPU.ones(64,)
# dA = similar(A)
# dA .= 1
# @roc groupsize=length(A) grad_exp_kernel(A, dA)
# @test all(dA .== exp(1.f0))
# end
function cos_kernel(A)
i = workitemIdx().x
if i <= length(A)
A[i] = cos(A[i])
end
return nothing
end
function grad_cos_kernel(A, dA)
autodiff_deferred(Reverse, cos_kernel, Const, Duplicated(A, dA))
return nothing
end
# @testset "cos_kernel" begin
# A = AMDGPU.ones(64,)
# @roc groupsize=length(A) cos_kernel(A)
# A = AMDGPU.ones(64,)
# dA = similar(A)
# dA .= 1
# @roc groupsize=length(A) grad_cos_kernel(A, dA)
# @test all(dA .≈ -sin(1.f0))
# end

@vchuravy vchuravy added the amdgpu label Aug 1, 2023
@wsmoses
Copy link
Member

wsmoses commented Jun 18, 2024

Resolved by #1537

@wsmoses wsmoses closed this as completed Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants