Address corner case when generating version file (#641)

Address corner case for version file generation

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Binyang Li
2025-10-07 14:32:33 -07:00
committed by GitHub
parent 3d94383696
commit ddca185add
6 changed files with 22 additions and 201 deletions

View File

@@ -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

View File

@@ -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:
@@ -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.