CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
49 lines
1.5 KiB
Python
Executable File
49 lines
1.5 KiB
Python
Executable File
#!/usr/bin/env python
|
|
# Copyright Advanced Micro Devices, Inc.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
import re
|
|
|
|
|
|
def check_wheel(wheel: Path, expected_name: str):
|
|
# Check 1: Filename starts with expected prefix
|
|
if not wheel.name.startswith(f"{expected_name}-"):
|
|
print(f"ERROR: Unexpected wheel name: {wheel.name}")
|
|
sys.exit(1)
|
|
|
|
# Check 2: File size sanity
|
|
size = wheel.stat().st_size
|
|
if size < 100 * 1024: # minimum 100 KB
|
|
print(f"ERROR: Wheel {wheel.name} is too small ({size} bytes)")
|
|
sys.exit(1)
|
|
|
|
# Check 3: Wheel name format (e.g. torch-2.1.0+rocmsdk20250529-cp312-cp312-linux_x86_64.whl)
|
|
wheel_name_re = re.compile(rf"^{re.escape(expected_name)}-[\d\.]+.*\.whl$")
|
|
if not wheel_name_re.match(wheel.name):
|
|
print(f"WARNING: Wheel name {wheel.name} does not match typical pattern")
|
|
|
|
print(f"Valid wheel: {wheel.name} ({size} bytes)")
|
|
|
|
|
|
def main():
|
|
if len(sys.argv) != 2:
|
|
print(f"Usage: {sys.argv[0]} <wheel-dir>")
|
|
sys.exit(1)
|
|
|
|
wheel_dir = Path(sys.argv[1])
|
|
if not wheel_dir.is_dir():
|
|
print(f"ERROR: {wheel_dir} is not a directory")
|
|
sys.exit(1)
|
|
|
|
# Expected names: torch, torchaudio, torchvision
|
|
for expected_name in ["torch", "torchaudio", "torchvision"]:
|
|
wheels = list(wheel_dir.glob(f"{expected_name}-*.whl"))
|
|
for wheel in wheels:
|
|
check_wheel(wheel, expected_name)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|