diff options
| author | Yong He <yonghe@outlook.com> | 2023-03-09 15:53:51 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-09 15:53:51 -0800 |
| commit | e06cfb37eb099e45302dd015b0396bf26c913778 (patch) | |
| tree | 42c84f149aef80a06d5fbb649b5b7e5bcfd8814c /docs/user-guide | |
| parent | a611d4b20cdfab59efff1b7b7a980c6a8be40a30 (diff) | |
Update restrictions sections in autodiff doc. (#2694)
* Update restrictions section in autodiff doc.
* Update restrictions sections in autodiff doc.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'docs/user-guide')
| -rw-r--r-- | docs/user-guide/07-autodiff.md | 5 | ||||
| -rw-r--r-- | docs/user-guide/toc.html | 1 |
2 files changed, 3 insertions, 3 deletions
diff --git a/docs/user-guide/07-autodiff.md b/docs/user-guide/07-autodiff.md index 4a9bb92ab..aed6ad65e 100644 --- a/docs/user-guide/07-autodiff.md +++ b/docs/user-guide/07-autodiff.md @@ -635,9 +635,8 @@ An interface method requirement can be marked as `[ForwardDifferentiable]` or `[ The compiler can generate forward derivative and backward propagation implementations for most uses of array and struct types, including arbitrary read and write access at dynamic array indices, and supports uses of all types of control flows, mutable parameters, generics and interfaces. This covers the set of operations that is sufficient for a lot of functions. However, the user needs to be aware of the following restrictions when using automatic differentiation: -- No access to global variables or shader parameters within a differentiable function. -- All operations to global resources, including texture reads or atomic writes, are treating as a non-differentiable operation. +- All operations to global resources, global variables and shader parameters, including texture reads or atomic writes, are treating as a non-differentiable operation. - If a differentiable function contains calls that cause side-effects such as updates to global memory, there will not be a guarantee on how many times the side-effect will occur during the resulting derivative function or back-propagation function. -- Loops: In a backward differentiable function, loops currently cannot have `continue` statements although `break` statements are supported. Loops must use the attribute `[MaxIters(<count>)]` to specify a maximum number of iterations. This will be used by compiler to allocate space to store intermediate data. If the actual number of iterations exceeds the provided maximum, the behavior is undefined. You can always mark a loop with the `[ForceUnroll]` attribute to instruct the Slang compiler to unroll the loop before generating derivative propagation functions. Unrolled loops will be treated the same way as ordinary code and are not subject to any additional restrictions. +- Loops: Loops must use the attribute `[MaxIters(<count>)]` to specify a maximum number of iterations. This will be used by compiler to allocate space to store intermediate data. If the actual number of iterations exceeds the provided maximum, the behavior is undefined. You can always mark a loop with the `[ForceUnroll]` attribute to instruct the Slang compiler to unroll the loop before generating derivative propagation functions. Unrolled loops will be treated the same way as ordinary code and are not subject to any additional restrictions. The above restrictions do not apply if a user-defined derivative or backward propagation function is provided. diff --git a/docs/user-guide/toc.html b/docs/user-guide/toc.html index a956fa474..7900e127b 100644 --- a/docs/user-guide/toc.html +++ b/docs/user-guide/toc.html @@ -85,6 +85,7 @@ <li data-link="07-autodiff#forward-derivative-propagation-function"><span>Forward Derivative Propagation Function</span></li> <li data-link="07-autodiff#backward-derivative-propagation-function"><span>Backward Derivative Propagation Function</span></li> <li data-link="07-autodiff#builtin-differentiable-functions"><span>Builtin Differentiable Functions</span></li> +<li data-link="07-autodiff#primal-substitute-functions"><span>Primal Substitute Functions</span></li> <li data-link="07-autodiff#excluding-parameters-from-differentiation"><span>Excluding Parameters From Differentiation</span></li> <li data-link="07-autodiff#calling-non-differentiable-functions-from-a-differentiable-function"><span>Calling Non-Differentiable Functions from a Differentiable Function</span></li> <li data-link="07-autodiff#higher-order-differentiation"><span>Higher Order Differentiation</span></li> |
