Skip to content

Release v1 #1595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/validate-linux-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
needs: generate-linux-matrix
uses: pytorch/test-infra/.github/workflows/generate_release_matrix.yml@main
with:
version: ${{ fromJson(needs.generate-linux-matrix.outputs.matrix).stable_version }}
version: "2.1.1"

linux:
needs: [generate-linux-matrix, generate-release-matrix]
Expand Down
24 changes: 24 additions & 0 deletions test/smoke_test/smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ def forward(self, x):
output = self.fc1(x)
return output

def load_json_from_basedir(filename: str):
try:
if os.path.exists(BASE_DIR / filename):
with open(BASE_DIR / filename) as fptr:
return json.load(fptr)
else:
return None
except FileNotFoundError as exc:
raise ImportError(f"File {filename} not found error: {exc.strerror}") from exc
except json.JSONDecodeError as exc:
raise ImportError(f"Invalid JSON {filename}") from exc

def read_release_matrix():
return load_json_from_basedir("release_matrix.json")

def check_version(package: str) -> None:
# only makes sense to check nightly package where dates are known
Expand All @@ -62,6 +76,16 @@ def check_version(package: str) -> None:
raise RuntimeError(
f"Torch version mismatch, expected {stable_version} for channel {channel}. But its {torch.__version__}"
)
release_version = read_release_matrix()
if package == "all":
for module in MODULES:
imported_module = importlib.import_module(module["name"])
module_version = imported_module.__version__
if not module_version.startswith(release_version[module["name"]]):
raise RuntimeError(
f"{module['name']} version mismatch, expected {release_version[module['name']]} for channel {channel}. But its {module_version}"
)

else:
print(f"Skip version check for channel {channel} as stable version is None")

Expand Down