Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,6 @@ configs/development.yaml
Dockerfile.dev
discussion
tmp_test

# Auto-generated version file (created by setuptools_scm during build)
vllm_omni/_version.py
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "vllm-omni"
version = "0.14.0"
dynamic = ["version", "dependencies"]
description = "A framework for efficient model inference with omni-modality models"
readme = "README.md"
requires-python = ">=3.10,<3.14"
Expand All @@ -17,7 +17,6 @@ authors = [
{name = "vLLM-Omni Team"}
]
keywords = ["vllm", "multimodal", "diffusion", "transformer", "inference", "serving"]
dynamic = ["dependencies"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
Expand Down Expand Up @@ -85,6 +84,10 @@ include = ["vllm_omni*"]
[tool.setuptools.package-data]
"vllm_omni.model_executor.stage_configs" = ["*.yaml"]

[tool.setuptools_scm]
# Enable setuptools_scm for automatic version generation from git tags.
# Version is written to vllm_omni/_version.py during build.

[tool.ruff]
line-length = 120
exclude = [
Expand Down
49 changes: 49 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from pathlib import Path

from setuptools import setup
from setuptools_scm import get_version


def uninstall_onnxruntime() -> None:
Expand Down Expand Up @@ -104,6 +105,53 @@ def detect_target_device() -> str:
return "cuda"


def get_vllm_omni_version() -> str:
"""
Get the vLLM-Omni version with device-specific suffix.

Version format: {base_version}+{device}
Examples:
- 0.14.0+cuda (release version with CUDA)
- 0.14.1.dev23+g1a2b3c4+rocm (dev version with ROCm)
- 0.15.0+npu (release version with NPU)

Environment variables:
VLLM_OMNI_VERSION_OVERRIDE: Override version completely
VLLM_OMNI_TARGET_DEVICE: Override device detection

Returns:
Version string with device suffix
"""
# Allow complete version override via environment variable
if env_version := os.getenv("VLLM_OMNI_VERSION_OVERRIDE"):
print(f"Overriding vLLM-Omni version with {env_version} from VLLM_OMNI_VERSION_OVERRIDE")
os.environ["SETUPTOOLS_SCM_PRETEND_VERSION"] = env_version
return get_version(write_to="vllm_omni/_version.py")

version = get_version(write_to="vllm_omni/_version.py")

# Determine separator: '+' for normal versions, '.' for dev versions with '+'
sep = "+" if "+" not in version else "."

# Append device-specific suffix
device = detect_target_device()

if device == "cuda":
version += f"{sep}cuda"
elif device == "rocm":
version += f"{sep}rocm"
elif device == "npu":
version += f"{sep}npu"
elif device == "xpu":
version += f"{sep}xpu"
elif device == "cpu":
version += f"{sep}cpu"
else:
raise RuntimeError(f"Unknown target device: {device}")

return version


def load_requirements(file_path: Path) -> list[str]:
"""
Load requirements from a file, supporting -r directive for recursive loading.
Expand Down Expand Up @@ -167,5 +215,6 @@ def get_install_requires() -> list[str]:

# Setup configuration
setup(
version=get_vllm_omni_version(),
install_requires=install_requires,
)
28 changes: 25 additions & 3 deletions vllm_omni/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
__version__ = "0.14.0"
__version_tuple__ = (0, 14, 0)
# TODO: add auto version generation
"""
Version information for vLLM-Omni.

The version is automatically generated from git tags via setuptools_scm
and written to _version.py during package build.
"""

try:
# Import auto-generated version from _version.py (created by setuptools_scm)
from ._version import __version__, __version_tuple__
except ImportError as e:
import warnings

warnings.warn(
f"Failed to import version from _version.py: {e}\n"
"This typically happens in development mode before building.\n"
"Using fallback version 'dev'.",
RuntimeWarning,
stacklevel=2,
)

__version__ = "dev"
__version_tuple__ = (0, 0, "dev")

__all__ = ["__version__", "__version_tuple__"]