File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
backends/candle/src/layers Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ impl HiddenAct {
16
16
match self {
17
17
Self :: Gelu => x. gelu ( ) ,
18
18
Self :: Relu => x. relu ( ) ,
19
- Self :: Swiglu => candle_nn:: ops:: swiglu ( x) ,
19
+ // NOTE: use SiLU instead candle's SwiGLU, as SwiGLU is SiLU + down projection
20
+ // to half size since we split on intermediate dimension
21
+ Self :: Swiglu => x. silu ( ) ,
20
22
}
21
23
}
22
24
}
@@ -80,7 +82,9 @@ impl Linear {
80
82
match act {
81
83
HiddenAct :: Gelu => x. gelu ( ) ,
82
84
HiddenAct :: Relu => x. relu ( ) ,
83
- HiddenAct :: Swiglu => candle_nn:: ops:: swiglu ( & x) ,
85
+ // NOTE: use SiLU instead candle's SwiGLU, as SwiGLU is SiLU + down projection
86
+ // to half size since we split on intermediate dimension
87
+ HiddenAct :: Swiglu => x. silu ( ) ,
84
88
}
85
89
} else {
86
90
Ok ( x)
You can’t perform that action at this time.
0 commit comments