Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.0
0.8.0
135 changes: 0 additions & 135 deletions _build_version_metadata.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
project = "mscclpp"
copyright = "2025, MSCCL++ Team"
author = "MSCCL++ Team"
release = "v0.7.0"
release = "v0.8.0"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
19 changes: 6 additions & 13 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,17 @@ export LD_LIBRARY_PATH=$MSCCLPP_INSTALL_DIR:$LD_LIBRARY_PATH
torchrun --nnodes=1 --nproc_per_node=8 your_script.py
```

### Version Tracking
## Version Tracking

The MSCCL++ Python package includes comprehensive version tracking that captures git repository information at build time. This feature allows users to identify the exact source code version of their installed package.

#### Version Format
### Version Format

The package version includes the git commit hash directly in the version string for development builds:
- **Release version**: `0.7.0`
- **Development version**: `0.7.0.dev36+g6e2360d69` (includes short commit hash)
- **Development with uncommitted changes**: `0.7.0.dev36+g6e2360d69.dirty`
- **Development version**: `mscclpp-0.8.0.post1.dev0+gc632fee37.d20251007`

#### Checking Version Information
### Checking Version Information

After installation, you can check the version information in several ways:

Expand All @@ -227,16 +226,10 @@ import mscclpp

# Access individual attributes
print(f"Version: {mscclpp.__version__}") # Full version with commit
Version: 0.7.0.dev36+g6e2360d69
Version: 0.8.0.post1.dev0+gc632fee37.d20251007

# Get as dictionary
mscclpp.version
{'version': '0.7.0.dev36+g6e2360d69', 'base_version': '0.7.0', 'git_commit': '6e2360d69'}
{'version': '0.8.0.post1.dev0+gc632fee37.d20251007', 'git_commit': 'g50382c567'}
```

#### Version Information Details

The version tracking captures:
- **Package Version** (`mscclpp.__version__`): Full version string including git commit (e.g., `0.7.1.dev36+g6e2360d69`)

This information is embedded during the package build process and remains accessible even after distribution, making it easier to debug issues and ensure reproducibility.
11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

[build-system]
requires = [
"scikit-build-core>=0.4.3",
"setuptools-scm[toml]>=6.2"
"scikit-build-core>=0.10.0",
"setuptools-scm[toml]>=8"
]
build-backend = "_build_version_metadata"
backend-path = ["."]
build-backend = "scikit_build_core.build"

[project]
name = "mscclpp"
Expand All @@ -17,6 +16,7 @@ requires-python = ">=3.8"

[tool.setuptools_scm]
write_to = "python/mscclpp/_version.py"
version_scheme = "no-guess-dev"

[tool.scikit-build]
cmake.version = ">=3.25.0"
Expand All @@ -31,6 +31,9 @@ install-dir = "mscclpp"
license-files = ["VERSION", "LICENSE", "CITATION.cff", "CODE_OF_CONDUCT.md", "README.md", "SECURITY.md", "SUPPORT.md"]
exclude = ["mscclpp/*.cpp"]

[tool.scikit-build.sdist]
include= ["python/mscclpp/_version.py"]

[tool.scikit-build.cmake.define]
MSCCLPP_BUILD_PYTHON_BINDINGS = "ON"
MSCCLPP_BUILD_TESTS = "OFF"
Expand Down
54 changes: 7 additions & 47 deletions python/mscclpp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,21 @@

import os
import warnings
import re
from functools import wraps


# Get version
def _get_version():
"""Get version from the best available source"""

# Try setuptools-scm generated _version.py (most reliable)
try:
from ._version import __version__

return __version__
except ImportError:
raise RuntimeError("Could not determine MSCCL++ version from setuptools-scm generated _version.py.")


# Parse version components
def _parse_version(version_string):
"""Parse version components from setuptools-scm generated version"""
# Pattern for versions like "0.7.0.dev36+g6e2360d69" (without .dYYYYMMDD)
pattern = r"^v?(?P<base>[\d\.]+)(?:\.dev(?P<distance>\d+))?(?:\+g(?P<commit>[a-f0-9]+))?(?P<dirty>\.dirty)?$"
match = re.match(pattern, version_string)

if match:
return {"base_version": match.group("base"), "git_commit": match.group("commit") or "unknown"}
else:
# Fallback parsing - try to extract what we can
base = version_string.split("+")[0].lstrip("v").split(".dev")[0]
commit = "unknown"

return {"base_version": base, "git_commit": commit}
if os.environ.get("MSCCLPP_HOME", None) is None:
os.environ["MSCCLPP_HOME"] = os.path.abspath(os.path.dirname(__file__))

from ._version import __version__, __commit_id__

__version__ = _get_version()

# Parse the version
_version_info = _parse_version(__version__)
__base_version__ = _version_info["base_version"]
__git_commit__ = _version_info["git_commit"]


def _version():
"""Get complete version information as a dictionary"""
return {
"version": __version__,
"base_version": __base_version__,
"git_commit": __git_commit__,
}

version = {
"version": __version__,
"git_commit": __commit_id__,
}

version: dict = _version()

from ._mscclpp import (
Env,
Expand Down Expand Up @@ -132,9 +95,6 @@ def _version():
"SmDevice2DeviceSemaphore",
]

if os.environ.get("MSCCLPP_HOME", None) is None:
os.environ["MSCCLPP_HOME"] = os.path.abspath(os.path.dirname(__file__))


def get_include() -> str:
"""Return the directory that contains the MSCCL++ headers."""
Expand Down
Loading