Skip to content

Commit 2860e2e

Browse files
committed
patch qwen3moe by existed code
1 parent c2f520e commit 2860e2e

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

src/twinkle/sampler/vllm_sampler/vllm_sampler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ def __init__(self, model_id: str, engine_args: Dict[str, Any] = None, device_mes
122122
# fix: On NPU, monkey_patch_model can trigger Triton compatibility errors and abort sampler init.
123123
# fix: Explicitly skip this patch on NPU and keep it for non-NPU paths only.
124124
# NPU platform may trigger triton errors with monkey_patch_model
125-
if Platform.get_platform().device_prefix() != 'npu':
126-
self._run_in_loop(self.engine.engine.collective_rpc('monkey_patch_model'))
125+
self._run_in_loop(self.engine.engine.collective_rpc('monkey_patch_model'))
127126

128127
VLLMLoraWeights()(self)
129128

src/twinkle/sampler/vllm_sampler/vllm_worker_extension.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,6 @@ def update_weights_from_ipc(
131131

132132
if peft_config and base_sync_done:
133133
self.remove_lora(VLLM_LORA_INT_ID)
134-
else:
135-
try:
136-
self.monkey_patch_model()
137-
except Exception as e:
138-
logger.warning(f'Failed to apply MoE weight_loader patch before load_weights: {e}')
139134

140135
# Detect TP rank — vLLM sets self.rank on each worker.
141136
tp_rank = getattr(self, 'rank', 0)
@@ -358,12 +353,6 @@ def load_synced_weights(
358353
# fix: Keep device resolution consistent with update_weights_from_ipc to avoid path divergence.
359354
self.device = torch.device(Torch.get_device(getattr(self, 'local_rank', None)))
360355

361-
if not (peft_config and base_sync_done):
362-
try:
363-
self.monkey_patch_model()
364-
except Exception as e:
365-
logger.warning(f'Failed to apply MoE weight_loader patch before load_weights: {e}')
366-
367356
weight_list = list(weights.items())
368357
self._load_weights(weight_list, peft_config=peft_config, base_sync_done=base_sync_done)
369358

0 commit comments

Comments
 (0)