Repository navigation
[None][fix] Forward async transfer manager through multimodal scheduler wrapper - #19898
Open
yechank-nvidia wants to merge 1 commit into
Open
yechank-nvidia wants to merge 1 commit into
yechank-nvidia wants to merge 1 commit into
Conversation
…er wrapper PyExecutor wires the AsyncTransferManager into the KVCacheV2Scheduler deadlock detector via hasattr(self.scheduler, "set_async_transfer_manager"). With MM item scheduling enabled, the scheduler is wrapped in MultimodalScheduler / MultimodalEagerEncoderScheduler, which did not expose the hook, so the wrapped V2 scheduler never received the manager and could count finished-but-unreaped disagg KV sends as a stall (false deadlock). Add an explicit passthrough on MultimodalScheduler that forwards to the wrapped scheduler when it supports the hook. Signed-off-by: yechank <161688079+yechank-nvidia@users.noreply.github.com>
Contributor
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
PyExecutor.__init__wiresAsyncTransferManagerinto the KV cache V2 scheduler's deadlock detector by feature detection:When MM encoder item scheduling is enabled,
_util.create_py_executor_instancewraps the LLM scheduler inMultimodalScheduler/MultimodalEagerEncoderScheduler. The wrapper did not exposeset_async_transfer_manager, so thehasattrcheck was false and the wrappedKVCacheV2Scheduler._async_transfer_managerstayedNone. On a disaggregated context server running KVCacheManagerV2 with MM item scheduling, finished-but-unreaped KV sends (which still pin KV pages) could then be counted as a stall and_detect_deadlockcould raise a false deadlock.Fix: add an explicit
set_async_transfer_managerpassthrough onMultimodalScheduler(inherited byMultimodalEagerEncoderScheduler) that forwards to the wrapped scheduler when it supports the hook; it is a no-op for wrapped schedulers without it (e.g.SimpleScheduler).set_async_transfer_manageris the only optional methodPyExecutorfeature-detects onself.scheduler. The others it calls (schedule_request,can_schedule,is_request_in_schedulable_state,scheduling_state_range) are on theRequestSchedulerbase and the wrapper already implements or delegates them.Test Coverage
Recorded validation for
de080e435dcovers wrapper forwarding; no full disaggregated serving reproduction is claimed.tests/unittest/_torch/executor/test_multimodal_scheduler.py::test_multimodal_scheduler_forwards_async_transfer_manager(new, parametrized overMultimodalSchedulerandMultimodalEagerEncoderScheduler): checks that the wrappedKVCacheV2Schedulerreceives the transfer manager, and that wrapping a scheduler without the hook doesn't fail. It fails without the fix.tests/unittest/_torch/executor/test_multimodal_scheduler.py,test_py_scheduler.pyandtest_scheduler_serializable_output.py.