MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_vec_silu_backward_f32

Function ggml_vec_silu_backward_f32

ggml.c:1501–1509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1499
1500#ifdef GGML_SILU_FP16
1501inline static void ggml_vec_silu_backward_f32(const int n, float * dx, const float * x, const float * dy) {
1502 for (int i = 0; i < n; ++i) {
1503 // we did not use x[i] to compute forward silu but its f16 equivalent
1504 // take derivative at f16 of x[i]:
1505 ggml_fp16_t fp16 = GGML_FP32_TO_FP16(x[i]);
1506 float usedx = GGML_FP16_TO_FP32(fp16);
1507 dx[i] = ggml_silu_backward_f32(usedx, dy[i]);
1508 }
1509}
1510#else
1511inline static void ggml_vec_silu_backward_f32(const int n, float * dx, const float * x, const float * dy) {
1512 for (int i = 0; i < n; ++i) {

Callers 1

Calls 1

ggml_silu_backward_f32Function · 0.70

Tested by

no test coverage detected