Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit 7b1bf7a

Browse files
committed
Add version check
1 parent ae11dd3 commit 7b1bf7a

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

.github/workflows/validate-nightly-binaries.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ jobs:
3030
nightly:
3131
uses: ./.github/workflows/validate-binaries.yml
3232
with:
33-
channel: nightly
33+
channel: test
3434
os: all
35-
limit-win-builds: enable
35+
limit-win-builds: disable

test/smoke_test/smoke_test.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010

1111
gpu_arch_ver = os.getenv("MATRIX_GPU_ARCH_VERSION")
1212
gpu_arch_type = os.getenv("MATRIX_GPU_ARCH_TYPE")
13-
# use installation env variable to tell if it is nightly channel
14-
installation_str = os.getenv("MATRIX_INSTALLATION")
13+
channel = os.getenv("MATRIX_CHANNEL")
14+
stable_version = os.getenv("MATRIX_STABLE_VERSION")
15+
1516
is_cuda_system = gpu_arch_type == "cuda"
1617
SCRIPT_DIR = Path(__file__).parent
1718
NIGHTLY_ALLOWED_DELTA = 3
@@ -31,6 +32,16 @@
3132
},
3233
]
3334

35+
def check_version(package: str) -> None:
36+
# only makes sense to check nightly package where dates are known
37+
if channel == "nightly":
38+
check_nightly_binaries_date(options.package)
39+
else
40+
if torch.__version__ != stable_version:
41+
raise RuntimeError(
42+
f"Torch version mismatch, expected {stable_version} for channel {channel}. But its {torch.__version__}"
43+
)
44+
3445
def check_nightly_binaries_date(package: str) -> None:
3546
from datetime import datetime, timedelta
3647
format_dt = '%Y%m%d'
@@ -190,17 +201,13 @@ def main() -> None:
190201
)
191202
options = parser.parse_args()
192203
print(f"torch: {torch.__version__}")
204+
check_version(options.package)
193205
smoke_test_conv2d()
194206
smoke_test_linalg()
195207

196-
197208
if options.package == "all":
198209
smoke_test_modules()
199210

200-
# only makes sense to check nightly package where dates are known
201-
if installation_str.find("nightly") != -1:
202-
check_nightly_binaries_date(options.package)
203-
204211
smoke_test_cuda(options.package)
205212

206213

0 commit comments

Comments
 (0)