Skip to content

change: add compilation option for ml_eia2 #2242

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 15 commits into from
Mar 30, 2021
32 changes: 31 additions & 1 deletion src/sagemaker/image_uri_config/tensorflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"1.13": "1.13.0",
"1.14": "1.14.0",
"1.15": "1.15.0",
"2.0": "2.0.0"
"2.0": "2.0.0",
"2.3": "2.3.0"
},
"versions": {
"1.10.0": {
Expand Down Expand Up @@ -218,6 +219,35 @@
"us-west-2": "763104351884"
},
"repository": "tensorflow-inference-eia"
},
"2.3.0": {
"registries": {
"af-south-1": "626614931356",
"ap-east-1": "871362719292",
"ap-northeast-1": "763104351884",
"ap-northeast-2": "763104351884",
"ap-south-1": "763104351884",
"ap-southeast-1": "763104351884",
"ap-southeast-2": "763104351884",
"ca-central-1": "763104351884",
"cn-north-1": "727897471807",
"cn-northwest-1": "727897471807",
"eu-central-1": "763104351884",
"eu-north-1": "763104351884",
"eu-south-1": "692866216735",
"eu-west-1": "763104351884",
"eu-west-2": "763104351884",
"eu-west-3": "763104351884",
"me-south-1": "217643126080",
"sa-east-1": "763104351884",
"us-east-1": "763104351884",
"us-east-2": "763104351884",
"us-gov-west-1": "442386744353",
"us-iso-east-1": "886529160074",
"us-west-1": "763104351884",
"us-west-2": "763104351884"
},
"repository": "tensorflow-inference-eia"
}
}
},
Expand Down
4 changes: 3 additions & 1 deletion src/sagemaker/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,9 @@ def compile(
job_status = self.sagemaker_session.wait_for_compilation_job(job_name)
self.model_data = job_status["ModelArtifacts"]["S3ModelArtifacts"]
if target_instance_family is not None:
if target_instance_family.startswith("ml_"):
if target_instance_family == "ml_eia2":
pass
elif target_instance_family.startswith("ml_"):
self.image_uri = self._compilation_image_uri(
self.sagemaker_session.boto_region_name,
target_instance_family,
Expand Down
9 changes: 7 additions & 2 deletions src/sagemaker/tensorflow/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class TensorFlowModel(sagemaker.model.FrameworkModel):
logging.ERROR: "error",
logging.CRITICAL: "crit",
}
LATEST_EIA_VERSION = [2, 0]
LATEST_EIA_VERSION = [2, 3]

def __init__(
self,
Expand Down Expand Up @@ -289,7 +289,12 @@ def deploy(

def _eia_supported(self):
"""Return true if TF version is EIA enabled"""
return [int(s) for s in self.framework_version.split(".")][:2] <= self.LATEST_EIA_VERSION
framework_version = [int(s) for s in self.framework_version.split(".")][:2]
return (
framework_version != [2, 1]
and framework_version != [2, 2]
and framework_version <= self.LATEST_EIA_VERSION
)

def prepare_container_def(self, instance_type=None, accelerator_type=None):
"""Prepare the container definition.
Expand Down
Binary file added tests/data/cuteCat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.