This MR introduces a base controller implementation that will handle the model-loading and setup, before handing control over to the desired scheduler.
Scheduler
The Scheduler interface is a simpler version of controller logic. It only has to deal with infer
requests, and it doesn't have to set up workers.
The scheduler has a method call start
where it will be handed the worker connections (for it to use to send workers actions), as well as a ClockworkState
object which captures the current state of all workers.
The scheduler can assume that, once it begins, no further model loading will occur. It only needs to deal with infer requests from clients, sending actions to workers, and receiving results back from workers.
ClockworkState
This includes all of the workers, gpus, the size of their memory, all loaded models, and profiled execution and loading times.
Currently, profiling isn't implemented, so the exec and load times will show up as 0. This will be implemented soon
ControllerWithStartupPhase
The ControllerWithStartupPhase class in src/clockwork/controller/controller.h
.
This is the underlying controller implementation. To use it, pass it an instance of a scheduler that you want it to transition to once startup is complete.
The logic for the startup phase is as follows:
LoadModelFromDisk
requests from clients.LoadModelFromDisk
requests), the controller will start profiling the loaded modelsSubtle points:
LoadModelFromDisk
has been received. The countdown will reset if any new requests are received. It also doesn't start counting down until all pending LoadModel requests have completed.This MR includes a few bugfixes and updates here and there but shouldn't break anything.