You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"standard" => Trial(478.295 μs)</code></pre><h2id="API"><aclass="docs-heading-anchor" href="#API">API</a><aid="API-1"></a><aclass="docs-heading-anchor-permalink" href="#API" title="Permalink"></a></h2><ul><li><ahref="#TuringBenchmarking.benchmark_model-Tuple{DynamicPPL.Model}"><code>TuringBenchmarking.benchmark_model</code></a></li><li><ahref="#TuringBenchmarking.extract_stan_data"><code>TuringBenchmarking.extract_stan_data</code></a></li><li><ahref="#TuringBenchmarking.make_stan_suite"><code>TuringBenchmarking.make_stan_suite</code></a></li><li><ahref="#TuringBenchmarking.make_turing_suite-Tuple{DynamicPPL.Model}"><code>TuringBenchmarking.make_turing_suite</code></a></li><li><ahref="#TuringBenchmarking.stan_model_string"><code>TuringBenchmarking.stan_model_string</code></a></li></ul><articleclass="docstring"><header><aclass="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><aclass="docstring-binding" href="#TuringBenchmarking.benchmark_model-Tuple{DynamicPPL.Model}" id="TuringBenchmarking.benchmark_model-Tuple{DynamicPPL.Model}"><code>TuringBenchmarking.benchmark_model</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia hljs">benchmark_model(model::Turing.Model; suite_kwargs..., kwargs...)</code></pre><p>Create and run a benchmark suite for <code>model</code>.</p><p>The benchmarking suite will be created using <ahref="#TuringBenchmarking.make_turing_suite-Tuple{DynamicPPL.Model}"><code>make_turing_suite</code></a>. See <ahref="#TuringBenchmarking.make_turing_suite-Tuple{DynamicPPL.Model}"><code>make_turing_suite</code></a> for the available keyword arguments and more information.</p><p><strong>Keyword arguments</strong></p><ul><li><code>suite_kwargs</code>: Keyword arguments passed to <ahref="#TuringBenchmarking.make_turing_suite-Tuple{DynamicPPL.Model}"><code>make_turing_suite</code></a>.</li><li><code>kwargs</code>: Keyword arguments passed to <code>BenchmarkTools.run</code>.</li></ul></div><aclass="docs-sourcelink" href="https://github.com/TuringLang/TuringBenchmarking.jl/blob/c9d62d39926910fed351e87d562bd9e71ee8c7bd/src/TuringBenchmarking.jl#L64-L75" target="_blank">source</a></section></article><articleclass="docstring"><header><aclass="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><aclass="docstring-binding" href="#TuringBenchmarking.extract_stan_data" id="TuringBenchmarking.extract_stan_data"><code>TuringBenchmarking.extract_stan_data</code></a> — <spanclass="docstring-category">Function</span></header><section><div><pre><codeclass="language-julia hljs">extract_stan_data(model::DynamicPPL.Model)</code></pre><p>Return the data in <code>model</code> in a format consumable by the corresponding Stan model.</p><p>The Stan model requires the return data to be either</p><ol><li>A JSON string representing a dictionary with the data.</li><li>A path to a data file ending in <code>.json</code>.</li></ol></div><aclass="docs-sourcelink" href="https://github.com/TuringLang/TuringBenchmarking.jl/blob/c9d62d39926910fed351e87d562bd9e71ee8c7bd/src/TuringBenchmarking.jl#L315-L323" target="_blank">source</a></section></article><articleclass="docstring"><header><aclass="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><aclass="docstring-binding" href="#TuringBenchmarking.make_stan_suite" id="TuringBenchmarking.make_stan_suite"><code>TuringBenchmarking.make_stan_suite</code></a> — <spanclass="docstring-category">Function</span></header><section><div><pre><codeclass="language-julia hljs">make_stan_suite(model::Turing.Model; kwargs...)</code></pre><p>Create default benchmark suite for the Stan model corresponding to <code>model</code>.</p></div><aclass="docs-sourcelink" href="https://github.com/TuringLang/TuringBenchmarking.jl/blob/c9d62d39926910fed351e87d562bd9e71ee8c7bd/src/TuringBenchmarking.jl#L333-L337" target="_blank">source</a></section></article><articleclass="docstring"><header><aclass="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><aclass="docstring-binding" href="#TuringBenchmarking.make_turing_suite-Tuple{DynamicPPL.Model}" id="TuringBenchmarking.make_turing_suite-Tuple{DynamicPPL.Model}"><code>TuringBenchmarking.make_turing_suite</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia hljs">make_turing_suite(model::Turing.Model; kwargs...)</code></pre><p>Create default benchmark suite for <code>model</code>.</p><p><strong>Keyword arguments</strong></p><ul><li><code>adbackends</code>: a collection of adbackends to use, specified either as a type from</li></ul><p>ADTypes.jl or using a <code>Symbol</code>. Defaults to <code>ADTypes.AbstractADType[ADTypes.AutoForwardDiff{0, Nothing}(nothing), ADTypes.AutoReverseDiff(false), ADTypes.AutoReverseDiff(true), ADTypes.AutoZygote()]</code>.</p><ul><li><code>run_once=true</code>: if <code>true</code>, the body of each benchmark will be run once to avoid compilation to be included in the timings (this may occur if compilation runs longer than the allowed time limit).</li><li><code>check=false</code>: if <code>true</code>, the log-density evaluations and the gradients will be compared against each other to ensure that they are consistent. Note that this will force <code>run_once=true</code>.</li><li><code>error_on_failed_check=false</code>: if <code>true</code>, an error will be thrown if the check fails rather than just printing a warning, as is done by default.</li><li><code>error_on_failed_backend=false</code>: if <code>true</code>, an error will be thrown if the evaluation of the log-density or the gradient fails for any of the backends rather than just printing a warning, as is done by default.</li><li><code>varinfo</code>: the <code>VarInfo</code> to use. Defaults to <code>DynamicPPL.VarInfo(model)</code>.</li><li><code>sampler</code>: the <code>Sampler</code> to use. Defaults to <code>nothing</code> (i.e. no sampler).</li><li><code>context</code>: the <code>Context</code> to use. Defaults to <code>DynamicPPL.DefaultContext()</code>.</li><li><code>θ</code>: the parameters to use. Defaults to <code>rand(Vector, model)</code>.</li><li><code>θ_linked</code>: the linked parameters to use. Defaults to <code>randn(d)</code> where <code>d</code> is the length of the linked parameters..</li><li><code>atol</code>: the absolute tolerance to use for comparisons.</li><li><code>rtol</code>: the relative tolerance to use for comparisons.</li></ul><p><strong>Notes</strong></p><ul><li>A separate "parameter" instance (<code>DynamicPPL.VarInfo</code>) will be created for <em>each test</em>. Hence if you have a particularly large model, you might want to only pass one <code>adbackend</code> at the time.</li></ul></div><aclass="docs-sourcelink" href="https://github.com/TuringLang/TuringBenchmarking.jl/blob/c9d62d39926910fed351e87d562bd9e71ee8c7bd/src/TuringBenchmarking.jl#L110-L142" target="_blank">source</a></section></article><articleclass="docstring"><header><aclass="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><aclass="docstring-binding" href="#TuringBenchmarking.stan_model_string" id="TuringBenchmarking.stan_model_string"><code>TuringBenchmarking.stan_model_string</code></a> — <spanclass="docstring-category">Function</span></header><section><div><pre><codeclass="language-julia hljs">stan_model_string(model::DynamicPPL.Model)</code></pre><p>Return a string defining the Stan model corresponding to <code>model</code>.</p></div><aclass="docs-sourcelink" href="https://github.com/TuringLang/TuringBenchmarking.jl/blob/c9d62d39926910fed351e87d562bd9e71ee8c7bd/src/TuringBenchmarking.jl#L326-L330" target="_blank">source</a></section></article></article><navclass="docs-footer"><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal" id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label></p><divclass="select"><selectid="documenter-themepicker"><optionvalue="auto">Automatic (OS)</option><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option></select></div><p></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.0 on <spanclass="colophon-date" title="Wednesday 24 April 2024 14:24">Wednesday 24 April 2024</span>. Using Julia version 1.10.2.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body></HTML>
35
+
"linked" => Trial(554.251 μs)
36
+
"standard" => Trial(531.370 μs)</code></pre><h2id="API"><aclass="docs-heading-anchor" href="#API">API</a><aid="API-1"></a><aclass="docs-heading-anchor-permalink" href="#API" title="Permalink"></a></h2><ul><li><ahref="#TuringBenchmarking.benchmark_model-Tuple{DynamicPPL.Model}"><code>TuringBenchmarking.benchmark_model</code></a></li><li><ahref="#TuringBenchmarking.extract_stan_data"><code>TuringBenchmarking.extract_stan_data</code></a></li><li><ahref="#TuringBenchmarking.make_stan_suite"><code>TuringBenchmarking.make_stan_suite</code></a></li><li><ahref="#TuringBenchmarking.make_turing_suite-Tuple{DynamicPPL.Model}"><code>TuringBenchmarking.make_turing_suite</code></a></li><li><ahref="#TuringBenchmarking.stan_model_string"><code>TuringBenchmarking.stan_model_string</code></a></li></ul><articleclass="docstring"><header><aclass="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><aclass="docstring-binding" href="#TuringBenchmarking.benchmark_model-Tuple{DynamicPPL.Model}" id="TuringBenchmarking.benchmark_model-Tuple{DynamicPPL.Model}"><code>TuringBenchmarking.benchmark_model</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia hljs">benchmark_model(model::Turing.Model; suite_kwargs..., kwargs...)</code></pre><p>Create and run a benchmark suite for <code>model</code>.</p><p>The benchmarking suite will be created using <ahref="#TuringBenchmarking.make_turing_suite-Tuple{DynamicPPL.Model}"><code>make_turing_suite</code></a>. See <ahref="#TuringBenchmarking.make_turing_suite-Tuple{DynamicPPL.Model}"><code>make_turing_suite</code></a> for the available keyword arguments and more information.</p><p><strong>Keyword arguments</strong></p><ul><li><code>suite_kwargs</code>: Keyword arguments passed to <ahref="#TuringBenchmarking.make_turing_suite-Tuple{DynamicPPL.Model}"><code>make_turing_suite</code></a>.</li><li><code>kwargs</code>: Keyword arguments passed to <code>BenchmarkTools.run</code>.</li></ul></div><aclass="docs-sourcelink" href="https://github.com/TuringLang/TuringBenchmarking.jl/blob/daa41c8e43fdcf5a41d71c234ea8fb6980649799/src/TuringBenchmarking.jl#L64-L75" target="_blank">source</a></section></article><articleclass="docstring"><header><aclass="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><aclass="docstring-binding" href="#TuringBenchmarking.extract_stan_data" id="TuringBenchmarking.extract_stan_data"><code>TuringBenchmarking.extract_stan_data</code></a> — <spanclass="docstring-category">Function</span></header><section><div><pre><codeclass="language-julia hljs">extract_stan_data(model::DynamicPPL.Model)</code></pre><p>Return the data in <code>model</code> in a format consumable by the corresponding Stan model.</p><p>The Stan model requires the return data to be either</p><ol><li>A JSON string representing a dictionary with the data.</li><li>A path to a data file ending in <code>.json</code>.</li></ol></div><aclass="docs-sourcelink" href="https://github.com/TuringLang/TuringBenchmarking.jl/blob/daa41c8e43fdcf5a41d71c234ea8fb6980649799/src/TuringBenchmarking.jl#L315-L323" target="_blank">source</a></section></article><articleclass="docstring"><header><aclass="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><aclass="docstring-binding" href="#TuringBenchmarking.make_stan_suite" id="TuringBenchmarking.make_stan_suite"><code>TuringBenchmarking.make_stan_suite</code></a> — <spanclass="docstring-category">Function</span></header><section><div><pre><codeclass="language-julia hljs">make_stan_suite(model::Turing.Model; kwargs...)</code></pre><p>Create default benchmark suite for the Stan model corresponding to <code>model</code>.</p></div><aclass="docs-sourcelink" href="https://github.com/TuringLang/TuringBenchmarking.jl/blob/daa41c8e43fdcf5a41d71c234ea8fb6980649799/src/TuringBenchmarking.jl#L333-L337" target="_blank">source</a></section></article><articleclass="docstring"><header><aclass="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><aclass="docstring-binding" href="#TuringBenchmarking.make_turing_suite-Tuple{DynamicPPL.Model}" id="TuringBenchmarking.make_turing_suite-Tuple{DynamicPPL.Model}"><code>TuringBenchmarking.make_turing_suite</code></a> — <spanclass="docstring-category">Method</span></header><section><div><pre><codeclass="language-julia hljs">make_turing_suite(model::Turing.Model; kwargs...)</code></pre><p>Create default benchmark suite for <code>model</code>.</p><p><strong>Keyword arguments</strong></p><ul><li><code>adbackends</code>: a collection of adbackends to use, specified either as a type from</li></ul><p>ADTypes.jl or using a <code>Symbol</code>. Defaults to <code>ADTypes.AbstractADType[ADTypes.AutoForwardDiff{0, Nothing}(nothing), ADTypes.AutoReverseDiff(false), ADTypes.AutoReverseDiff(true), ADTypes.AutoZygote()]</code>.</p><ul><li><code>run_once=true</code>: if <code>true</code>, the body of each benchmark will be run once to avoid compilation to be included in the timings (this may occur if compilation runs longer than the allowed time limit).</li><li><code>check=false</code>: if <code>true</code>, the log-density evaluations and the gradients will be compared against each other to ensure that they are consistent. Note that this will force <code>run_once=true</code>.</li><li><code>error_on_failed_check=false</code>: if <code>true</code>, an error will be thrown if the check fails rather than just printing a warning, as is done by default.</li><li><code>error_on_failed_backend=false</code>: if <code>true</code>, an error will be thrown if the evaluation of the log-density or the gradient fails for any of the backends rather than just printing a warning, as is done by default.</li><li><code>varinfo</code>: the <code>VarInfo</code> to use. Defaults to <code>DynamicPPL.VarInfo(model)</code>.</li><li><code>sampler</code>: the <code>Sampler</code> to use. Defaults to <code>nothing</code> (i.e. no sampler).</li><li><code>context</code>: the <code>Context</code> to use. Defaults to <code>DynamicPPL.DefaultContext()</code>.</li><li><code>θ</code>: the parameters to use. Defaults to <code>rand(Vector, model)</code>.</li><li><code>θ_linked</code>: the linked parameters to use. Defaults to <code>randn(d)</code> where <code>d</code> is the length of the linked parameters..</li><li><code>atol</code>: the absolute tolerance to use for comparisons.</li><li><code>rtol</code>: the relative tolerance to use for comparisons.</li></ul><p><strong>Notes</strong></p><ul><li>A separate "parameter" instance (<code>DynamicPPL.VarInfo</code>) will be created for <em>each test</em>. Hence if you have a particularly large model, you might want to only pass one <code>adbackend</code> at the time.</li></ul></div><aclass="docs-sourcelink" href="https://github.com/TuringLang/TuringBenchmarking.jl/blob/daa41c8e43fdcf5a41d71c234ea8fb6980649799/src/TuringBenchmarking.jl#L110-L142" target="_blank">source</a></section></article><articleclass="docstring"><header><aclass="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><aclass="docstring-binding" href="#TuringBenchmarking.stan_model_string" id="TuringBenchmarking.stan_model_string"><code>TuringBenchmarking.stan_model_string</code></a> — <spanclass="docstring-category">Function</span></header><section><div><pre><codeclass="language-julia hljs">stan_model_string(model::DynamicPPL.Model)</code></pre><p>Return a string defining the Stan model corresponding to <code>model</code>.</p></div><aclass="docs-sourcelink" href="https://github.com/TuringLang/TuringBenchmarking.jl/blob/daa41c8e43fdcf5a41d71c234ea8fb6980649799/src/TuringBenchmarking.jl#L326-L330" target="_blank">source</a></section></article></article><navclass="docs-footer"><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal" id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label></p><divclass="select"><selectid="documenter-themepicker"><optionvalue="auto">Automatic (OS)</option><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option></select></div><p></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <spanclass="colophon-date" title="Sunday 5 May 2024 15:49">Sunday 5 May 2024</span>. Using Julia version 1.10.3.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body></HTML>
0 commit comments