Skip to content

Commit 89f360d

Browse files
authored
Fix list of important limitations in the FAQ (#649)
* Fix list of important limitations * Catch more spaces needed for lists
1 parent 6555834 commit 89f360d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

faq/index.qmd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ sample(m2, NUTS(), 100) # This doesn't work!
4141
The key insight is that `filldist` creates a single distribution (not N independent distributions), which is why you cannot condition on individual elements. The distinction is not just about what appears on the LHS of `~`, but whether you're dealing with separate distributions (`.~` with univariate) or a single distribution over multiple values (`~` with multivariate or `filldist`).
4242

4343
To understand more about how Turing determines whether a variable is treated as random or observed, see:
44+
4445
- [Core Functionality]({{< meta core-functionality >}}) - basic explanation of the `~` notation and conditioning
4546

4647

@@ -50,6 +51,7 @@ Yes, but with important caveats! There are two types of parallelism to consider:
5051

5152
### 1. Parallel Sampling (Multiple Chains)
5253
Turing.jl fully supports sampling multiple chains in parallel:
54+
5355
- **Multithreaded sampling**: Use `MCMCThreads()` to run one chain per thread
5456
- **Distributed sampling**: Use `MCMCDistributed()` for distributed computing
5557

@@ -69,6 +71,7 @@ end
6971
```
7072

7173
**Important limitations:**
74+
7275
- **Observe statements**: Generally safe to use in threaded loops
7376
- **Assume statements** (sampling statements): Often crash unpredictably or produce incorrect results
7477
- **AD backend compatibility**: Many AD backends don't support threading. Check the [multithreaded column in ADTests](https://turinglang.org/ADTests/) for compatibility
@@ -78,12 +81,14 @@ For safe parallelism within models, consider vectorized operations instead of ex
7881
## How do I check the type stability of my Turing model?
7982

8083
Type stability is crucial for performance. Check out:
84+
8185
- [Performance Tips]({{< meta usage-performance-tips >}}) - includes specific advice on type stability
8286
- Use `DynamicPPL.DebugUtils.model_warntype` to check type stability of your model
8387

8488
## How do I debug my Turing model?
8589

8690
For debugging both statistical and syntactical issues:
91+
8792
- [Troubleshooting Guide]({{< meta usage-troubleshooting >}}) - common errors and their solutions
8893
- For more advanced debugging, DynamicPPL provides [the `DynamicPPL.DebugUtils` module](https://turinglang.org/DynamicPPL.jl/stable/api/#Debugging-Utilities) for inspecting model internals
8994

@@ -125,16 +130,18 @@ end
125130
## Which automatic differentiation backend should I use?
126131

127132
The choice of AD backend can significantly impact performance. See:
133+
128134
- [Automatic Differentiation Guide]({{< meta usage-automatic-differentiation >}}) - comprehensive comparison of ForwardDiff, Mooncake, ReverseDiff, and other backends
129135
- [Performance Tips]({{< meta usage-performance-tips >}}#choose-your-ad-backend) - quick guide on choosing backends
130136
- [AD Backend Benchmarks](https://turinglang.org/ADTests/) - performance comparisons across various models
131137

132138
## I changed one line of my model and now it's so much slower; why?
133139

134140
Small changes can have big performance impacts. Common culprits include:
141+
135142
- Type instability introduced by the change
136143
- Switching from vectorized to scalar operations (or vice versa)
137144
- Inadvertently causing AD backend incompatibilities
138145
- Breaking assumptions that allowed compiler optimizations
139146

140-
See our [Performance Tips]({{< meta usage-performance-tips >}}) and [Troubleshooting Guide]({{< meta usage-troubleshooting >}}) for debugging performance regressions.
147+
See our [Performance Tips]({{< meta usage-performance-tips >}}) and [Troubleshooting Guide]({{< meta usage-troubleshooting >}}) for debugging performance regressions.

0 commit comments

Comments
 (0)