[object Object][object Object][object Object]undefined
[object Object]
  • Description: Updates the outputs of two FlashAttention operations based on their different softmax max and sum values. The difference from the interface is: in the scenario where the input layout is TND, the data layout of the softmax-related inputs in the original [object Object] interface is BNS8, while the [object Object] interface supports passing a string parameter [object Object] to control whether the data layout of the softmax-related inputs is consistent with the attention layout (the TND layout).
  • Formula:
softmax_max=max(prev_softmax_max,cur_softmax_max)softmax\_max = max(prev\_softmax\_max, cur\_softmax\_max) softmax_sum=prev_softmax_sumexp(prev_softmax_maxsoftmax_max)+cur_softmax_sumexp(cur_softmax_maxsoftmax_max)softmax\_sum = prev\_softmax\_sum * exp(prev\_softmax\_max - softmax\_max) + cur\_softmax\_sum * exp(cur\_softmax\_max - softmax\_max) attn_out=prev_attn_outexp(prev_softmax_maxsoftmax_max)prev_softmax_sum/softmax_sum+cur_attn_outexp(cur_softmax_maxsoftmax_max)cur_softmax_sum/softmax_sumattn\_out = prev\_attn\_out * exp(prev\_softmax\_max - softmax\_max) * prev\_softmax\_sum / softmax\_sum + cur\_attn\_out * exp(cur\_softmax\_max - softmax\_max) * cur\_softmax\_sum / softmax\_sum [object Object]
  • Each operator is divided into a . It is necessary to first call the [object Object] interface to obtain the required workspace size for computation and the executor that includes the operator's computation process, and then call the [object Object] interface to perform the computation.
[object Object]
[object Object]
[object Object]
  • Parameters:

    [object Object]
  • Returns:

    aclnnStatus: Returns the status code, for details see .

    The first-phase API implements input parameter verification. The following errors may be thrown.

    [object Object]
[object Object]
  • Parameters:

    [object Object]
  • Returns:

    aclnnStatus: Returns the status code, for details see .

[object Object]
  • Deterministic computation:
    • [object Object] defaults to deterministic implementation.
  • When [object Object] is TND, the last dimension of [object Object] must be a multiple of 64.
  • When [object Object] is TND, [object Object] is required.
  • When [object Object] is TND, N must be less than or equal to 256, and D must be less than or equal to 768.
  • When [object Object] is TND, [object Object] takes effect. [object Object] only supports three inputs: empty string, "SBH", "TND"
[object Object]

The following example is for reference only. For details, see .

[object Object]