Skip to content

Commit

Permalink
deploy: e1b5bad
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuseZ4 committed Dec 6, 2024
1 parent 6aa99e0 commit b9f762e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions getting_started/UsingEnzyme/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@
</code></pre></div><h3 id=semantic-options>Semantic options&nbsp;<a class=headline-hash href=#semantic-options></a></h3><h4 id=loose-type-analysis>Loose type analysis&nbsp;<a class=headline-hash href=#loose-type-analysis></a></h4><p>The <code>enzyme-loose-types</code> option tells Enzyme to make an educated guess about the type of a value it cannot prove, rather than emit a compile-time error and fail. This can be helpful for starting to bootstrap code with Enzyme but shouldn&rsquo;t be used in production as Enzyme may make an incorrect guess and create an incorrect gradient.</p><div class=highlight><pre class=chroma><code class=language-sh data-lang=sh>$ opt input.ll -load-pass-plugin<span class=o>=</span>./Enzyme/LLVMEnzyme-17.so.so -passes<span class=o>=</span>enzyme -enzyme-loose-types<span class=o>=</span><span class=m>1</span>
</code></pre></div><h4 id=assume-inactivity-of-undefined-functions>Assume inactivity of undefined functions&nbsp;<a class=headline-hash href=#assume-inactivity-of-undefined-functions></a></h4><p>The <code>enzyme-emptyfn-inactive</code> option tells activity analysis to assume that all calls to functions whose definitions aren&rsquo;t available and aren&rsquo;t explicitly given a custom gradient via metadata are assumed to be inactive. This can be useful for assuming printing functions don&rsquo;t impact derivative computations and provide a performance benefit, as well as getting around a compile-time error where the derivative of a foreign function is not known. However, this option should be used carefully as it may result in incorrect behavior if it is used to incorrectly assume a call to a foreign function doesn&rsquo;t impact the derivative computation. As a result, the recommended way to remedy this is to mark the function as inactive explicitly, or provide a custom gradient via metadata.</p><div class=highlight><pre class=chroma><code class=language-sh data-lang=sh>$ opt input.ll -load-pass-plugin<span class=o>=</span>./Enzyme/LLVMEnzyme-17.so.so -passes<span class=o>=</span>enzyme -enzyme-emptyfn-inactive<span class=o>=</span><span class=m>1</span>
</code></pre></div><h4 id=assume-inactivity-of-unmarked-globals>Assume inactivity of unmarked globals&nbsp;<a class=headline-hash href=#assume-inactivity-of-unmarked-globals></a></h4><p>The <code>enzyme-globals-default-inactive</code> option tells activity analysis to assume that global variables without an explicitly defined shadow global are assumed to be inactive. Like <code>enzyme_emptyfnconst</code>, this option should be used carefully as it may result in incorrect behavior if it is used to incorrectly assume that a global variable doesn&rsquo;t contain data used in a derivative computation.</p><div class=highlight><pre class=chroma><code class=language-sh data-lang=sh>$ opt input.ll -load-pass-plugin<span class=o>=</span>./Enzyme/LLVMEnzyme-17.so.so -passes<span class=o>=</span>enzyme -enzyme-globals-default-inactive<span class=o>=</span><span class=m>1</span>
</code></pre></div><h4 id=cache-behavior>Cache behavior&nbsp;<a class=headline-hash href=#cache-behavior></a></h4><p>The <code>enzyme-cache-never</code> option tells the cache to recompute all load values, even if alias analysis isn&rsquo;t able to prove the legality of such a recomputation. This may improve performance but is likely to result in incorrect derivatives being produced as this is not generally true.</p><div class=highlight><pre class=chroma><code class=language-sh data-lang=sh>$ opt input.ll -load-pass-plugin<span class=o>=</span>./Enzyme/LLVMEnzyme-17.so.so -passes<span class=o>=</span>enzyme -enzyme-cache-never<span class=o>=</span><span class=m>1</span>
</code></pre></div><p>In contrast, the <code>enzyme-cache-always</code> option tells the cache to still cache values that alias analysis and differential use analysis say are not needed to be cached (perhaps being legal to recompute instead). This will usually decrease performance and is intended for developers in order to catch caching bugs.</p><div class=highlight><pre class=chroma><code class=language-sh data-lang=sh>$ opt input.ll -load-pass-plugin<span class=o>=</span>./Enzyme/LLVMEnzyme-17.so.so -passes<span class=o>=</span>enzyme -enzyme-cache-always<span class=o>=</span><span class=m>1</span>
</code></pre></div><h3 id=debugging-options-for-developers>Debugging options for developers&nbsp;<a class=headline-hash href=#debugging-options-for-developers></a></h3><h4 id=enzyme-print>enzyme-print&nbsp;<a class=headline-hash href=#enzyme-print></a></h4><p>This option prints out functions being differentiated before preprocessing optimizations, after preprocessing optimizations, and after being synthesized by Enzyme. It is mostly use to debug the AD process.</p><div class=highlight><pre class=chroma><code class=language-sh data-lang=sh>$ opt input.ll -load-pass-plugin<span class=o>=</span>./Enzyme/LLVMEnzyme-17.so.so -passes<span class=o>=</span>enzyme -enzyme-print
prefn:

Expand Down

0 comments on commit b9f762e

Please sign in to comment.