Skip to content

Commit f40b625

Browse files
committed
Fixes for request formatter not being overwritten correctly from scenarios with CLI and expand out dataloader info printed to console
Signed-off-by: Mark Kurtz <mark.kurtz@neuralmagic.com>
1 parent ba30e44 commit f40b625

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

src/guidellm/__main__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,12 @@ def run(**kwargs):
389389
# Handle remapping for request params
390390
request_type = kwargs.pop("request_type", None)
391391
request_formatter_kwargs = kwargs.pop("request_formatter_kwargs", None)
392-
kwargs["data_request_formatter"] = (
393-
request_type
394-
if not request_formatter_kwargs
395-
else {"request_type": request_type, **request_formatter_kwargs}
396-
)
392+
if request_type is not None:
393+
kwargs["data_request_formatter"] = (
394+
request_type
395+
if not request_formatter_kwargs
396+
else {"request_type": request_type, **request_formatter_kwargs}
397+
)
397398

398399
# Handle output path remapping
399400
if (output_path := kwargs.pop("output_path", None)) is not None:

src/guidellm/benchmark/entrypoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ async def resolve_request_loader(
303303
title=(
304304
f"Request loader initialized with "
305305
f"{data_samples if data_samples > 0 else 'inf'} "
306-
f"unique requests from {data}"
306+
"unique requests"
307307
),
308308
details=InfoMixin.extract_from_obj(request_loader),
309309
status_level="success",

src/guidellm/data/loaders.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from guidellm.data.deserializers import DatasetDeserializerFactory
1414
from guidellm.data.preprocessors import DataDependentPreprocessor, DatasetPreprocessor
1515
from guidellm.logger import logger
16+
from guidellm.utils import InfoMixin
1617

1718
__all__ = ["DataLoader", "DatasetsIterator"]
1819

@@ -117,7 +118,7 @@ def generator(
117118
)
118119

119120

120-
class DataLoader(PyTorchDataLoader[DataT]):
121+
class DataLoader(PyTorchDataLoader[DataT], InfoMixin):
121122
def __init__(
122123
self,
123124
data: list[Any],
@@ -139,6 +140,18 @@ def __init__(
139140
preprocessors=preprocessors,
140141
random_seed=random_seed,
141142
)
143+
self._info: dict[str, Any] = {
144+
"data": str(data),
145+
"data_args": str(data_args),
146+
"data_samples": data_samples,
147+
"preprocessors": [
148+
preprocessor.__class__.__name__ for preprocessor in preprocessors
149+
],
150+
"collator": collator.__class__.__name__,
151+
"sampler": str(sampler),
152+
"num_workers": num_workers,
153+
"random_seed": random_seed,
154+
}
142155

143156
super().__init__(
144157
dataset=iterator,
@@ -149,3 +162,7 @@ def __init__(
149162
num_workers=num_workers or 0,
150163
**kwargs,
151164
)
165+
166+
@property
167+
def info(self) -> dict[str, Any]:
168+
return self._info

0 commit comments

Comments
 (0)