Skip to content

Commit 7f0e742

Browse files
committed
Merge branch 'smp-2.5' of https://github.com/adtian2/sagemaker-python-sdk into smp-2.5
2 parents b4f1348 + e44b482 commit 7f0e742

File tree

9 files changed

+83
-8
lines changed

9 files changed

+83
-8
lines changed

src/sagemaker/image_uri_config/huggingface-llm-neuronx.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"inf2"
55
],
66
"version_aliases": {
7-
"0.0": "0.0.23"
7+
"0.0": "0.0.24"
88
},
99
"versions": {
1010
"0.0.16": {
@@ -238,6 +238,35 @@
238238
"container_version": {
239239
"inf2": "ubuntu22.04"
240240
}
241+
},
242+
"0.0.24": {
243+
"py_versions": [
244+
"py310"
245+
],
246+
"registries": {
247+
"ap-northeast-1": "763104351884",
248+
"ap-south-1": "763104351884",
249+
"ap-south-2": "772153158452",
250+
"ap-southeast-1": "763104351884",
251+
"ap-southeast-2": "763104351884",
252+
"ap-southeast-4": "457447274322",
253+
"eu-central-1": "763104351884",
254+
"eu-central-2": "380420809688",
255+
"eu-south-2": "503227376785",
256+
"eu-west-1": "763104351884",
257+
"eu-west-3": "763104351884",
258+
"il-central-1": "780543022126",
259+
"sa-east-1": "763104351884",
260+
"us-east-1": "763104351884",
261+
"us-east-2": "763104351884",
262+
"us-west-2": "763104351884",
263+
"ca-west-1": "204538143572"
264+
},
265+
"tag_prefix": "2.1.2-optimum0.0.24",
266+
"repository": "huggingface-pytorch-tgi-inference",
267+
"container_version": {
268+
"inf2": "ubuntu22.04"
269+
}
241270
}
242271
}
243272
}

src/sagemaker/tensorflow/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def __init__(
199199
# patch versions, but end up hosting the model of same TF version. For eg., the upstream
200200
# TFS-2.12.0 release was a bad release and hence a new TFS-2.12.1 release was made to host
201201
# models from TF-2.12.0.
202-
training_inference_version_mismatch_dict = {"2.12.0": "2.12.1"}
202+
training_inference_version_mismatch_dict = {"2.12.0": "2.12.1", "2.16.2": "2.16.1"}
203203
self.inference_framework_version = training_inference_version_mismatch_dict.get(
204204
framework_version, framework_version
205205
)

tests/conftest.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
from botocore.config import Config
2424
from packaging.version import Version
25+
from packaging.specifiers import SpecifierSet
2526

2627
from sagemaker import Session, image_uris, utils, get_execution_role
2728
from sagemaker.local import LocalSession
@@ -555,11 +556,18 @@ def tf_full_version(tensorflow_training_latest_version, tensorflow_inference_lat
555556
Fixture exists as such, since TF training and TFS have different latest versions.
556557
Otherwise, this would simply be a single latest version.
557558
"""
558-
return str(
559-
min(
560-
Version(tensorflow_training_latest_version),
561-
Version(tensorflow_inference_latest_version),
562-
)
559+
tensorflow_training_latest_version = Version(tensorflow_training_latest_version)
560+
tensorflow_inference_latest_version = Version(tensorflow_inference_latest_version)
561+
562+
return_version = min(
563+
tensorflow_training_latest_version,
564+
tensorflow_inference_latest_version,
565+
)
566+
567+
return (
568+
f"{return_version.major}.{return_version.minor}"
569+
if return_version in SpecifierSet(">=2.16")
570+
else str(return_version)
563571
)
564572

565573

tests/data/tensorflow_mnist/mnist_v2.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,10 @@ def main(args):
198198

199199
if args.current_host == args.hosts[0]:
200200
ckpt_manager.save()
201-
net.save("/opt/ml/model/1")
201+
if int(tf_major) > 2 or (int(tf_major) == 2 and int(tf_minor) >= 16):
202+
net.export("/opt/ml/model/1")
203+
else:
204+
net.save("/opt/ml/model/1")
202205

203206

204207
if __name__ == "__main__":

tests/integ/sagemaker/workflow/test_model_create_and_registration.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525

2626
import pytest
2727

28+
from packaging.version import Version
29+
from packaging.specifiers import SpecifierSet
30+
2831
from sagemaker.model_card.model_card import ModelCard, ModelOverview, ModelPackageModelCard
2932
from sagemaker.model_card.schema_constraints import ModelCardStatusEnum
3033
import tests
@@ -1250,6 +1253,11 @@ def test_model_registration_with_tensorflow_model_with_pipeline_model(
12501253
pipeline_name,
12511254
region_name,
12521255
):
1256+
if Version(tf_full_version) in SpecifierSet("==2.16.*"):
1257+
pytest.skip(
1258+
"This test is failing in TensorFlow 2.16 beacuse of an upstream bug: "
1259+
"https://github.com/tensorflow/io/issues/2039"
1260+
)
12531261
base_dir = os.path.join(DATA_DIR, "tensorflow_mnist")
12541262
entry_point = os.path.join(base_dir, "mnist_v2.py")
12551263
input_path = sagemaker_session_for_pipeline.upload_data(

tests/integ/sagemaker/workflow/test_model_steps.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
import pytest
1919

20+
from packaging.version import Version
21+
from packaging.specifiers import SpecifierSet
22+
2023
from tests.integ.sagemaker.workflow.helpers import wait_pipeline_execution
2124
from sagemaker.workflow.fail_step import FailStep
2225
from sagemaker.workflow.functions import Join
@@ -589,6 +592,11 @@ def test_model_registration_with_drift_check_baselines_and_model_metrics(
589592
def test_model_registration_with_tensorflow_model_with_pipeline_model(
590593
pipeline_session, role, tf_full_version, tf_full_py_version, pipeline_name
591594
):
595+
if Version(tf_full_version) in SpecifierSet("==2.16.*"):
596+
pytest.skip(
597+
"This test is failing in TensorFlow 2.16 beacuse of an upstream bug: "
598+
"https://github.com/tensorflow/io/issues/2039"
599+
)
592600
base_dir = os.path.join(DATA_DIR, "tensorflow_mnist")
593601
entry_point = os.path.join(base_dir, "mnist_v2.py")
594602
input_path = pipeline_session.upload_data(

tests/integ/sagemaker/workflow/test_training_steps.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
import pytest
2020

21+
from packaging.version import Version
22+
from packaging.specifiers import SpecifierSet
23+
2124
from tests.integ.sagemaker.workflow.helpers import wait_pipeline_execution
2225
from sagemaker import TrainingInput, get_execution_role, utils, image_uris
2326
from sagemaker.debugger import (
@@ -235,6 +238,12 @@ def test_training_step_with_output_path_as_join(
235238
def test_tensorflow_training_step_with_parameterized_code_input(
236239
pipeline_session, role, tf_full_version, tf_full_py_version, pipeline_name
237240
):
241+
if Version(tf_full_version) in SpecifierSet("==2.16.*"):
242+
pytest.skip(
243+
"This test is failing in TensorFlow 2.16 beacuse of an upstream bug: "
244+
"https://github.com/tensorflow/io/issues/2039"
245+
)
246+
238247
base_dir = os.path.join(DATA_DIR, "tensorflow_mnist")
239248
entry_point1 = "mnist_v2.py"
240249
entry_point2 = "mnist_dummy.py"

tests/integ/test_transformer.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
import pytest
2020

21+
from packaging.version import Version
22+
from packaging.specifiers import SpecifierSet
23+
2124
from sagemaker import KMeans, s3, get_execution_role
2225
from sagemaker.mxnet import MXNet
2326
from sagemaker.pytorch import PyTorchModel
@@ -553,6 +556,12 @@ def test_transform_mxnet_logs(
553556
def test_transform_tf_kms_network_isolation(
554557
sagemaker_session, cpu_instance_type, tmpdir, tf_full_version, tf_full_py_version
555558
):
559+
if Version(tf_full_version) in SpecifierSet("==2.16.*"):
560+
pytest.skip(
561+
"This test is failing in TensorFlow 2.16 beacuse of an upstream bug: "
562+
"https://github.com/tensorflow/io/issues/2039"
563+
)
564+
556565
data_path = os.path.join(DATA_DIR, "tensorflow_mnist")
557566

558567
tf = TensorFlow(

tests/unit/sagemaker/image_uris/test_huggingface_llm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"0.0.21": "1.13.1-optimum0.0.21-neuronx-py310-ubuntu22.04",
5656
"0.0.22": "2.1.2-optimum0.0.22-neuronx-py310-ubuntu22.04",
5757
"0.0.23": "2.1.2-optimum0.0.23-neuronx-py310-ubuntu22.04",
58+
"0.0.24": "2.1.2-optimum0.0.24-neuronx-py310-ubuntu22.04",
5859
},
5960
}
6061

0 commit comments

Comments
 (0)