SageMaker Edge Manager
Important
SageMaker Edge Manager was discontinued on April 26th, 2024. For more information about continuing to deploy your models to edge devices, see SageMaker Edge Manager end of life.
The Amazon SageMaker Edge Manager component (aws.greengrass.SageMakerEdgeManager
) installs the SageMaker Edge Manager agent binary.
SageMaker Edge Manager provides model management for edge devices so you can optimize, secure, monitor, and maintain machine learning models on fleets of edge devices. The SageMaker Edge Manager component installs and manages the lifecycle of the SageMaker Edge Manager agent on your core device. You can also use SageMaker Edge Manager to package and use SageMaker Neo-compiled models as model components on Greengrass core devices. For more information about using SageMaker Edge Manager agent on your core device, see Use Amazon SageMaker Edge Manager on Greengrass core devices.
SageMaker Edge Manager component v1.3.x installs Edge Manager agent binary v1.20220822.836f3023. For more information about Edge Manager agent binary versions, see Edge Manager Agent.
Note
The SageMaker Edge Manager component is available only in the following AWS Regions:
-
US East (Ohio)
-
US East (N. Virginia)
-
US West (Oregon)
-
EU (Frankfurt)
-
EU (Ireland)
-
Asia Pacific (Tokyo)
Versions
This component has the following versions:
-
1.3.x
-
1.2.x
-
1.1.x
-
1.0.x
Type
This component is a generic component (aws.greengrass.generic
). The Greengrass nucleus runs the component's lifecycle
scripts.
For more information, see Component types.
Operating system
This component can be installed on core devices that run the following operating systems:
Linux
Windows
Requirements
This component has the following requirements:
-
A Greengrass core device running on Amazon Linux 2, a Debian-based Linux platform (x86_64 or Armv8), or Windows (x86_64). If you don't have one, see Tutorial: Getting started with AWS IoT Greengrass V2.
-
Python
3.6 or later, including pip
for your version of Python, installed on your core device. -
The Greengrass device role configured with the following:
-
A trust relationship that allows
credentials.iot.amazonaws.com
andsagemaker.amazonaws.com
to assume the role, as shown in the following IAM policy example.{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "credentials.iot.amazonaws.com" }, "Action": "sts:AssumeRole" }, { "Effect": "Allow", "Principal": { "Service": "sagemaker.amazonaws.com" }, "Action": "sts:AssumeRole" } ] }
-
The AmazonSageMakerEdgeDeviceFleetPolicy
IAM managed policy. -
The
s3:PutObject
action, as shown in the following IAM policy example.{ "Version": "2012-10-17", "Statement": [ { "Action": [ "s3:PutObject" ], "Resource": [ "*" ], "Effect": "Allow" } ] }
-
-
An Amazon S3 bucket created in the same AWS account and AWS Region as your Greengrass core device. SageMaker Edge Manager requires an S3 bucket to create an edge device fleet, and to store sample data from running inference on your device. For information about creating S3 buckets, see Getting started with Amazon S3.
-
A SageMaker edge device fleet that uses the same AWS IoT role alias as your Greengrass core device. For more information, see Create an edge device fleet.
-
Your Greengrass core device registered as an edge device in your SageMaker Edge device fleet. The edge device name must match the AWS IoT thing name for your core device. For more information, see Register your Greengrass core device.
Endpoints and ports
This component must be able to perform outbound requests to the following endpoints and ports, in addition to endpoints and ports required for basic operation. For more information, see Allow device traffic through a proxy or firewall.
Endpoint | Port | Required | Description |
---|---|---|---|
|
443 | Yes |
Check device registration status and send metrics to SageMaker. |
|
443 | Yes |
Upload capture data to the S3 bucket that you specify. You can replace |
Dependencies
When you deploy a component, AWS IoT Greengrass also deploys compatible versions of its dependencies. This means that you must meet the requirements for the component and all of its dependencies to successfully deploy the component. This section lists the dependencies for the released versions of this component and the semantic version constraints that define the component versions for each dependency. You can also view the dependencies for each version of the component in the AWS IoT Greengrass console
For more information about component dependencies, see the component recipe reference.
Configuration
This component provides the following configuration parameters that you can customize when you deploy the component.
Note
This section describes the configuration parameters that you set in the component. For more information about the corresponding SageMaker Edge Manager configuration, see Edge Manager Agent in the Amazon SageMaker Developer Guide.
DeviceFleetName
-
The name of the SageMaker Edge Manager device fleet that contains your Greengrass core device.
You must specify a value for this parameter in the configuration update when you deploy this component.
BucketName
-
The name of the S3 bucket to which you upload captured inference data. The bucket name must contain the string
sagemaker
.If you set
CaptureDataDestination
toCloud
, or if you setCaptureDataPeriodicUpload
totrue
, then you must specify a value for this parameter in the configuration update when you deploy this component.Note
Capture data is an SageMaker feature that you use to upload inference input, inference results, and additional inference data to an S3 bucket or a local directory for future analysis. For more information about using capture data with SageMaker Edge Manager, see Manage Model in the Amazon SageMaker Developer Guide.
CaptureDataBatchSize
-
(Optional) The size of a batch of capture data requests that the agent handles. This value must be less than the buffer size that you specify in
CaptureDataBufferSize
. We recommend that you don't exceed half the buffer size.The agent handles a request batch when the number of requests in the buffer meets the
CaptureDataBatchSize
number, or when theCaptureDataPushPeriodSeconds
interval elapses, whichever occurs first.Default:
10
CaptureDataBufferSize
-
(Optional) The maximum number of capture data requests stored in the buffer.
Default:
30
CaptureDataDestination
-
(Optional) The destination where you store captured data. This parameter can have the following values:
-
Cloud
—Uploads captured data to the S3 bucket that you specify inBucketName
. -
Disk
—Writes captured data to the component's work directory.
If you specify
Disk
, you can also choose to periodically upload the captured data to your S3 bucket by settingCaptureDataPeriodicUpload
totrue
.Default:
Cloud
-
CaptureDataPeriodicUpload
-
(Optional) String value that specifies whether to periodically upload captured data. Supported values are
true
andfalse
.Set this parameter to
true
if you setCaptureDataDestination
toDisk
, and you also want the agent to periodically upload the captured data your S3 bucket.Default:
false
CaptureDataPeriodicUploadPeriodSeconds
-
(Optional) The interval in seconds at which SageMaker Edge Manager agent uploads captured data to the S3 bucket. Use this parameter if you set
CaptureDataPeriodicUpload
totrue
.Default:
8
CaptureDataPushPeriodSeconds
-
(Optional) The interval in seconds at which SageMaker Edge Manager agent handles a batch of capture data requests from the buffer.
The agent handles a request batch when the number of requests in the buffer meets the
CaptureDataBatchSize
number, or when theCaptureDataPushPeriodSeconds
interval elapses, whichever occurs first.Default:
4
CaptureDataBase64EmbedLimit
-
(Optional) The maximum size in bytes of captured data that SageMaker Edge Manager agent uploads.
Default:
3072
FolderPrefix
-
(Optional) The name of the folder to which the agent writes the captured data. If you set
CaptureDataDestination
toDisk
, the agent creates the folder in the directory that is specified byCaptureDataDiskPath
. If you setCaptureDataDestination
toCloud
, or if you setCaptureDataPeriodicUpload
totrue
, the agent creates the folder in your S3 bucket.Default:
sme-capture
CaptureDataDiskPath
-
This feature is available in v1.1.0 and later versions of the SageMaker Edge Manager component.
(Optional) The path to the folder to which the agent creates the captured data folder. If you set
CaptureDataDestination
toDisk
, the agent creates the captured data folder in this directory. If you don't specify this value, the agent creates the captured data folder in the component's work directory. Use theFolderPrefix
parameter to specify the name of the captured data folder.Default:
/work/aws.greengrass.SageMakerEdgeManager/capture/greengrass/v2
LocalDataRootPath
-
This feature is available in v1.2.0 and later versions of the SageMaker Edge Manager component.
(Optional) The path where this component stores the following data on the core device:
-
The local database for runtime data when you set
DbEnable
totrue
. -
SageMaker Neo-compiled models that this component automatically downloads when you set
DeploymentEnable
totrue
.
Default:
/work/aws.greengrass.SageMakerEdgeManager/greengrass/v2
-
DbEnable
-
(Optional) You can enable this component to store runtime data in a local database to preserve the data, in case the component fails or the device loses power.
This database requires 5 MB of storage on the core device's file system.
Default:
false
DeploymentEnable
-
This feature is available in v1.2.0 and later versions of the SageMaker Edge Manager component.
(Optional) You can enable this component to automatically retrieve SageMaker Neo-compiled models from that you upload to Amazon S3. After you upload a new model to Amazon S3, use SageMaker Studio or the SageMaker API to deploy the new model to this core device. When you enable this feature, you can deploy new models to core devices without needing to create a AWS IoT Greengrass deployment.
Important
To use this feature, you must set
DbEnable
totrue
. This feature uses the local database to track models that it retrieves from the AWS Cloud.Default:
false
DeploymentPollInterval
-
This feature is available in v1.2.0 and later versions of the SageMaker Edge Manager component.
(Optional) The amount of time (in minutes) between which this component checks for new models to download. This option applies when you set
DeploymentEnable
totrue
.Default:
1440
(1 day) DLRBackendOptions
-
This feature is available in v1.2.0 and later versions of the SageMaker Edge Manager component.
(Optional) The DLR runtime flags to set in the DLR runtime that this component uses. You can set the following flag:
-
TVM_TENSORRT_CACHE_DIR
– Enable TensorRT model caching. Specify an absolute path to an existing folder that has read/write permissions. -
TVM_TENSORRT_CACHE_DISK_SIZE_MB
– Assigns the upper limit of the TensorRT model cache folder. When the directory size grows beyond this limit the cached engines that are used the least are deleted. The default value is 512 MB.
For example, you can set this parameter to the following value to enable TensorRT model caching and limit the cache size to 800 MB.
TVM_TENSORRT_CACHE_DIR=/data/secured_folder/trt/cache; TVM_TENSORRT_CACHE_DISK_SIZE_MB=800
-
SagemakerEdgeLogVerbose
-
(Optional) String value that specifies whether to enable debug logging. Supported values are
true
andfalse
.Default:
false
UnixSocketName
-
(Optional) The location of the SageMaker Edge Manager socket file descriptor on the core device.
Default:
/tmp/aws.greengrass.SageMakerEdgeManager.sock
Example: Configuration merge update
The following example configuration specifies that the core device is part of the
MyEdgeDeviceFleet
and that the agent writes capture data both
to the device and to an S3 bucket. This configuration also enables debug logging.
{ "DeviceFleetName": "
MyEdgeDeviceFleet
", "BucketName": "amzn-s3-demo-bucket", "CaptureDataDestination": "Disk", "CaptureDataPeriodicUpload": "true", "SagemakerEdgeLogVerbose": "true" }
Local log file
This component uses the following log file.
To view this component's logs
-
Run the following command on the core device to view this component's log file in real time. Replace
or/greengrass/v2
C:\greengrass\v2
with the path to the AWS IoT Greengrass root folder.
Changelog
The following table describes the changes in each version of the component.
Version |
Changes |
---|---|
1.3.6 |
Version updated for Greengrass nucleus 2.12.5 release. |
1.3.5 |
Version updated for Greengrass nucleus version 2.12.0 release. |
1.3.4 |
Version updated for Greengrass nucleus version 2.11.0 release. |
1.3.3 |
Version updated for Greengrass nucleus version 2.10.0 release. |
1.3.2 |
Version updated for Greengrass nucleus version 2.9.0 release. |
1.3.1 |
Version updated for Greengrass nucleus version 2.8.0 release. |
1.3.0 |
|
1.2.0 |
|
1.1.1 |
Version updated for Greengrass nucleus version 2.7.0 release. |
1.1.0 |
|
1.0.3 |
Version updated for Greengrass nucleus version 2.4.0 release. |
1.0.2 |
|
1.0.1 |
Version updated for Greengrass nucleus version 2.3.0 release. |
1.0.0 |
Initial version. |