Skip to content

Commit

Permalink
Deprecate setadbackend and update HISTORY file (#2144)
Browse files Browse the repository at this point in the history
* Update `HISTORY` file

* Remove version limit on `SciMLBase`

* Add deprecation messages

* Update HISTORY.md

* Revert compat change for `SciMLBase`
  • Loading branch information
sunxd3 committed Dec 17, 2023
1 parent 521f791 commit d0691e0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
7 changes: 7 additions & 0 deletions HISTORY.md
@@ -1,3 +1,10 @@
# Release 0.30.0

- Replaced global variable-based AD backend mechanism with [`ADTypes.jl`](https://github.com/SciML/ADTypes.jl). Users should now specify the desired `ADType` directly in sampler constructors, e.g., `HMC(0.1, 10; adtype=AutoForwardDiff(; chunksize))`.
- Interface functions such as `ADBackend`, `setadbackend`, `setadsafe`, `setchunksize`, and `setrdcache` are deprecated and will be removed in a future release.
- Removed the outdated `verifygrad` function.
- Updated to a newer version of `LogDensityProblemsAD` (v1.7).

# Release 0.12.0

- The interface for defining new distributions with a constrained support and making them compatible with `Turing` has changed. To make a custom distribution type `CustomDistribution` compatible with `Turing`, the user needs to define the method `bijector(d::CustomDistribution)` that returns an instance of type `Bijector` implementing the `Bijectors.Bijector` API.
Expand Down
8 changes: 7 additions & 1 deletion src/Turing.jl
Expand Up @@ -54,6 +54,8 @@ using .Variational
include("optimisation/Optimisation.jl")
using .Optimisation

include("deprecated.jl") # to be removed in the next minor version release

###########
# Exports #
###########
Expand Down Expand Up @@ -129,7 +131,11 @@ export @model, # modelling
get_parameter_bounds,
optim_objective,
optim_function,
optim_problem
optim_problem,

setbackend, # deprecated
setchunksize,
setadsafe

if !isdefined(Base, :get_extension)
using Requires
Expand Down
19 changes: 19 additions & 0 deletions src/deprecated.jl
@@ -0,0 +1,19 @@
function setbackend(::Union{Symbol, Val})
Base.depwarn("`ADBACKEND` and `setbackend` are deprecated. Please specify the chunk size directly in the sampler constructor, e.g., `HMC(0.1, 5; adtype=AutoForwardDiff(; chunksize=0))`.\n This function has no effects.", :setbackend; force=true)
nothing
end

function setchunksize(::Int)
Base.depwarn("`CHUNKSIZE` and `setchunksize` are deprecated. Please specify the chunk size directly in the sampler constructor, e.g., `HMC(0.1, 5; adtype=AutoForwardDiff(; chunksize=0))`.\n This function has no effects.", :setchunksize; force=true)
nothing
end

function setrdcache(::Bool)
Base.depwarn("`RDCACHE` and `setrdcache` are deprecated. Please specify the chunk size directly in the sampler constructor, e.g., `HMC(0.1, 5; adtype=AutoReverseDiff(false))`.\n This function has no effects.", :setrdcache; force=true)
nothing
end

function setadsafe(::Bool)
Base.depwarn("`ADSAFE` and `setadsafe` are outdated and no longer in use.", :setadsafe; force=true)
nothing
end

0 comments on commit d0691e0

Please sign in to comment.