Skip to content

Commit

Permalink
Remove hack and insist on Julia version upgrade (#411)
Browse files Browse the repository at this point in the history
* Remove hack and insist on Julia version upgrade

* Bump patch version
  • Loading branch information
willtebbutt authored Dec 5, 2024
1 parent 941d943 commit 16b8500
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 52 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Mooncake"
uuid = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
authors = ["Will Tebbutt, Hong Ge, and contributors"]
version = "0.4.57"
version = "0.4.58"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down Expand Up @@ -67,7 +67,7 @@ Setfield = "1"
SpecialFunctions = "2"
StableRNGs = "1"
Test = "1"
julia = "1.10"
julia = "~1.10, 1.11.2"

[extras]
AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a"
Expand Down
69 changes: 19 additions & 50 deletions ext/MooncakeLuxLibSLEEFPiratesExtension.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,25 @@ using LuxLib, Mooncake, SLEEFPirates
using Base: IEEEFloat
using Mooncake: @from_rrule, DefaultCtx

@static if VERSION >= v"1.11"

# Workaround for package load order problems. See
# https://github.com/JuliaLang/julia/issues/56204#issuecomment-2419553167 for more context.
function __init__()
Base.generating_output() && return nothing

for f in Any[
LuxLib.NNlib.sigmoid_fast,
LuxLib.NNlib.softplus,
LuxLib.NNlib.logsigmoid,
LuxLib.NNlib.swish,
LuxLib.NNlib.lisht,
Base.tanh,
LuxLib.NNlib.tanh_fast,
]
f_fast = LuxLib.Impl.sleefpirates_fast_act(f)
@eval @from_rrule DefaultCtx Tuple{typeof($f_fast),IEEEFloat}
@eval @from_rrule(
DefaultCtx,
Tuple{
typeof(Broadcast.broadcasted),
typeof($f_fast),
Union{IEEEFloat,Array{<:IEEEFloat}},
},
)
end
end

else
for f in Any[
LuxLib.NNlib.sigmoid_fast,
LuxLib.NNlib.softplus,
LuxLib.NNlib.logsigmoid,
LuxLib.NNlib.swish,
LuxLib.NNlib.lisht,
Base.tanh,
LuxLib.NNlib.tanh_fast,
]
f_fast = LuxLib.Impl.sleefpirates_fast_act(f)
@eval @from_rrule DefaultCtx Tuple{typeof($f_fast),IEEEFloat}
@eval @from_rrule(
DefaultCtx,
Tuple{
typeof(Broadcast.broadcasted),
typeof($f_fast),
Union{IEEEFloat,Array{<:IEEEFloat}},
},
)
end
for f in Any[
LuxLib.NNlib.sigmoid_fast,
LuxLib.NNlib.softplus,
LuxLib.NNlib.logsigmoid,
LuxLib.NNlib.swish,
LuxLib.NNlib.lisht,
Base.tanh,
LuxLib.NNlib.tanh_fast,
]
f_fast = LuxLib.Impl.sleefpirates_fast_act(f)
@eval @from_rrule DefaultCtx Tuple{typeof($f_fast),IEEEFloat}
@eval @from_rrule(
DefaultCtx,
Tuple{
typeof(Broadcast.broadcasted),
typeof($f_fast),
Union{IEEEFloat,Array{<:IEEEFloat}},
},
)
end

end

2 comments on commit 16b8500

@willtebbutt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/120737

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.58 -m "<description of version>" 16b8500615ccdd5544ce2155a3f38154174c6ac8
git push origin v0.4.58

Please sign in to comment.