-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to OSS builds and the Release Process (#1627)
Summary: - Add support for CUDA 11.8 in the OSS builds - Annotate the package wheels with Python 3.9 and 3.10 support tags - Update `setup.py` to auto-derive the package version from the git information (namely tags) to allow us for fast tag-and-release - Check for the actual presence of NVIDIA drivers in OSS builds, and error out with friendly message instead of cryptic `RuntimeError: No such operator fbgemm::jagged_2d_to_dense` errors when `fbgemm_gpu` is installed and loaded on a system with a GPU but without GPU drivers installed Pull Request resolved: #1627 Reviewed By: brad-mengchi, shintaro-iwasaki Differential Revision: D43868995 Pulled By: q10 fbshipit-source-id: 7843622c8415df847fc1c25775f084875e1324b6
- Loading branch information
1 parent
936ec59
commit fd4ac90
Showing
10 changed files
with
105 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ jinja2 | |
ninja | ||
numpy | ||
scikit-build | ||
setuptools_git_versioning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,29 +7,41 @@ | |
import argparse | ||
import os | ||
import random | ||
import re | ||
import subprocess | ||
import sys | ||
|
||
from datetime import date | ||
from typing import List, Optional | ||
|
||
import setuptools_git_versioning as gitversion | ||
import torch | ||
from skbuild import setup | ||
|
||
|
||
def get_version(): | ||
# get version string from version.py | ||
# TODO: ideally the version.py should be generated when setup is run | ||
version_file = os.path.join(os.path.dirname(__file__), "version.py") | ||
version_regex = r"__version__ = ['\"]([^'\"]*)['\"]" | ||
with open(version_file, "r") as f: | ||
version = re.search(version_regex, f.read(), re.M).group(1) | ||
return version | ||
def generate_package_version(package_name: str): | ||
print("[SETUP.PY] Generating the package version ...") | ||
|
||
if "nightly" in package_name: | ||
# Use date stamp for nightly versions | ||
print("[SETUP.PY] Package is for NIGHTLY; using timestamp for the versioning") | ||
today = date.today() | ||
version = f"{today.year}.{today.month}.{today.day}" | ||
|
||
elif "test" in package_name: | ||
# Use date stamp for nightly versions | ||
print("[SETUP.PY] Package is for TEST: using random number for the versioning") | ||
version = (f"0.0.{random.randint(0, 1000)}",) | ||
|
||
else: | ||
# Use git tag / branch / commit info to generate a PEP-440-compliant version string | ||
print("[SETUP.PY] Package is for RELEASE: using git info for the versioning") | ||
print( | ||
f"[SETUP.PY] TAG: {gitversion.get_tag()}, BRANCH: {gitversion.get_branch()}, SHA: {gitversion.get_sha()}" | ||
) | ||
version = gitversion.version_from_git() | ||
|
||
def get_nightly_version(): | ||
today = date.today() | ||
return f"{today.year}.{today.month}.{today.day}" | ||
print(f"[SETUP.PY] Setting the package version: {version}") | ||
return version | ||
|
||
|
||
def get_cxx11_abi(): | ||
|
@@ -170,23 +182,15 @@ def main(argv: List[str]) -> None: | |
if args.nvml_lib_path: | ||
cmake_args.append(f"-DNVML_LIB_PATH={args.nvml_lib_path}") | ||
|
||
name = args.package_name | ||
print("name: ", name) | ||
is_nightly = "nightly" in name | ||
is_test = "test" in name | ||
|
||
version = get_nightly_version() if is_nightly else get_version() | ||
if is_test: | ||
version = (f"0.0.{random.randint(0, 1000)}",) | ||
print(f"-- {name} building version: {version}") | ||
package_version = generate_package_version(args.package_name) | ||
|
||
# Repair command line args for setup. | ||
sys.argv = [sys.argv[0]] + unknown | ||
|
||
setup( | ||
# Metadata | ||
name=name, | ||
version=version, | ||
name=args.package_name, | ||
version=package_version, | ||
author="FBGEMM Team", | ||
author_email="[email protected]", | ||
long_description=long_description, | ||
|
@@ -210,6 +214,8 @@ def main(argv: List[str]) -> None: | |
"License :: OSI Approved :: BSD License", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Topic :: Scientific/Engineering :: Artificial Intelligence", | ||
], | ||
) | ||
|
Oops, something went wrong.