AWS SageMaker Custom Algorithms and Frameworks
AWS SageMaker Custom Algorithms and Frameworks
AWS SageMaker
Chandra Lingam
Cloud Wave LLC
PCA FM Model
Elastic Container Registry S3 Bucket
Model
PCA FM
Elastic Container Registry S3 Bucket
Download Download
Image Model
Model
Elastic Container Registry S3 Bucket
Train
Custom Train Data
Serve Model
Test Data
Hyperparameter
SageMaker Training Instances
Copyright © 2019 ChandraMohan Lingam. All Rights Reserved.
Framework - Training
Train
TensorFlow Train Data Local Mode
Script File
Model
Hyperparameter Test Data
SageMaker Training Instances
Copyright © 2019 ChandraMohan Lingam. All Rights Reserved.
Framework - Hosting
SKLearn TensorFlow
Model
PyTorch MxNet
Elastic Container Registry S3 Bucket
Download Download
Image Model
config
input
data channel
code
/opt/ml
model
output failure
https://docs.aws.amazon.com/sagemaker/latest/dg/amazon-sagemaker-containers.html
Copyright © 2019 ChandraMohan Lingam. All Rights Reserved.
Container Folder Structure - Training
Folder Purpose
/opt/ml/input/config/ • hyperparameters.json for training
• resourceConfig.json - Container network
layout for distributed training
/opt/ml/input/data/channel/ • channel = training, testing, …
• Contains files for each channel
/opt/ml/input/data/training/
/opt/ml/input/data/testing/
/opt/ml/input/data/channel_epoch/ • Channel = training, test, eval, …
• Epoch = 0,1,2,…
• Read the pipe to stream data from S3 for
each epoch
/opt/ml/code/ • Scripts to run from container
Copyright © 2019 ChandraMohan Lingam. All Rights Reserved.
Container Folder Structure – Training Output
Folder Purpose
/opt/ml/model/ • Script should write the generated model to this
directory
• Store your model checkpoints and final output.
• SageMaker uploads the content of model folder to
your S3 bucket
/opt/ml/output/failure • If the training fails, your script should write the error
description to the failure file
• SageMaker returns the first 1024 characters from
this file as Failure Reason in the job description
• SageMaker uploads content of output folder to your
S3 bucket
Folder Purpose
50,000+ Students
Up-to-date Content