Skip to content

fix: IOC image version select issue #3021

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 7 commits into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from 6 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
4 changes: 2 additions & 2 deletions src/sagemaker/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,9 @@ def _compilation_job_config(
"Framework": framework.upper(),
}

multiple_version_supported_framework_list = ["pytorch", "tensorflow"]
if (
framework.lower() == "pytorch"
or framework.lower() == "tensorflow"
framework.lower() in multiple_version_supported_framework_list
and target_instance_type is not None
and re.match("(?=^ml_)(?!ml_inf)", target_instance_type) is not None
and framework_version is not None
Expand Down
23 changes: 23 additions & 0 deletions tests/unit/sagemaker/model/test_neo.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,29 @@ def test_compile_with_pytorch_neo_in_ml_inf(session):
)


@patch("sagemaker.session.Session")
def test_compile_with_tensorflow_neo_in_ml_inf(session):
session.return_value.boto_region_name = REGION

model = _create_model()
model.compile(
target_instance_family="ml_inf",
input_shape={"data": [1, 3, 1024, 1024]},
output_path="s3://output",
role="role",
framework="tensorflow",
framework_version="1.15",
job_name="compile-model",
)

assert (
"{}.dkr.ecr.{}.amazonaws.com/sagemaker-inference-tensorflow:1.15-cpu-py3".format(
NEO_REGION_ACCOUNT, REGION
)
!= model.image_uri
)


def test_compile_validates_framework_version(sagemaker_session):
sagemaker_session.wait_for_compilation_job = Mock(
return_value={
Expand Down