I'm currently using Sagemaker Model Monitoring modules in order to check model and data quality. I create the data and model baselines with the sagemaker
python API. While running the Batch Transform Job launched by the suggest_baseline()
function with the model quality monitor, I got this error:
2023-07-28T15:04:37.163:[sagemaker logs]: MaxConcurrentTransforms=1, MaxPayloadInMB=6, BatchStrategy=MULTI_RECORD
2023-07-28T15:04:38.084:[sagemaker logs]: X.csv: Too much data for max payload size
As we can see MaxPayloadInMB=6
so one change could be to use a bigger MaxPayloadInMB
size. The problem is that that parameter is not configurable through the sagemaker
model monitoring python API.
How can I deal with this problem?
Update:
This code below is executed into a Lambda function in order to setup a model monitor for the newly deployed model:
model_quality_monitor = ModelQualityMonitor(
role=role,
instance_count=1,
instance_type="ml.m5.xlarge",
volume_size_in_gb=20,
max_runtime_in_seconds=1800,
)
logger.info("Suggesting baseline")
model_quality_monitor.suggest_baseline(
baseline_dataset=baseline_dataset_uri,
dataset_format=DatasetFormat.csv(header=True),
output_s3_uri=(
f"s3://{bucket}/{endpoint_name}/{schema_version}/model-quality/baseline/results"
),
problem_type="BinaryClassification",
inference_attribute="prediction",
probability_attribute="probability",
ground_truth_attribute="label",
wait=True,
logs=True,
)
logger.info("Creating model quality scheduler")
endpoint_input = EndpointInput(
endpoint_name=endpoint_name,
probability_attribute="0",
probability_threshold_attribute=0.5,
destination="/opt/ml/processing/input_data",
)
results_uri = (
f"s3://{bucket}/{endpoint_name}/{schema_version}/model-quality/results"
)
schedule_name = f"{endpoint_name}-model-quality-monitor-schedule"
model_quality_monitor.create_monitoring_schedule(
monitor_schedule_name=schedule_name,
endpoint_input=endpoint_input,
output_s3_uri=results_uri,
problem_type="BinaryClassification",
ground_truth_input=f"s3://{bucket}/{endpoint_name}/{schema_version}/ground-truth",
constraints=model_quality_monitor.latest_baselining_job.suggested_constraints(),
schedule_cron_expression=CronExpressionGenerator.hourly(),
enable_cloudwatch_metrics=True,
)
model_quality_monitor.describe_schedule()