ops: act_mul's relu, relu(x)^2 over one tensor

act_mul's `act` takes "relu": with one tensor in both operands it is relu(x)^2, Nemotron-H's
ungated expert activation and its vision projector's. libref, libavx and libr4d.
This commit is contained in:
keptn42 committed 2026-11-04 22:08:53 +01:00
1 parent 63416510a0
commit 2420b2b383
10 files changed
+42 -21

No files matched your search

+1 -1
View File
@@ -58,7 +58,7 @@ std::vector<Case> build_cases() {
add("scale", { HI("M", 6), HI("n", 645), HS("dtype", dt) }, EB(6, 645, w, 2));
add("softmax", { HI("M", 6), HI("n", 645), HS("dtype", dt) }, EB(6, 645, w, 2));
add("gather_rows", { HI("M", 6), HI("n", 640), HS("dtype", dt) }, EB(6, 640, w, 2));
for (const char* act : { "silu", "gelu", "gelu_tanh", "sigmoid", "quick_gelu" })
for (const char* act : { "silu", "gelu", "gelu_tanh", "sigmoid", "quick_gelu", "relu" })
add("act_mul", { HI("M", 6), HI("n", 645), HS("act", act), HS("dtype", dt) },
EB(6, 645, w, 3));
add("mul_weight", { HI("M", 9), HI("n", 645), HS("dtype", dt) }, EB(9, 645, w, 2));