guidellm 0.4.0a173__py3-none-any.whl → 0.4.0a186__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of guidellm might be problematic. Click here for more details.
- guidellm/__main__.py +5 -2
- guidellm/benchmark/schemas.py +33 -6
- guidellm/data/deserializers/synthetic.py +14 -1
- {guidellm-0.4.0a173.dist-info → guidellm-0.4.0a186.dist-info}/METADATA +1 -1
- {guidellm-0.4.0a173.dist-info → guidellm-0.4.0a186.dist-info}/RECORD +9 -9
- {guidellm-0.4.0a173.dist-info → guidellm-0.4.0a186.dist-info}/WHEEL +0 -0
- {guidellm-0.4.0a173.dist-info → guidellm-0.4.0a186.dist-info}/entry_points.txt +0 -0
- {guidellm-0.4.0a173.dist-info → guidellm-0.4.0a186.dist-info}/licenses/LICENSE +0 -0
- {guidellm-0.4.0a173.dist-info → guidellm-0.4.0a186.dist-info}/top_level.txt +0 -0
guidellm/__main__.py
CHANGED
|
@@ -33,7 +33,7 @@ from pydantic import ValidationError
|
|
|
33
33
|
try:
|
|
34
34
|
import uvloop
|
|
35
35
|
except ImportError:
|
|
36
|
-
uvloop = None
|
|
36
|
+
uvloop = None # type: ignore[assignment] # Optional dependency
|
|
37
37
|
|
|
38
38
|
from guidellm.backends import BackendType
|
|
39
39
|
from guidellm.benchmark import (
|
|
@@ -116,6 +116,7 @@ def benchmark():
|
|
|
116
116
|
)
|
|
117
117
|
@click.option(
|
|
118
118
|
"--scenario",
|
|
119
|
+
"-c",
|
|
119
120
|
type=cli_tools.Union(
|
|
120
121
|
click.Path(
|
|
121
122
|
exists=True,
|
|
@@ -392,8 +393,10 @@ def run(**kwargs):
|
|
|
392
393
|
disable_progress = kwargs.pop("disable_progress", False)
|
|
393
394
|
|
|
394
395
|
try:
|
|
396
|
+
# Only set CLI args that differ from click defaults
|
|
397
|
+
new_kwargs = cli_tools.set_if_not_default(click.get_current_context(), **kwargs)
|
|
395
398
|
args = BenchmarkGenerativeTextArgs.create(
|
|
396
|
-
scenario=
|
|
399
|
+
scenario=new_kwargs.pop("scenario", None), **new_kwargs
|
|
397
400
|
)
|
|
398
401
|
except ValidationError as err:
|
|
399
402
|
# Translate pydantic valdation error to click argument error
|
guidellm/benchmark/schemas.py
CHANGED
|
@@ -23,7 +23,15 @@ from pathlib import Path
|
|
|
23
23
|
from typing import Any, ClassVar, Literal, TypeVar, cast
|
|
24
24
|
|
|
25
25
|
import yaml
|
|
26
|
-
from pydantic import
|
|
26
|
+
from pydantic import (
|
|
27
|
+
ConfigDict,
|
|
28
|
+
Field,
|
|
29
|
+
ValidationError,
|
|
30
|
+
ValidatorFunctionWrapHandler,
|
|
31
|
+
computed_field,
|
|
32
|
+
field_validator,
|
|
33
|
+
model_serializer,
|
|
34
|
+
)
|
|
27
35
|
from torch.utils.data import Sampler
|
|
28
36
|
from transformers import PreTrainedTokenizerBase
|
|
29
37
|
|
|
@@ -1142,7 +1150,8 @@ class GenerativeMetrics(StandardBaseDict):
|
|
|
1142
1150
|
)
|
|
1143
1151
|
request_duration = (
|
|
1144
1152
|
(request_end_time - request_start_time)
|
|
1145
|
-
if request_end_time and request_start_time
|
|
1153
|
+
if request_end_time and request_start_time
|
|
1154
|
+
else None
|
|
1146
1155
|
)
|
|
1147
1156
|
|
|
1148
1157
|
# Always track concurrency
|
|
@@ -1669,7 +1678,7 @@ class GenerativeBenchmark(Benchmark, StandardBaseDict):
|
|
|
1669
1678
|
estimated_state: EstimatedBenchmarkState,
|
|
1670
1679
|
scheduler_state: SchedulerState,
|
|
1671
1680
|
profile: Profile,
|
|
1672
|
-
requests: Iterable,
|
|
1681
|
+
requests: Iterable, # noqa: ARG003
|
|
1673
1682
|
backend: BackendInterface,
|
|
1674
1683
|
environment: Environment,
|
|
1675
1684
|
strategy: SchedulingStrategy,
|
|
@@ -1818,8 +1827,6 @@ class BenchmarkGenerativeTextArgs(StandardBaseModel):
|
|
|
1818
1827
|
else:
|
|
1819
1828
|
return factory({}) # type: ignore[call-arg] # Confirmed correct at runtime by code above
|
|
1820
1829
|
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
1830
|
model_config = ConfigDict(
|
|
1824
1831
|
extra="ignore",
|
|
1825
1832
|
use_enum_values=True,
|
|
@@ -1838,7 +1845,7 @@ class BenchmarkGenerativeTextArgs(StandardBaseModel):
|
|
|
1838
1845
|
profile: StrategyType | ProfileType | Profile = Field(
|
|
1839
1846
|
default="sweep", description="Benchmark profile or scheduling strategy type"
|
|
1840
1847
|
)
|
|
1841
|
-
rate:
|
|
1848
|
+
rate: list[float] | None = Field(
|
|
1842
1849
|
default=None, description="Request rate(s) for rate-based scheduling"
|
|
1843
1850
|
)
|
|
1844
1851
|
# Backend configuration
|
|
@@ -1931,6 +1938,26 @@ class BenchmarkGenerativeTextArgs(StandardBaseModel):
|
|
|
1931
1938
|
default=None, description="Maximum global error rate (0-1) before stopping"
|
|
1932
1939
|
)
|
|
1933
1940
|
|
|
1941
|
+
@field_validator("data", "data_args", "rate", mode="wrap")
|
|
1942
|
+
@classmethod
|
|
1943
|
+
def single_to_list(
|
|
1944
|
+
cls, value: Any, handler: ValidatorFunctionWrapHandler
|
|
1945
|
+
) -> list[Any]:
|
|
1946
|
+
"""
|
|
1947
|
+
Ensures field is always a list.
|
|
1948
|
+
|
|
1949
|
+
:param value: Input value for the 'data' field
|
|
1950
|
+
:return: List of data sources
|
|
1951
|
+
"""
|
|
1952
|
+
try:
|
|
1953
|
+
return handler(value)
|
|
1954
|
+
except ValidationError as err:
|
|
1955
|
+
# If validation fails, try wrapping the value in a list
|
|
1956
|
+
if err.errors()[0]["type"] == "list_type":
|
|
1957
|
+
return handler([value])
|
|
1958
|
+
else:
|
|
1959
|
+
raise
|
|
1960
|
+
|
|
1934
1961
|
@model_serializer
|
|
1935
1962
|
def serialize_model(self):
|
|
1936
1963
|
"""
|
|
@@ -9,7 +9,7 @@ from typing import Any
|
|
|
9
9
|
import yaml
|
|
10
10
|
from datasets import Features, IterableDataset, Value
|
|
11
11
|
from faker import Faker
|
|
12
|
-
from pydantic import ConfigDict, Field, model_validator
|
|
12
|
+
from pydantic import ConfigDict, Field, ValidationError, model_validator
|
|
13
13
|
from transformers import PreTrainedTokenizerBase
|
|
14
14
|
|
|
15
15
|
from guidellm.data.deserializers.deserializer import (
|
|
@@ -242,6 +242,10 @@ class SyntheticTextDatasetDeserializer(DatasetDeserializer):
|
|
|
242
242
|
if (config := self._load_config_str(data)) is not None:
|
|
243
243
|
return self(config, processor_factory, random_seed, **data_kwargs)
|
|
244
244
|
|
|
245
|
+
# Try to parse dict-like data directly
|
|
246
|
+
if (config := self._load_config_dict(data)) is not None:
|
|
247
|
+
return self(config, processor_factory, random_seed, **data_kwargs)
|
|
248
|
+
|
|
245
249
|
if not isinstance(data, SyntheticTextDatasetConfig):
|
|
246
250
|
raise DataNotSupportedError(
|
|
247
251
|
"Unsupported data for SyntheticTextDatasetDeserializer, "
|
|
@@ -266,6 +270,15 @@ class SyntheticTextDatasetDeserializer(DatasetDeserializer):
|
|
|
266
270
|
),
|
|
267
271
|
)
|
|
268
272
|
|
|
273
|
+
def _load_config_dict(self, data: Any) -> SyntheticTextDatasetConfig | None:
|
|
274
|
+
if not isinstance(data, dict | list):
|
|
275
|
+
return None
|
|
276
|
+
|
|
277
|
+
try:
|
|
278
|
+
return SyntheticTextDatasetConfig.model_validate(data)
|
|
279
|
+
except ValidationError:
|
|
280
|
+
return None
|
|
281
|
+
|
|
269
282
|
def _load_config_file(self, data: Any) -> SyntheticTextDatasetConfig | None:
|
|
270
283
|
if (not isinstance(data, str) and not isinstance(data, Path)) or (
|
|
271
284
|
not Path(data).is_file()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
guidellm/__init__.py,sha256=1zl-PT9IZJvDfdLSMviPLzhVE3_ZXpizmc9s7UWa6kQ,1206
|
|
2
|
-
guidellm/__main__.py,sha256=
|
|
2
|
+
guidellm/__main__.py,sha256=4Z8Rl6yEM8iHyKPEbVviCVQ29EYPc-rB_ZRTqzQfKDM,20722
|
|
3
3
|
guidellm/logger.py,sha256=6qGOeff8hOJF6p57Zietq6qr64N7E40CJSQSQcUFgKc,2912
|
|
4
4
|
guidellm/settings.py,sha256=C4miDtWaI5lJ4NBXxfuUitt5-6_FCzZPzM1Bjie9XoA,7283
|
|
5
5
|
guidellm/version.py,sha256=NIzyWA7lNdSpf2MtPJuOjvW5h6E9nGDea2G4nGFDbgY,127
|
|
@@ -13,7 +13,7 @@ guidellm/benchmark/entrypoints.py,sha256=U_0JvZYCkQ1Z-qkF8tN_JeuhuGn8mINScwi819b
|
|
|
13
13
|
guidellm/benchmark/output.py,sha256=jHa7u6wTh_YSBdO2oDo47079KReXHZ-AKB6zgo8SMvg,27308
|
|
14
14
|
guidellm/benchmark/profile.py,sha256=RvQdmVLNLU-V8U8xIXm3vH8tY7Hp_4jNPQe5dombj8g,24007
|
|
15
15
|
guidellm/benchmark/progress.py,sha256=oZqZZ_vInmifBNd490ZTgcCjaGy2_slViEABSWDJgHI,25976
|
|
16
|
-
guidellm/benchmark/schemas.py,sha256=
|
|
16
|
+
guidellm/benchmark/schemas.py,sha256=WiOVAw48-Edcrb0kNxMMiE0vjlYki1foI3izsp2iVXE,81999
|
|
17
17
|
guidellm/benchmark/scenarios/__init__.py,sha256=SmaYf8hfByJU4LVJ7pZKNxJPYBObl7UKpoaJEmLPdTI,1276
|
|
18
18
|
guidellm/benchmark/scenarios/chat.json,sha256=4H_ByPCv_9azHn6iTxCY3FfpoUtlbShDPdNyzDwHJVQ,226
|
|
19
19
|
guidellm/benchmark/scenarios/rag.json,sha256=BIpifJoAtWgB3NRRYK51ZuCH4Zvh1OeBFanB7vcxS-E,231
|
|
@@ -27,7 +27,7 @@ guidellm/data/deserializers/deserializer.py,sha256=SOCtXik1fVeS7yHgNFMihkq3RmqA-
|
|
|
27
27
|
guidellm/data/deserializers/file.py,sha256=PzFOJcPuXrUM-OK6EbDIKhzEXDPp7X4xfe_wHZxXqKw,7445
|
|
28
28
|
guidellm/data/deserializers/huggingface.py,sha256=uk2WBH9WJ8csaRrw6wXQ5Xiz_pj_fN5c4jDV9pWf1F0,2954
|
|
29
29
|
guidellm/data/deserializers/memory.py,sha256=F6o2JwIUgcZHdeRkT051AS76i6wWlIw-XGH09_pOqDs,6670
|
|
30
|
-
guidellm/data/deserializers/synthetic.py,sha256=
|
|
30
|
+
guidellm/data/deserializers/synthetic.py,sha256=2WOE8pURABFyou0vy5h1HNMlA2tIOErZ9EIjS1Du2S8,12686
|
|
31
31
|
guidellm/data/preprocessors/__init__.py,sha256=khp1-m5EqJ6I40qFAYVv71LncrEXzKBmRocxQG5-ZuE,757
|
|
32
32
|
guidellm/data/preprocessors/formatters.py,sha256=F5BHtJZ6PdmevS9LI6e9TJPwUKnuSsZbt7qS8n2H_eM,14078
|
|
33
33
|
guidellm/data/preprocessors/mappers.py,sha256=7UBdRF2cdADqPbsri_1Mv3FhsQLJtUoIe_lSBV9owEQ,6715
|
|
@@ -87,9 +87,9 @@ guidellm/utils/statistics.py,sha256=KzUYm4fVNVtDd6FRCRBnqYmFcea-9n0JKCAZyqeZLM8,
|
|
|
87
87
|
guidellm/utils/synchronous.py,sha256=rRkWwbDf1ty607KUhDKsqV4HcdKU5o0-1s5hwdG-Hak,5209
|
|
88
88
|
guidellm/utils/text.py,sha256=0K8yUEB4gzztevxzuiMXossSoHhvzcHoKqRhQYQdOrg,11644
|
|
89
89
|
guidellm/utils/typing.py,sha256=jt0o7SRbDhnvrifR3l4hN8oL3uJNxl8aMnvaoABb-MU,1235
|
|
90
|
-
guidellm-0.4.
|
|
91
|
-
guidellm-0.4.
|
|
92
|
-
guidellm-0.4.
|
|
93
|
-
guidellm-0.4.
|
|
94
|
-
guidellm-0.4.
|
|
95
|
-
guidellm-0.4.
|
|
90
|
+
guidellm-0.4.0a186.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
91
|
+
guidellm-0.4.0a186.dist-info/METADATA,sha256=U1y28unlMVgQ1WzN_4Euq17kt75TrHQQzvQFfgUPtzU,21923
|
|
92
|
+
guidellm-0.4.0a186.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
93
|
+
guidellm-0.4.0a186.dist-info/entry_points.txt,sha256=DzLFEg47fF7qY1b-9laPz9jg0KSKJ1_D9TbF93kLz_E,51
|
|
94
|
+
guidellm-0.4.0a186.dist-info/top_level.txt,sha256=EXRGjnvFtL6MeZTe0tnHRMYcEWUW3vEqoG2zO7vFOtk,9
|
|
95
|
+
guidellm-0.4.0a186.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|