Softmax kernels for BF16 tensors. More...
Go to the source code of this file.
Functions | |
| void | backward_causal_softmax_head_major_bf16 (uint16_t *d_scores, const uint16_t *weights, int num_heads, int num_tokens, int aligned_context_window, float *scratch_d_scores, float *scratch_weights) |
| void | causal_softmax_head_major_bf16 (uint16_t *scores, int num_heads, int num_tokens, int aligned_context_window, float *scratch) |
Softmax kernels for BF16 tensors.
After changes: make test && make llamacpp-parity-full
Softmax: y[i] = exp(x[i] - max(x)) / sum(exp(x - max(x)))
Definition in file softmax_kernels_bf16.c.
| void backward_causal_softmax_head_major_bf16 | ( | uint16_t * | d_scores, |
| const uint16_t * | weights, | ||
| int | num_heads, | ||
| int | num_tokens, | ||
| int | aligned_context_window, | ||
| float * | scratch_d_scores, | ||
| float * | scratch_weights | ||
| ) |
Definition at line 53 of file softmax_kernels_bf16.c.
References backward_causal_softmax_head_major(), bf16_tensor_to_float(), and float_tensor_to_bf16().
| void causal_softmax_head_major_bf16 | ( | uint16_t * | scores, |
| int | num_heads, | ||
| int | num_tokens, | ||
| int | aligned_context_window, | ||
| float * | scratch | ||
| ) |
Definition at line 31 of file softmax_kernels_bf16.c.
References bf16_tensor_to_float(), causal_softmax_head_major(), and float_tensor_to_bf16().