Skip to content

Commit

Permalink
warning message for batch corner case (#1102)
Browse files Browse the repository at this point in the history
  • Loading branch information
saeid93 authored Apr 18, 2023
1 parent d41a9c0 commit 85243b2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mlserver/batching/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ..types import InferenceRequest, InferenceResponse
from ..utils import get_wrapped_method
from .adaptive import AdaptiveBatcher
from ..logging import logger

_AdaptiveBatchingAttr = "__adaptive_batching__"

Expand Down Expand Up @@ -52,6 +53,14 @@ async def load_batching(model: MLModel) -> MLModel:
if model.settings.max_batch_time <= 0:
return model

if model.settings.max_batch_size > 1 and model.settings.max_batch_time <= 0:
logger.warning(
"Setting max_batch_time equal to zero will result"
" in batching having no effect, if you intend to "
"use batching try setting it to a value > 0 for"
" batching to take effect"
)

batcher = AdaptiveBatcher(model)
setattr(model, _AdaptiveBatchingAttr, batcher)

Expand Down

0 comments on commit 85243b2

Please sign in to comment.