deep.gpu.fastAttentionAlgorithms
Disable fast attention algorithms used by deep learning operations on the GPU
Since R2026a
Syntax
Description
returns the current state of the GPU fast attention algorithms option as
previousState = deep.gpu.fastAttentionAlgorithms(newState)1 (true) or 0
(false) before changing the state according to the input
newState. The default is 1
(true). This function requires Parallel Computing Toolbox™.
If newState is 1 (true), then
subsequent calls to GPU deep learning attention operations use algorithms optimized for
performance. These algorithms achieve improved performance by using reduced-precision
arithmetic, that is, arithmetic that uses fewer bits than single-precision arithmetic. If
newState is 0 (false), then
subsequent calls to GPU deep learning attention operations use higher-precision algorithms
at the cost of performance.
returns the current state of GPU fast attention algorithms option as state = deep.gpu.fastAttentionAlgorithms1
(true) or 0 (false).
Tip
Use this function if your training loss is NaN and normalizing
your training data does not resolve the issue. For more information about normalizing
training data, see Normalize Sequence Data.
Examples
Input Arguments
Version History
Introduced in R2026a
See Also
selfAttentionLayer | attentionLayer | attention | gpuArray (Parallel Computing Toolbox)