Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/deepsparse/legacy/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
Classes and registry for end to end inference pipelines that wrap an underlying
inference engine and include pre/postprocessing
"""
import logging
import os
from abc import ABC, abstractmethod
from concurrent.futures import ThreadPoolExecutor
Expand Down Expand Up @@ -75,6 +76,8 @@

SUPPORTED_PIPELINE_ENGINES = [DEEPSPARSE_ENGINE, ORT_ENGINE]

_LOGGER = logging.getLogger(__name__)


class Pipeline(BasePipeline):
"""
Expand Down Expand Up @@ -192,10 +195,14 @@ def __init__(
)

self._engine_args = dict(
batch_size=self._batch_size or 1, # bs=1 for dynamic batch
batch_size=self._batch_size,
num_cores=num_cores,
input_shapes=input_shapes,
)
if self._engine_args["batch_size"] == 0:
_LOGGER.warning("Overriding batch_size from 0 to 1 for dynamic batch")
self._engine_args["batch_size"] = 1

if engine_type.lower() == DEEPSPARSE_ENGINE:
self._engine_args["scheduler"] = scheduler
self._engine_args["num_streams"] = num_streams
Expand Down