Skip to content

feature: Add Neo image uri config for Pytorch 1.12 #3507

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 2 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
36 changes: 35 additions & 1 deletion src/sagemaker/image_uri_config/neo-pytorch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"1.7.0": "1.7",
"1.7.1": "1.7",
"1.8.0": "1.8",
"1.8.1": "1.8"
"1.8.1": "1.8",
"1.12.0": "1.12",
"1.12.1": "1.12"
},
"versions": {
"1.4": {
Expand Down Expand Up @@ -173,6 +175,38 @@
"us-west-2": "301217895009"
},
"repository": "sagemaker-inference-pytorch"
},
"1.12": {
"py_versions": ["py3"],
"registries": {
"af-south-1": "774647643957",
"ap-east-1": "110948597952",
"ap-northeast-1": "941853720454",
"ap-northeast-2": "151534178276",
"ap-northeast-3": "925152966179",
"ap-south-1": "763008648453",
"ap-southeast-1": "324986816169",
"ap-southeast-2": "355873309152",
"ca-central-1": "464438896020",
"cn-north-1": "472730292857",
"cn-northwest-1": "474822919863",
"eu-central-1": "746233611703",
"eu-north-1": "601324751636",
"eu-south-1": "966458181534",
"eu-west-1": "802834080501",
"eu-west-2": "205493899709",
"eu-west-3": "254080097072",
"me-south-1": "836785723513",
"sa-east-1": "756306329178",
"us-east-1": "785573368785",
"us-east-2": "007439368137",
"us-gov-west-1": "263933020539",
"us-iso-east-1": "167761179201",
"us-isob-east-1": "406031935815",
"us-west-1": "710691900526",
"us-west-2": "301217895009"
},
"repository": "sagemaker-inference-pytorch"
}
}
}
4 changes: 2 additions & 2 deletions tests/data/pytorch_neo/code/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def model_fn(model_dir):
logger.info("model_fn")
neopytorch.config(model_dir=model_dir, neo_runtime=True)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# The compiled model is saved as "model.pth"
model = torch.jit.load(os.path.join(model_dir, "model.pth"), map_location=device)
# The compiled model is saved as "model.pth" or "model.pt"
model = torch.jit.load(os.path.join(model_dir, "model.pt"), map_location=device)

# It is recommended to run warm-up inference during model load
sample_input_path = os.path.join(model_dir, "sample_input.pkl")
Expand Down