Skip to content

Commit 215b95c

Browse files
committed
rebase
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
1 parent d1a8ee2 commit 215b95c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/llmcompressor/modeling/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from .llama4 import SequentialLlama4TextMoe # noqa: F401
1515
from .qwen3_moe import CalibrationQwen3MoeSparseMoeBlock # noqa: F401
1616
from .qwen3_vl_moe import CalibrateQwen3VLMoeTextSparseMoeBlock # noqa: F401
17+
from .qwen3_next_moe import CalibrationQwen3NextSparseMoeBlock # noqa: F401
1718
# TODO: add granite4, Qwen3Next
1819

1920
from .fuse import *

src/llmcompressor/modeling/moe_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def moe_calibration_context(
133133
yield
134134
finally:
135135
# Step 2: Restore non-permanent modules
136-
for name, (_original, replacement) in replaced.items():
136+
for name, (original, replacement) in replaced.items():
137137
if not replacement.is_permanent:
138138
restored = replacement.restore(original)
139139
model.set_submodule(name, restored)

src/llmcompressor/modeling/qwen3_vl_moe.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class CalibrateQwen3VLMoeTextSparseMoeBlock(MoECalibrationModule):
1515
experts.
1616
"""
1717

18+
is_permanent = True
19+
1820
def __init__(
1921
self,
2022
original: OriginalQwen3VLMoeTextSparseMoeBlock,
@@ -82,6 +84,9 @@ def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
8284
next_states = next_states.reshape(batch_size, sequence_length, hidden_dim)
8385
return next_states, router_logits
8486

87+
def restore(self, original: torch.nn.Module) -> torch.nn.Module:
88+
return original
89+
8590

8691
class SequentialQwen3VLMoeTextExperts(torch.nn.ModuleList):
8792
def __init__(self, config, original):

0 commit comments

Comments
 (0)