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

Disable precompilation of BijectorsEnzymeExt on Julia 1.11+ #333

Closed
wants to merge 4 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/AD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Interface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Bijectors"
uuid = "76274a88-744f-5084-9051-94815aaf08c4"
version = "0.13.18"
version = "0.13.19"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
20 changes: 18 additions & 2 deletions ext/BijectorsEnzymeExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,23 @@ else
using ..Bijectors: find_alpha
end

@import_rrule typeof(find_alpha) Real Real Real
@import_frule typeof(find_alpha) Real Real Real
# Julia 1.11.1 caused a change in the ordering of precompilation for extensions.
# https://github.com/TuringLang/Bijectors.jl/issues/332
# See https://github.com/JuliaLang/julia/issues/56204
@static if v"1.11.1" <= VERSION < v"1.12"
function __init__()
if !Base.generating_output()
eval(
quote
@import_rrule typeof(find_alpha) Real Real Real
@import_frule typeof(find_alpha) Real Real Real
end,
)
end
end
else
@import_rrule typeof(find_alpha) Real Real Real
@import_frule typeof(find_alpha) Real Real Real
end

end
5 changes: 3 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Bijectors

using ChainRulesTestUtils
using Combinatorics
using DistributionsAD
Expand All @@ -12,6 +10,9 @@ using ReverseDiff
using Tracker
using Zygote

# Place below `using Enzyme`, see https://github.com/TuringLang/Bijectors.jl/pull/333
using Bijectors

using Random, LinearAlgebra, Test

using Bijectors:
Expand Down
Loading