Skip to content

Commit ba7e108

Browse files
committed
filter out router
Signed-off-by: Will Johnson <[email protected]>
1 parent afbf918 commit ba7e108

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugins/accelerated-moe/src/fms_acceleration_moe/utils/checkpoint_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,11 @@ def save_fsdp_optimizer(
113113
(model_state_dict, optimizer_state_dict) = get_state_dict(model, optimizer)
114114

115115
# filter out lora state dict
116+
# TODO: Once expert layers are supported for LoRA tuning
117+
# remove the "router" filtering
116118
lora_state_dict = {
117-
k: v for k, v in model_state_dict.items() if "lora_A" in k or "lora_B" in k
119+
k: v for k, v in model_state_dict.items()
120+
if ("lora_A" in k or "lora_B" in k) and "router" not in k
118121
}
119122

120123
# - save model

0 commit comments

Comments
 (0)