Skip to content

Commit 32475b9

Browse files
authored
feature: Add TF Serving 2.12.1 images to the SM PySDK (#3871)
1 parent a40f64a commit 32475b9

File tree

3 files changed

+90
-3
lines changed

3 files changed

+90
-3
lines changed

src/sagemaker/image_uri_config/tensorflow.json

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@
320320
"2.8": "2.8.4",
321321
"2.9": "2.9.3",
322322
"2.10": "2.10.1",
323-
"2.11": "2.11.0"
323+
"2.11": "2.11.1",
324+
"2.12": "2.12.1"
324325
},
325326
"versions": {
326327
"1.10.0": {
@@ -1938,6 +1939,80 @@
19381939
"us-west-2": "763104351884"
19391940
},
19401941
"repository": "tensorflow-inference"
1942+
},
1943+
"2.11.1": {
1944+
"registries": {
1945+
"af-south-1": "626614931356",
1946+
"ap-east-1": "871362719292",
1947+
"ap-northeast-1": "763104351884",
1948+
"ap-northeast-2": "763104351884",
1949+
"ap-northeast-3": "364406365360",
1950+
"ap-south-1": "763104351884",
1951+
"ap-south-2": "772153158452",
1952+
"ap-southeast-1": "763104351884",
1953+
"ap-southeast-2": "763104351884",
1954+
"ap-southeast-3": "907027046896",
1955+
"ap-southeast-4": "457447274322",
1956+
"ca-central-1": "763104351884",
1957+
"cn-north-1": "727897471807",
1958+
"cn-northwest-1": "727897471807",
1959+
"eu-central-1": "763104351884",
1960+
"eu-central-2": "380420809688",
1961+
"eu-north-1": "763104351884",
1962+
"eu-south-1": "692866216735",
1963+
"eu-south-2": "503227376785",
1964+
"eu-west-1": "763104351884",
1965+
"eu-west-2": "763104351884",
1966+
"eu-west-3": "763104351884",
1967+
"me-south-1": "217643126080",
1968+
"sa-east-1": "763104351884",
1969+
"us-east-1": "763104351884",
1970+
"us-east-2": "763104351884",
1971+
"us-gov-east-1": "446045086412",
1972+
"us-gov-west-1": "442386744353",
1973+
"us-iso-east-1": "886529160074",
1974+
"us-isob-east-1": "094389454867",
1975+
"us-west-1": "763104351884",
1976+
"us-west-2": "763104351884"
1977+
},
1978+
"repository": "tensorflow-inference"
1979+
},
1980+
"2.12.1": {
1981+
"registries": {
1982+
"af-south-1": "626614931356",
1983+
"ap-east-1": "871362719292",
1984+
"ap-northeast-1": "763104351884",
1985+
"ap-northeast-2": "763104351884",
1986+
"ap-northeast-3": "364406365360",
1987+
"ap-south-1": "763104351884",
1988+
"ap-south-2": "772153158452",
1989+
"ap-southeast-1": "763104351884",
1990+
"ap-southeast-2": "763104351884",
1991+
"ap-southeast-3": "907027046896",
1992+
"ap-southeast-4": "457447274322",
1993+
"ca-central-1": "763104351884",
1994+
"cn-north-1": "727897471807",
1995+
"cn-northwest-1": "727897471807",
1996+
"eu-central-1": "763104351884",
1997+
"eu-central-2": "380420809688",
1998+
"eu-north-1": "763104351884",
1999+
"eu-south-1": "692866216735",
2000+
"eu-south-2": "503227376785",
2001+
"eu-west-1": "763104351884",
2002+
"eu-west-2": "763104351884",
2003+
"eu-west-3": "763104351884",
2004+
"me-south-1": "217643126080",
2005+
"sa-east-1": "763104351884",
2006+
"us-east-1": "763104351884",
2007+
"us-east-2": "763104351884",
2008+
"us-gov-east-1": "446045086412",
2009+
"us-gov-west-1": "442386744353",
2010+
"us-iso-east-1": "886529160074",
2011+
"us-isob-east-1": "094389454867",
2012+
"us-west-1": "763104351884",
2013+
"us-west-2": "763104351884"
2014+
},
2015+
"repository": "tensorflow-inference"
19412016
}
19422017
}
19432018
},

src/sagemaker/tensorflow/model.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,16 @@ def __init__(
185185
)
186186
self.framework_version = framework_version
187187

188+
# Inference framework version is being introduced to accomodate the mismatch between
189+
# tensorflow and tensorflow serving releases, wherein the TF and TFS might have different
190+
# patch versions, but end up hosting the model of same TF version. For eg., the upstream
191+
# TFS-2.12.0 release was a bad release and hence a new TFS-2.12.1 release was made to host
192+
# models from TF-2.12.0.
193+
training_inference_version_mismatch_dict = {"2.12.0": "2.12.1"}
194+
self.inference_framework_version = training_inference_version_mismatch_dict.get(
195+
framework_version, framework_version
196+
)
197+
188198
super(TensorFlowModel, self).__init__(
189199
model_data=model_data,
190200
role=role,
@@ -463,7 +473,7 @@ def _get_image_uri(
463473
return image_uris.retrieve(
464474
self._framework_name,
465475
region_name or self.sagemaker_session.boto_region_name,
466-
version=self.framework_version,
476+
version=self.inference_framework_version,
467477
instance_type=instance_type,
468478
accelerator_type=accelerator_type,
469479
image_scope="inference",

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,9 @@ def tf_full_py_version(tf_full_version):
528528
return "py37"
529529
if version < Version("2.8"):
530530
return "py38"
531-
return "py39"
531+
if version < Version("2.12"):
532+
return "py39"
533+
return "py310"
532534

533535

534536
@pytest.fixture(scope="module")

0 commit comments

Comments
 (0)