Skip to content

Commit 975e6c4

Browse files
committed
don't fall through to the final component when the dotted name contains
a known prefix like shared_expert Signed-off-by: Aurelien Chartier <2567591+achartier@users.noreply.github.com>
1 parent c02eaae commit 975e6c4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tensorrt_llm/lora_manager.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,14 @@ def iterate_hf_lora(
156156
hf_module = module_name
157157

158158
# If module_name contains dots (e.g., "shared_expert.down_proj"),
159-
# extract just the final component (e.g., "down_proj")
159+
# extract just the final component (e.g., "down_proj").
160+
# Skip this fallback for shared_expert modules to avoid
161+
# silently mapping them to the wrong mlp_* module type.
160162
if hf_module not in hf_modules and "." in hf_module:
161-
final_component = hf_module.split(".")[-1]
162-
if final_component in hf_modules:
163-
hf_module = final_component
163+
if not hf_module.startswith("shared_expert."):
164+
final_component = hf_module.split(".")[-1]
165+
if final_component in hf_modules:
166+
hf_module = final_component
164167

165168
if hf_module not in hf_modules:
166169
# Skip modules not in the supported mapping (only log once per module type)

0 commit comments

Comments
 (0)