Skip to content

Commit 2def98d

Browse files
committed
add maybe_run_recv_hook to __exit__
Signed-off-by: Sage Moore <[email protected]>
1 parent 6d31123 commit 2def98d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

vllm/model_executor/layers/fused_moe/modular_kernel.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,13 +864,14 @@ def forward(
864864
self.fused_experts.quant_config,
865865
)
866866

867-
# assert self.shared_experts is not None
868867
if self.shared_experts is not None:
869868
shared_output = self.shared_experts(a1)
870869

870+
# If DBO is being used, register the hook with the ubatch context
871+
# and call it in dbo_maybe_run_recv_hook instead of passing it to
872+
# the receiver.
871873
dbo_register_recv_hook(hook)
872874
dbo_yield()
873-
874875
if dbo_enabled():
875876
hook = None
876877

vllm/v1/worker/ubatching.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
5858
global _CURRENT_CONTEXTS, _THREAD_ID_TO_CONTEXT
5959
_CURRENT_CONTEXTS[self.id] = None
6060
del _THREAD_ID_TO_CONTEXT[threading.get_ident()]
61+
self.maybe_run_recv_hook()
6162
self.cpu_signal_event.set()
6263
self.cpu_wait_event.clear()
6364
self.current_stream = self.compute_stream

0 commit comments

Comments
 (0)