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

Update deps & bump to 0.16.1 #2574

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Flux"
uuid = "587475ba-b771-5e3f-ad9e-33799f191a9c"
version = "0.16.0"
version = "0.16.1"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down Expand Up @@ -64,6 +64,6 @@ Reexport = "1.0"
Setfield = "1.1"
SpecialFunctions = "2.1.2"
Statistics = "1"
Zygote = "0.6.67"
Zygote = "0.6.67, 0.7"
cuDNN = "1"
julia = "1.10"
9 changes: 2 additions & 7 deletions ext/FluxAMDGPUExt/FluxAMDGPUExt.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module FluxAMDGPUExt

import ChainRulesCore
import ChainRulesCore: NoTangent
import ChainRulesCore: NoTangent, unthunk
import Flux
import Flux: fmap, DenseConvDims, Conv, ConvTranspose, conv, conv_reshape_bias
import NNlib

using MLDataDevices
using AMDGPU
using Adapt
Expand All @@ -13,14 +14,8 @@ using Zygote

const MIOPENFloat = AMDGPU.MIOpen.MIOPENFloat


include("functor.jl")
include("batchnorm.jl")
include("conv.jl")


# TODO
# fail early if input to the model is not on the device (e.g. on the host)
# otherwise we get very cryptic errors & segfaults at the rocBLAS level

end
2 changes: 1 addition & 1 deletion ext/FluxAMDGPUExt/batchnorm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function ChainRulesCore.rrule(
)
y, μ_saved, ν_saved = _amdgpu_batchnorm(x, γ, β; μ, σ², ϵ, within_grad)
function _batchnorm_pullback(Δ)
dx, dγ, dβ = AMDGPU.MIOpen.∇batchnorm(Δ, x, γ, β, μ_saved, ν_saved)
dx, dγ, dβ = AMDGPU.MIOpen.∇batchnorm(unthunk(Δ), x, γ, β, μ_saved, ν_saved)
(NoTangent(), dx, dγ, dβ)
end
y, _batchnorm_pullback
Expand Down
4 changes: 2 additions & 2 deletions test/ext_cuda/cuda.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ end
# Trivial functions
@test gradient(x -> sum(abs, gpu(x)), a)[1] isa Matrix
@test gradient(x -> sum(gpu(x)), a)[1] isa Matrix
@test_broken gradient(x -> sum(gpu(x)), a')[1] isa Matrix # sum(::Adjoint{T,CuArray}) makes a Fill
@test gradient(x -> sum(gpu(x)), a')[1] isa Matrix # sum(::Adjoint{T,CuArray}) makes a Fill
@test gradient(x -> sum(abs, cpu(x)), ca)[1] isa CuArray
# This test should really not go through indirections and pull out Fills for efficiency
# but we forcefully materialise. TODO: remove materialising CuArray here
Expand Down Expand Up @@ -207,4 +207,4 @@ end
@test collect(post2) isa Vector{<:NamedTuple{(:x, :y)}} # collect makes no sense, but check eltype?

# @test_throws Exception gpu(((x = Flux.DataLoader(X), y = Y),))
end
end
Loading