MCPcopy Index your code
hub / github.com/InternLM/lmdeploy / migration_loop

Method migration_loop

lmdeploy/pytorch/engine/engine_loop.py:527–544  ·  view source on GitHub ↗

Async loop migration.

(self)

Source from the content-addressed store, hash-verified

525 self.has_runable_event.set()
526
527 async def migration_loop(self):
528 """Async loop migration."""
529 while not self.stop_event.is_set():
530 if self._sleep_requested:
531 self.migration_event.clear()
532 self._migration_sleep_drain_event.set()
533 await self._sleep_resume_event.wait()
534 continue
535
536 migration_ready = self.scheduler._schedule_migration()
537 if not migration_ready and not self.scheduler.has_migration_waiting():
538 await self.migration_event.wait()
539 elif migration_ready:
540 self.migration_event.clear()
541 await self._migration_loop_process_ready(migration_ready)
542 else:
543 # release coroutine for decoding
544 await asyncio.sleep(.5)
545
546 def start(self, event_loop: asyncio.AbstractEventLoop):
547 """Create async tasks."""

Callers 1

startMethod · 0.95

Calls 6

_schedule_migrationMethod · 0.80
clearMethod · 0.45
setMethod · 0.45
waitMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected