Skip to content

Commit 1a6d726

Browse files
committed
Add Mooncake note on AD
1 parent 6625db8 commit 1a6d726

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

usage/automatic-differentiation/index.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ For `ForwardDiff`, pass `adtype=AutoForwardDiff(; chunksize)` to the sampler con
2424

2525
For `ReverseDiff`, pass `adtype=AutoReverseDiff()` to the sampler constructor. An additional keyword argument called `compile` can be provided to `AutoReverseDiff`. It specifies whether to pre-record the tape only once and reuse it later (`compile` is set to `false` by default, which means no pre-recording). This can substantially improve performance, but risks silently incorrect results if not used with care.
2626

27-
28-
2927
Pre-recorded tapes should only be used if you are absolutely certain that the sequence of operations performed in your code does not change between different executions of your model.
3028

3129
Thus, e.g., in the model definition and all implicitly and explicitly called functions in the model, all loops should be of fixed size, and `if`-statements should consistently execute the same branches.
3230
For instance, `if`-statements with conditions that can be determined at compile time or conditions that depend only on fixed properties of the model, e.g. fixed data.
3331
However, `if`-statements that depend on the model parameters can take different branches during sampling; hence, the compiled tape might be incorrect.
3432
Thus you must not use compiled tapes when your model makes decisions based on the model parameters, and you should be careful if you compute functions of parameters that those functions do not have branching which might cause them to execute different code for different values of the parameter.
3533

36-
And the previously used interface functions including `ADBackend`, `setadbackend`, `setsafe`, `setchunksize`, and `setrdcache` are deprecated and removed.
34+
The previously used interface functions including `ADBackend`, `setadbackend`, `setsafe`, `setchunksize`, and `setrdcache` have been removed.
35+
36+
For `Mooncake`, pass `adtype=AutoMooncake(; config=nothing)` to the sampler constructor.
3737

3838
## Compositional Sampling with Differing AD Modes
3939

0 commit comments

Comments
 (0)