Skip to content

Commit 2e2ffc0

Browse files
authored
test(image_uris): derive pytorch-amzn2023 versions from config (#6385)
test_pytorch_amzn2023_training_uris compared the config's version list against a hardcoded ["2.11", "2.12", "2.13"]. The automated image_uri_configs update (#6374) added 2.14, so the exact-equality assertion broke sagemaker-core unit tests on master. Iterate over the versions present in the config, require a minimum set of known versions, and check that the "latest" alias points to a defined version, so future version additions do not break the test.
1 parent d0abf32 commit 2e2ffc0

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎sagemaker-core/tests/unit/image_uris/test_pytorch_amzn2023.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,20 @@
2525
# encodes CUDA directly (e.g. 2.13-cu133-amzn2023-sagemaker) with no "gpu" token,
2626
# so these versions set "processor_in_tag": false and bake the accelerator into
2727
# container_version.
28-
AMZN2023_VERSIONS = ["2.11", "2.12", "2.13"]
28+
# Versions that must stay resolvable. Newer versions added by the automated
29+
# image_uri_configs updates are picked up from the config automatically, so this
30+
# set only needs to grow when a version must be guaranteed to remain available.
31+
REQUIRED_AMZN2023_VERSIONS = {"2.11", "2.12", "2.13", "2.14"}
2932

3033

3134
@pytest.mark.parametrize("load_config", ["pytorch-amzn2023.json"], indirect=True)
3235
def test_pytorch_amzn2023_training_uris(load_config):
3336
"""pytorch-amzn2023 resolves both cpu and gpu; the gpu tag carries cuNNN, not "gpu"."""
3437
training = load_config["training"]
35-
assert sorted(training["versions"]) == sorted(AMZN2023_VERSIONS)
36-
for version in AMZN2023_VERSIONS:
37-
version_config = training["versions"][version]
38+
versions = training["versions"]
39+
assert REQUIRED_AMZN2023_VERSIONS <= set(versions)
40+
assert training["version_aliases"]["latest"] in versions
41+
for version, version_config in versions.items():
3842
assert version_config["repository"] == "pytorch"
3943
assert version_config["processor_in_tag"] is False
4044
container_version = version_config["container_version"]

0 commit comments

Comments
 (0)