File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
src/axolotl/integrations/liger Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -185,5 +185,7 @@ def _liger_rms_norm_wrapper(dim, **kwargs):
185
185
rms_norm = cfg .liger_rms_norm ,
186
186
layer_norm = cfg .liger_layer_norm ,
187
187
)
188
- elif cfg .model_config_type in ["deepseek_v3" ]:
189
- raise ValueError (f"Unsupported model config type: { cfg .model_config_type } " )
188
+ else :
189
+ logging .warning (
190
+ f"Unsupported model config type: { cfg .model_config_type } . Liger not applied."
191
+ )
Original file line number Diff line number Diff line change 3
3
"""
4
4
5
5
import sys
6
+ from copy import deepcopy
6
7
from typing import List , Optional , Tuple , Union
7
8
8
9
import torch
@@ -158,7 +159,16 @@ def apply_liger_kernel_to_llama4(
158
159
if rms_norm :
159
160
modeling_llama4 .Llama4TextRMSNorm = LigerRMSNorm
160
161
if glu_activation :
161
- modeling_llama4 .Llama4TextMLP = LigerSwiGLUMLP
162
+
163
+ def _liger_swiglu_mlp_wrapper (config , intermediate_size = None , ** kwargs ):
164
+ "Accepts intermediate_size to pass to LigerSwiGLUMLP"
165
+ # clone config to avoid modifying the original
166
+ config = deepcopy (config )
167
+ if intermediate_size :
168
+ setattr (config , "intermediate_size" , intermediate_size )
169
+ return LigerSwiGLUMLP (config , ** kwargs )
170
+
171
+ modeling_llama4 .Llama4TextMLP = _liger_swiglu_mlp_wrapper
162
172
if layer_norm :
163
173
modeling_llama4 .nn .LayerNorm = LigerLayerNorm
164
174
You can’t perform that action at this time.
0 commit comments