Skip to content

Commit 8a34587

Browse files
authored
Updated pytorch version in CI and docker (#3298)
* Updated pytorch version in CI and docker * Fix docker tag * Fix docker tag value removing +cu124 like words from torch version * Fix version compare in test_image
1 parent 3c5e213 commit 8a34587

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.github/workflows/pytorch-version-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
# will drop python version and related pytorch versions
2020
python-version: [3.8, 3.9, "3.10"]
2121
pytorch-version:
22-
[2.3.1, 2.2.2, 2.1.2, 2.0.1, 1.13.1, 1.12.1, 1.10.0, 1.8.1]
22+
[2.4.1, 2.3.1, 2.2.2, 2.0.1, 1.13.1, 1.12.1, 1.10.0, 1.8.1]
2323
exclude:
2424
# disabling python 3.9 support with PyTorch 1.7.1 and 1.8.1, to stop repeated pytorch-version test fail.
2525
# https://github.com/pytorch/ignite/issues/2383

docker/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ echo "opt_build_args: ${opt_build_args}"
8080

8181
retry "docker build --build-arg PTH_VERSION=${pth_version} ${opt_build_args} -t pytorchignite/${image_name}:latest -f Dockerfile.${image_name} ." "\nBuild failed: ${image_name}"
8282
if [ -z $image_tag ]; then
83-
image_tag=`docker run --rm -i pytorchignite/${image_name}:latest python -c "import torch; import ignite; print(torch.__version__ + \"-\" + ignite.__version__, end=\"\")"`
83+
image_tag=`docker run --rm -i pytorchignite/${image_name}:latest python -c "import torch; import ignite; print(torch.__version__.split('+')[0] + \"-\" + ignite.__version__, end=\"\")"`
8484
fi
8585
docker tag pytorchignite/${image_name}:latest pytorchignite/${image_name}:${image_tag}
8686

docker/docker.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[DEFAULT]
2-
build_docker_image_pytorch_version = 2.4.0-cuda12.4-cudnn9
2+
build_docker_image_pytorch_version = 2.5.1-cuda12.4-cudnn9
33
build_docker_image_hvd_version = v0.28.1
44
build_docker_image_msdp_version = v0.14.0

docker/test_image.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ def check_package(package_name, expected_version=None):
1919
if expected_version is not None:
2020
assert hasattr(mod, "__version__"), f"Imported package {package_name} does not have __version__ attribute"
2121
version = mod.__version__
22+
# Remove all +something from the version name: e.g torch 2.5.1+cu124
23+
if "+" in version:
24+
old_version = version
25+
version = version.split("+")[0]
26+
print(f"Transformed version: {old_version} -> {version}")
2227
assert (
2328
version == expected_version
2429
), f"Version mismatch for package {package_name}: got {version} but expected {expected_version}"

0 commit comments

Comments
 (0)