Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
140 changes: 71 additions & 69 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ include = ["*"]
[tool.setuptools.package-data]
"guidellm.data" = ["*.gz"]

[tool.pdm]
distribution = true


# ************************************************
# ********** Project Metadata **********
Expand All @@ -24,9 +21,8 @@ name = "guidellm"
description = "Guidance platform for deploying and managing large language models."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.9.0,<4.0"
license = "Apache-2.0"
license-files = ["LICENSE"]
authors = [ { name = "Red Hat" } ]
license = { text = "Apache-2.0" }
authors = [{ name = "Red Hat" }]
keywords = [
"ai",
"benchmarking",
Expand All @@ -47,25 +43,27 @@ keywords = [
]
dependencies = [
"click>=8.0.0,<8.2.0",
"culsans~=0.9.0",
"datasets",
"eval_type_backport",
"faker",
"ftfy>=6.0.0",
"httpx[http2]<1.0.0",
"loguru",
"msgpack",
"numpy",
"pillow",
"protobuf",
"pydantic>=2.11.7",
"pydantic-settings>=2.0.0",
"pyyaml>=6.0.0",
"rich",
"sanic",
"transformers",
"uvloop>=0.18",
]

[project.optional-dependencies]
recommended = [
"tiktoken>=0.11.0", # For OpenAI tokenizer
"blobfile>=3.1.0", # For OpenAI tokenizer
]
dev = [
# build
"build>=1.0.0",
Expand All @@ -81,7 +79,7 @@ dev = [
# testing
"lorem~=0.1.1",
"pytest~=8.2.2",
"pytest-asyncio~=0.23.8",
"pytest-asyncio~=1.1.0",
"pytest-cov~=5.0.0",
"pytest-mock~=3.14.0",
"pytest-rerunfailures~=14.0",
Expand All @@ -106,9 +104,6 @@ dev = [
"mkdocs-linkcheck~=1.0.6",
]

[dependency-groups]
dev = [ "guidellm[dev]" ]

[project.urls]
homepage = "https://github.com/vllm-project/guidellm"
source = "https://github.com/vllm-project/guidellm"
Expand Down Expand Up @@ -143,11 +138,17 @@ exclude = ["venv", ".tox"]
follow_imports = 'silent'

[[tool.mypy.overrides]]
module = ["datasets.*", "transformers.*", "setuptools.*", "setuptools_git_versioning.*"]
ignore_missing_imports=true
module = [
"datasets.*",
"transformers.*",
"setuptools.*",
"setuptools_git_versioning.*",
]
ignore_missing_imports = true


[tool.ruff]
target-version = "py39"
line-length = 88
indent-width = 4
exclude = ["build", "dist", "env", ".venv"]
Expand All @@ -158,82 +159,83 @@ indent-style = "space"

[tool.ruff.lint]
ignore = [
"PLR0913",
"TC001",
"COM812",
"ISC001",
"TC002",
"COM812", # ignore trailing comma errors due to older Python versions
"PD011", # ignore .values usage since ruff assumes it's a Pandas DataFrame
"PLR0913", # ignore too many arguments in function definitions
"PLW1514", # allow Path.open without encoding
"RET505", # allow `else` blocks
"RET506", # allow `else` blocks
"PD011", # ignore .values usage since ruff assumes it's a Pandas DataFrame
"RET505", # allow `else` blocks
"RET506", # allow `else` blocks
"S311", # allow standard pseudo-random generators
"TC001", # ignore imports used only for type checking
"TC002", # ignore imports used only for type checking
"TC003", # ignore imports used only for type checking
]
select = [
# Rules reference: https://docs.astral.sh/ruff/rules/

# Code Style / Formatting
"E", # pycodestyle: checks adherence to PEP 8 conventions including spacing, indentation, and line length
"W", # pycodestyle: checks adherence to PEP 8 conventions including spacing, indentation, and line length
"A", # flake8-builtins: prevents shadowing of Python built-in names
"C", # Convention: ensures code adheres to specific style and formatting conventions
"COM", # flake8-commas: enforces the correct use of trailing commas
"ERA", # eradicate: detects commented-out code that should be removed
"I", # isort: ensures imports are sorted in a consistent manner
"ICN", # flake8-import-conventions: enforces import conventions for better readability
"N", # pep8-naming: enforces PEP 8 naming conventions for classes, functions, and variables
"NPY", # NumPy: enforces best practices for using the NumPy library
"PD", # pandas-vet: enforces best practices for using the pandas library
"PT", # flake8-pytest-style: enforces best practices and style conventions for pytest tests
"PTH", # flake8-use-pathlib: encourages the use of pathlib over os.path for file system operations
"Q", # flake8-quotes: enforces consistent use of single or double quotes
"TCH", # flake8-type-checking: enforces type checking practices and standards
"TID", # flake8-tidy-imports: enforces tidy and well-organized imports
"E", # pycodestyle: checks adherence to PEP 8 conventions including spacing, indentation, and line length
"W", # pycodestyle: checks adherence to PEP 8 conventions including spacing, indentation, and line length
"A", # flake8-builtins: prevents shadowing of Python built-in names
"C", # Convention: ensures code adheres to specific style and formatting conventions
"COM", # flake8-commas: enforces the correct use of trailing commas
"ERA", # eradicate: detects commented-out code that should be removed
"I", # isort: ensures imports are sorted in a consistent manner
"ICN", # flake8-import-conventions: enforces import conventions for better readability
"N", # pep8-naming: enforces PEP 8 naming conventions for classes, functions, and variables
"NPY", # NumPy: enforces best practices for using the NumPy library
"PD", # pandas-vet: enforces best practices for using the pandas library
"PT", # flake8-pytest-style: enforces best practices and style conventions for pytest tests
"PTH", # flake8-use-pathlib: encourages the use of pathlib over os.path for file system operations
"Q", # flake8-quotes: enforces consistent use of single or double quotes
"TCH", # flake8-type-checking: enforces type checking practices and standards
"TID", # flake8-tidy-imports: enforces tidy and well-organized imports
"RUF022", # flake8-ruff: enforce sorting of __all__ in modules

# Code Structure / Complexity
"C4", # flake8-comprehensions: improves readability and performance of list, set, and dict comprehensions
"C4", # flake8-comprehensions: improves readability and performance of list, set, and dict comprehensions
"C90", # mccabe: checks for overly complex code using cyclomatic complexity
"ISC", # flake8-implicit-str-concat: prevents implicit string concatenation
"PIE", # flake8-pie: identifies and corrects common code inefficiencies and mistakes
"R", # Refactor: suggests improvements to code structure and readability
"R", # Refactor: suggests improvements to code structure and readability
"SIM", # flake8-simplify: simplifies complex expressions and improves code readability

# Code Security / Bug Prevention
"ARG", # flake8-unused-arguments: detects unused function and method arguments
"ARG", # flake8-unused-arguments: detects unused function and method arguments
"ASYNC", # flake8-async: identifies incorrect or inefficient usage patterns in asynchronous code
"B", # flake8-bugbear: detects common programming mistakes and potential bugs
"BLE", # flake8-blind-except: prevents blind exceptions that catch all exceptions without handling
"E", # Error: detects and reports errors in the code
"F", # Pyflakes: detects unused imports, shadowed imports, undefined variables, and various formatting errors in string operations
"INP", # flake8-no-pep420: prevents implicit namespace packages by requiring __init__.py
"PGH", # pygrep-hooks: detects deprecated and dangerous code patterns
"PL", # Pylint: comprehensive source code analyzer for enforcing coding standards and detecting errors
"RSE", # flake8-raise: ensures exceptions are raised correctly
"S", # flake8-bandit: detects security issues and vulnerabilities in the code
"SLF", # flake8-self: prevents incorrect usage of the self argument in class methods
"T10", # flake8-debugger: detects the presence of debugging tools such as pdb
"T20", # flake8-print: detects print statements left in the code
"UP", # pyupgrade: automatically upgrades syntax for newer versions of Python
"W", # Warning: provides warnings about potential issues in the code
"YTT", # flake8-2020: identifies code that will break with future Python releases
"B", # flake8-bugbear: detects common programming mistakes and potential bugs
"BLE", # flake8-blind-except: prevents blind exceptions that catch all exceptions without handling
"E", # Error: detects and reports errors in the code
"F", # Pyflakes: detects unused imports, shadowed imports, undefined variables, and various formatting errors in string operations
"INP", # flake8-no-pep420: prevents implicit namespace packages by requiring __init__.py
"PGH", # pygrep-hooks: detects deprecated and dangerous code patterns
"PL", # Pylint: comprehensive source code analyzer for enforcing coding standards and detecting errors
"RSE", # flake8-raise: ensures exceptions are raised correctly
"S", # flake8-bandit: detects security issues and vulnerabilities in the code
"SLF", # flake8-self: prevents incorrect usage of the self argument in class methods
"T10", # flake8-debugger: detects the presence of debugging tools such as pdb
"T20", # flake8-print: detects print statements left in the code
"UP", # pyupgrade: automatically upgrades syntax for newer versions of Python
"W", # Warning: provides warnings about potential issues in the code
"YTT", # flake8-2020: identifies code that will break with future Python releases

# Code Documentation
"FIX", # flake8-fixme: detects FIXMEs and other temporary comments that should be resolved
]

[tool.ruff.lint.extend-per-file-ignores]
"tests/**/*.py" = [
"S101", # asserts allowed in tests
"ARG", # Unused function args allowed in tests
"S101", # asserts allowed in tests
"ARG", # Unused function args allowed in tests
"PLR2004", # Magic value used in comparison
"TCH002", # No import only type checking in tests
"SLF001", # enable private member access in tests
"S105", # allow hardcoded passwords in tests
"S311", # allow standard pseudo-random generators in tests
"PT011", # allow generic exceptions in tests
"N806", # allow uppercase variable names in tests
"PGH003", # allow general ignores in tests
"S106", # allow hardcoded passwords in tests
"TCH002", # No import only type checking in tests
"SLF001", # enable private member access in tests
"S105", # allow hardcoded passwords in tests
"S311", # allow standard pseudo-random generators in tests
"PT011", # allow generic exceptions in tests
"N806", # allow uppercase variable names in tests
"PGH003", # allow general ignores in tests
"S106", # allow hardcoded passwords in tests
"PLR0915", # allow complext statements in tests
]

Expand All @@ -246,5 +248,5 @@ addopts = '-s -vvv --cache-clear'
markers = [
"smoke: quick tests to check basic functionality",
"sanity: detailed tests to ensure major functions work correctly",
"regression: tests to ensure that new changes do not break existing functionality"
"regression: tests to ensure that new changes do not break existing functionality",
]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from setuptools import setup
from setuptools_git_versioning import count_since, get_branch, get_sha, get_tags

LAST_RELEASE_VERSION = Version("0.0.0")
LAST_RELEASE_VERSION = Version("0.3.0")
TAG_VERSION_PATTERN = re.compile(r"^v(\d+\.\d+\.\d+)$")


Expand Down
4 changes: 2 additions & 2 deletions src/guidellm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
hf_logging.set_verbosity_error()
logging.getLogger("transformers").setLevel(logging.ERROR)

from .config import (
from .logger import configure_logger, logger
from .settings import (
DatasetSettings,
Environment,
LoggingSettings,
Expand All @@ -30,7 +31,6 @@
reload_settings,
settings,
)
from .logger import configure_logger, logger

__all__ = [
"DatasetSettings",
Expand Down
2 changes: 1 addition & 1 deletion src/guidellm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
)
from guidellm.benchmark.entrypoints import benchmark_with_scenario
from guidellm.benchmark.scenario import GenerativeTextScenario, get_builtin_scenarios
from guidellm.config import print_config
from guidellm.preprocess.dataset import ShortPromptStrategy, process_dataset
from guidellm.scheduler import StrategyType
from guidellm.settings import print_config
from guidellm.utils import DefaultGroupHandler
from guidellm.utils import cli as cli_tools

Expand Down
2 changes: 1 addition & 1 deletion src/guidellm/backend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from PIL import Image

from guidellm.backend.response import ResponseSummary, StreamingTextResponse
from guidellm.config import settings
from guidellm.settings import settings

__all__ = [
"Backend",
Expand Down
2 changes: 1 addition & 1 deletion src/guidellm/backend/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ResponseSummary,
StreamingTextResponse,
)
from guidellm.config import settings
from guidellm.settings import settings

__all__ = [
"CHAT_COMPLETIONS",
Expand Down
2 changes: 1 addition & 1 deletion src/guidellm/backend/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from pydantic import computed_field

from guidellm.config import settings
from guidellm.objects.pydantic import StandardBaseModel
from guidellm.settings import settings

__all__ = [
"RequestArgs",
Expand Down
2 changes: 1 addition & 1 deletion src/guidellm/benchmark/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
GenerativeTextErrorStats,
GenerativeTextResponseStats,
)
from guidellm.config import settings
from guidellm.objects import (
RunningStats,
StandardBaseModel,
Expand All @@ -40,6 +39,7 @@
SchedulerRequestResult,
WorkerDescription,
)
from guidellm.settings import settings
from guidellm.utils import check_load_processor

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion src/guidellm/benchmark/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
SweepProfile,
ThroughputProfile,
)
from guidellm.config import settings
from guidellm.objects import (
DistributionSummary,
StandardBaseModel,
Expand All @@ -29,6 +28,7 @@
from guidellm.presentation import UIDataBuilder
from guidellm.presentation.injector import create_report
from guidellm.scheduler import strategy_display_str
from guidellm.settings import settings
from guidellm.utils import Colors, split_text_list_by_length
from guidellm.utils.dict import recursive_key_update
from guidellm.utils.text import camelize_str
Expand Down
2 changes: 1 addition & 1 deletion src/guidellm/benchmark/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import numpy as np
from pydantic import Field, computed_field

from guidellm.config import settings
from guidellm.objects import StandardBaseModel
from guidellm.scheduler import (
AsyncConstantStrategy,
Expand All @@ -15,6 +14,7 @@
SynchronousStrategy,
ThroughputStrategy,
)
from guidellm.settings import settings

__all__ = [
"AsyncProfile",
Expand Down
4 changes: 2 additions & 2 deletions src/guidellm/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

from loguru import logger

from guidellm.config import LoggingSettings, settings
from guidellm.settings import LoggingSettings, settings

__all__ = ["configure_logger", "logger"]

Expand Down Expand Up @@ -72,7 +72,7 @@ def configure_logger(config: LoggingSettings = settings.logging):
sys.stdout,
level=config.console_log_level.upper(),
format="<green>{time:YY-MM-DD HH:mm:ss}</green>|<level>{level: <8}</level> \
|<cyan>{name}:{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>"
|<cyan>{name}:{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>",
)

if config.log_file or config.log_file_level:
Expand Down
2 changes: 1 addition & 1 deletion src/guidellm/presentation/injector.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from loguru import logger

from guidellm.config import settings
from guidellm.settings import settings
from guidellm.utils.text import load_text


Expand Down
2 changes: 1 addition & 1 deletion src/guidellm/request/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from datasets import Dataset, DatasetDict, IterableDataset, IterableDatasetDict
from transformers import PreTrainedTokenizerBase # type: ignore[import]

from guidellm.config import settings
from guidellm.dataset import ColumnInputTypes, load_dataset
from guidellm.objects import StandardBaseModel
from guidellm.request.request import GenerationRequest
from guidellm.settings import settings

__all__ = [
"GenerativeRequestLoader",
Expand Down
Loading
Loading