Skip to content

Commit 5a40006

Browse files
committed
Update Nova workflow triggers and wheel version (#2020)
Summary: Pull Request resolved: #2020 Update nova workflow to be triggered on pushes to main and releases branches and tags. Update wheel version name to match pytorch convention (e.g., +cpu, +cu118) Reviewed By: q10 Differential Revision: D49296399 fbshipit-source-id: e4ed56c12dfb2f68d5b131b29c8ce0294e2a4522
1 parent 54556c6 commit 5a40006

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

.github/workflows/build-wheels-linux.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ on:
55
push:
66
branches:
77
- nightly
8+
- main
9+
# Release candidate branch look like: v1.11.0-rc1
10+
- v[0-9]+.[0-9]+.[0-9]+-release+
11+
tags:
12+
# Release candidate tag look like: v1.11.0-rc1
13+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
14+
- v[0-9]+.[0-9]+.[0-9]+
815
workflow_dispatch:
916

1017
jobs:

fbgemm_gpu/setup.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from tabulate import tabulate
2525

2626

27-
def generate_package_version(package_name: str):
27+
def generate_package_version(package_name: str, version_variant: str):
2828
print("[SETUP.PY] Generating the package version ...")
2929

3030
if "nightly" in package_name:
@@ -47,10 +47,7 @@ def generate_package_version(package_name: str):
4747
# Remove the local version identifier, if any (e.g. 0.4.0rc0.post0+git.6a63116c.dirty => 0.4.0rc0.post0)
4848
# Then remove post0 (keep postN for N > 0) (e.g. 0.4.0rc0.post0 => 0.4.0rc0)
4949
version = re.sub(".post0$", "", gitversion.version_from_git().split("+")[0])
50-
print("version from gitversion: ", version)
51-
print(gitversion.version_from_git())
52-
# Manually change version
53-
version = "0.5.0rc3"
50+
version = str(version) + version_variant
5451
print(f"[SETUP.PY] Setting the package version: {version}")
5552
return version
5653

@@ -282,14 +279,21 @@ def main(argv: List[str]) -> None:
282279
else:
283280
package_name = args.package_name
284281

285-
if not args.cpu_only:
282+
if args.cpu_only:
283+
version_variant = "+cpu"
284+
else:
286285
set_cuda_environment_variables()
286+
if torch.version.cuda is not None:
287+
cuda_version = torch.version.cuda.split(".")
288+
version_variant = "+cu" + str(cuda_version[0]) + str(cuda_version[1])
289+
else:
290+
version_variant = ""
287291

288292
# Repair command line args for setup.
289293
sys.argv = [sys.argv[0]] + unknown
290294

291295
# Determine the package version
292-
package_version = generate_package_version(args.package_name)
296+
package_version = generate_package_version(args.package_name, version_variant)
293297

294298
# Generate the version file
295299
FbgemmGpuInstaller.generate_version_file(package_version)

0 commit comments

Comments
 (0)