Avra RFM on AWS SageMaker
Run Avra RFM in your own AWS account. Subscribe on AWS Marketplace, then run training and inference jobs on Amazon SageMaker.
Avra RFM is available on AWS Marketplace as an AWS SageMaker algorithm. You subscribe with your AWS account, and Amazon SageMaker runs the model as jobs in that account. Your data never leaves it.
Setting up takes five steps: you agree on the license with your Avra team, you subscribe, you request service quotas, you prepare S3 and an execution role, and you run jobs. This page covers each step, then the IAM, S3, and network setup the jobs need, and what stays in your account.
How it works
| Job | What it does | Output |
|---|---|---|
| Inference | Scores the records you send | Scores, written to your S3 |
| Training | Adapts a copy of the RFM to your database, or fine-tunes it on a task | A copy exclusive to your workspace, written to your S3 encrypted |
Training jobs are for adaptation and fine-tuning.
Jobs read the data the ingestion pipeline published in your environment from S3 in your account. An inference job reads the records you send for scoring and writes their scores. A training job writes your adapted or fine-tuned copy, and later inference jobs read it from there.
The algorithm’s image is self-contained. It carries the code, its dependencies, and the pre-trained model. Jobs run with network isolation: they download nothing when they run and can’t reach the internet.
The pre-trained model and every adapted or fine-tuned copy are encrypted. You run them, but you can’t extract the weights. Your adapted copy moves from the training job that produced it to the inference jobs that use it.
Start jobs from the SageMaker console, the SageMaker APIs and SDKs, or your own ML platform, like any SageMaker algorithm, or have Avra orchestrate them.
Before you start
| What you provide | Notes |
|---|---|
| An AWS account with Amazon SageMaker | In the AWS Region where your data lives |
| S3 locations | For the jobs’ inputs and outputs, in the same Region as the jobs |
| An execution role | The IAM role SageMaker assumes to read the inputs and write the outputs |
| Service quotas | For the instance types your Avra team recommends for your data |
| Subnets and security groups | Only if your data must be read from inside your VPC |
Set up
Agree on the license
Running Avra RFM in your account is licensed. Agree on the terms with your Avra team before you subscribe.
Subscribe
Subscribe from the AWS account where your data lives, then configure the product for the AWS Region where it lives. The person who subscribes needs permission to manage AWS Marketplace subscriptions, such as the AWSMarketplaceManageSubscriptions managed policy. The algorithm then becomes available to Amazon SageMaker in that account, under its own ARN for that Region.
Request service quotas
Request service quotas in that Region for the instance types your Avra team recommends for your data.
Prepare S3 and an execution role
Run jobs
Run inference jobs to score records, and training jobs to adapt or fine-tune a copy.
See what the algorithm expects
The algorithm describes itself. Describe it with its ARN, in the Region you configured it for:
aws sagemaker describe-algorithm \
--algorithm-name <algorithm-arn> \
--region <region>import boto3
sagemaker = boto3.client("sagemaker", region_name="<region>")
algorithm = sagemaker.describe_algorithm(AlgorithmName="<algorithm-arn>")
training = algorithm["TrainingSpecification"]
print(training["SupportedTrainingInstanceTypes"])
for channel in training["TrainingChannels"]:
print(channel["Name"], channel.get("IsRequired", False))TrainingSpecification lists the training job’s input channels and the instance types it supports, and InferenceSpecification describes inference.
IAM
Two identities take part. The person who subscribes needs permission to manage AWS Marketplace subscriptions, as described in the setup steps. The jobs run as an execution role, which SageMaker assumes to read each job’s inputs from S3, write its outputs, and write its logs and metrics to CloudWatch in your account. Whoever starts the jobs, you or your ML platform, also needs iam:PassRole on that role, so it can hand the role to SageMaker.
The role’s trust policy lets SageMaker assume it:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": { "Service": "sagemaker.amazonaws.com" },
"Action": "sts:AssumeRole"
}
]
}
Its permissions policy lets it read the inputs, write the outputs, and describe the algorithm, which SageMaker requires for jobs that run an algorithm. This example keeps everything in one bucket, rio-claro-avra, under three prefixes: published/ for the data the ingestion pipeline publishes, to-score/ for the records you send, and outputs/ for what the jobs write. Inference jobs also read outputs/, where training jobs leave your adapted copies.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListBucket",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::rio-claro-avra"
},
{
"Sid": "ReadInputs",
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": [
"arn:aws:s3:::rio-claro-avra/published/*",
"arn:aws:s3:::rio-claro-avra/to-score/*",
"arn:aws:s3:::rio-claro-avra/outputs/*"
]
},
{
"Sid": "WriteOutputs",
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::rio-claro-avra/outputs/*"
},
{
"Sid": "DescribeAlgorithm",
"Effect": "Allow",
"Action": "sagemaker:DescribeAlgorithm",
"Resource": "arn:aws:sagemaker:*:*:algorithm/*"
},
{
"Sid": "JobLogsAndMetrics",
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:DescribeLogStreams",
"logs:PutLogEvents",
"cloudwatch:PutMetricData"
],
"Resource": "*"
}
]
}
Create the role with the policies:
aws iam create-role \
--role-name AvraRfmExecution \
--assume-role-policy-document file://trust-policy.json
aws iam put-role-policy \
--role-name AvraRfmExecution \
--policy-name AvraRfmData \
--policy-document file://data-policy.jsonresource "aws_iam_role" "avra_rfm" {
name = "AvraRfmExecution"
assume_role_policy = file("${path.module}/trust-policy.json")
}
resource "aws_iam_role_policy" "avra_rfm_data" {
name = "AvraRfmData"
role = aws_iam_role.avra_rfm.id
policy = file("${path.module}/data-policy.json")
}If your bucket uses SSE-KMS, also allow the role kms:Decrypt to read and kms:GenerateDataKey to write, on that key. If the jobs run in your VPC, the role also needs the EC2 permissions AWS documents for SageMaker jobs in a VPC, which let SageMaker create network interfaces in your subnets.
S3
Keep the jobs’ S3 locations in the same Region as the jobs. The example on this page uses three prefixes in one bucket, s3://rio-claro-avra:
| Prefix | Holds | Written by | Read by |
|---|---|---|---|
published/ |
The data the ingestion pipeline publishes | The ingestion pipeline | Training and inference jobs |
to-score/ |
The records you send for scoring | You | Inference jobs |
outputs/ |
Your adapted or fine-tuned copies, and scores | Training jobs and inference jobs | Inference jobs, which load your copy |
Every adapted or fine-tuned copy is written to your S3 encrypted. You can also encrypt the jobs’ outputs and their storage volumes with your own AWS KMS keys, as with any SageMaker job.
Network isolation and your VPC
Every job runs with network isolation. The job’s container has no network access: it can’t reach the internet, other AWS services, or Avra. SageMaker itself reads the job’s inputs from S3 and writes its outputs back, using the execution role, so the container never needs a connection of its own.
If your data must be read from inside your VPC, run the jobs in your VPC. A job in your VPC runs in subnets and security groups you choose, and SageMaker routes its reads and writes to S3 through those subnets, while the job’s container stays isolated. Subnets without a route to the internet need a route to S3 of their own, such as a gateway VPC endpoint.
What stays in your account
The jobs can’t reach Avra or anything else. Your data, the records you score, their scores, and every adapted or fine-tuned copy stay in your S3, and each job’s logs stay in CloudWatch Logs in your account. Only execution metadata and aggregated metrics return to Avra.
| What | Where it’s kept | Returns to Avra |
|---|---|---|
| Your data, and the versions the ingestion pipeline publishes | Your S3 | No |
| The records you score, and their scores | Your S3 | No |
| Adapted and fine-tuned copies | Your S3, encrypted | No |
| Job logs | CloudWatch Logs, in your account | No |
| Execution metadata and aggregated metrics | Your account and Avra | Yes |
If you have Avra orchestrate your jobs, you set up the access that takes with your Avra team.
License
Running the RFM in your account is licensed. The license covers confidentiality, prohibits reverse engineering, and requires customer-specific model artifacts, caches, and intermediate data to be destroyed when the agreement ends. Your agreement sets out the specifics.
Every version is governed
The algorithm’s releases are governed like every Avra model: authorized by Avra’s research team and approved by someone who didn’t train them. Evaluate each version on your history before it serves decisions. See Evaluation.
Adaptation and fine-tuning
When a copy of the RFM that learns from your data pays off
Evaluation
How to judge a version on your history before it serves decisions
Install the data layer
Run the ingestion pipeline that publishes the data the jobs read
Deployment
What runs where, and what crosses the boundary