I want to troubleshoot common issues with Amazon SageMaker AI JumpStart.
Resolution
You can't view SageMaker foundation models
If you can't view SageMaker AI foundation models on the SageMaker AI console or SageMaker AI Studio, then you might receive one of the following errors:
"There's been an error with your request. Please retry and contact support."
"Something went wrong: Please ensure that your account is authorized to read from Amazon S3"
These errors occur when you don't have AWS Identity and Access Management (IAM) permission to access aws-marketplace policies or read or write permissions for Amazon Simple Storage Service (Amazon S3).
To access the SageMaker AI foundation models, use the AmazonSageMakerFullAccess managed policy. If you don't have access to this policy, then use a scope down policy that includes the required permissions for the SageMaker AI foundation model hub.
If you received the error on the SageMaker AI console, then add the following policy to your IAM runtime role:
{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "arn:aws:s3:::example-bucket/*",
"Condition": {
"StringEqualsIgnoreCase": {
"s3:ExistingObjectTag/SageMaker": "true"
}
}
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "arn:aws:s3:::example-bucket/*",
"Condition": {
"StringEquals": {
"s3:ExistingObjectTag/servicecatalog:provisioning": "true"
}
}
}
Note: Replace example-bucket with your Amazon S3 bucket.
If you received the error for SageMaker AI Studio, then add the following policy to your domain runtime role:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sagemaker:InvokePlaygroundEndpoint",
"aws-marketplace:Subscribe",
"aws-marketplace:ViewSubscriptions"
],
"Resource": [
"*"
]
},
{
"Effect": "Allow",
"Action": [
"lambda:InvokeFunction"
],
"Resource": [
"arn:aws:lambda:*:*:function:SageMakerFoundationHubAppConfigLambdaFunction"
]
}
]
}
You receive the "HeadObject operation: Not Found" error
When you set your SageMaker AI Studio notebook model_version attribute to * to use the model's latest version, you might receive the following error message:
"An error occurred (404) when calling the HeadObject operation: Not Found"
This error occurs when SageMaker updates all models to use uncompressed model artifacts. To resolve this issue, set your notebook model_version attribute to an exact model version.
You receive the "Your invocation timed out" error
An invocation timeout occurs when the invocation takes more than a specified number of seconds to process. As a result, you receive the following error message:
"Error: Your invocation timed out while waiting for a response from container primary. Review the latency metrics for each container in Amazon CloudWatch, resolve the issue, and try again."
To resolve this issue, set the processing time to a safe threshold.
To avoid an invocation timeout, use the following best practices:
- To keep the processing time under your specified threshold, limit the number of generated tokens.
- If needed, split the input into multiple invocations. Also, combine responses to provide context.
- Use a streaming response.
- If parallel requests or multi-tenant environments are slow, then increase your safety threshold on max tokens.
Also, it's a best practice to turn off the auto retries of the boto3 client that cause the timeout to repeat several times:
import botocore; config=botocore.config.Config(retries=dict(max_attempts=0))
To continue to troubleshoot, check the Amazon CloudWatch metrics for Amazon Bedrock or SageMaker AI inference endpoints.
Related information
Enable Amazon SageMaker JumpStart for custom IAM execution roles
Built-in algorithms with pre-trained model table on the SageMaker website
Introduction to JumpStart - text to image on the GitHub website