caikit.runtime.model_management.batcher
The Batcher transparently aggregates individual inference calls into unified batches to call the run_batch implementation of the wrapped model.
Attributes
Classes
Module Contents
- class caikit.runtime.model_management.batcher.Batcher(model_name: str, model: caikit.core.ModuleBase, batch_size: int, batch_collect_delay_s: float | None = None)[source]
- __doc__ = Multiline-String
Show Value
""" The Batcher transparently aggregates individual inference calls into unified batches to call the run_batch implementation of the wrapped model. """
- _model_name
- _model
- _batch_size
- _batch_collect_delay_s = None
- _input_q
- _finished_tasks
- _req_num = 0
- _id_lock
- _ready_event
- _stop_event
- _batch_thread_start_lock
- _batch_thread = None
- _model_run_defaults
- run(**kwargs) caikit.core.data_model.base.DataBase[source]
This run function gives a facade to the underlying model’s run function that is implemented by running batches of individual requests through the model’s run_batch method.
- NOTE: Only kwargs accepted to simplify batching across inconsistent sets
of kwargs (and only kwargs are used in the predict servicer)