Skip to content

How to feed arbitrary binary files to Sagemaker Batch Transform

0

Hello,

I've been reading about SageMaker Batch Transform data ingestion options, and I'm not sure if it is possible to feed models arbitrary binary files that are stored in S3. CSV support is mentioned multiple times across the documentation, but CSV is pretty limited to build general purpose algorithms. I have medical files, in proprietary binary format and I want to build an AWS Marketplace product to process these files. Should I continue with SageMaker Batch Transform, or should I look into something else?

Thanks, Alberto.

2 Answers
0

And how/where should my container look for the input data?

answered 9 months ago

-1

Yes, you can use SageMaker Batch Transform to process arbitrary binary files stored in S3, including proprietary medical file formats.

While CSV is commonly mentioned in examples, Batch Transform is not limited to this format. When setting up a batch transform job, you can specify the content type that matches your data format. The service will download your input data from S3 and send it to your model for processing.

There are two main approaches to specify your S3 data source for batch transform:

  1. Using S3Prefix: You can point to a key name prefix in S3, and SageMaker will use all objects with that prefix for batch transform.

  2. Using ManifestFile: You can create a manifest file that contains a list of specific object keys you want SageMaker to process.

When setting up your transform job using the SageMaker Python SDK, you would configure it like this:

transformer = sagemaker.transformer.Transformer(
model_name=model_name,
instance_count=1,
instance_type='ml.m4.xlarge',
output_path='s3://your-output-bucket/path/',
accept=your_output_content_type
)

transformer.transform(
data='s3://your-input-bucket/path/',
content_type=your_input_content_type,
split_type=None  # For binary files, you typically don't want to split
)

For your proprietary medical files, you would:

  1. Ensure your model container can process these binary files
  2. Set the appropriate content_type that your model expects
  3. Configure your transform job not to split the files

SageMaker Batch Transform is well-suited for building AWS Marketplace products that process proprietary file formats, as it handles the infrastructure management, scaling, and distribution of workloads across compute instances.
Sources
TransformS3DataSource - Amazon SageMaker
Batch transforms with inference pipelines - Amazon SageMaker AI
Batch transform for inference with Amazon SageMaker AI - Amazon SageMaker AI

answered 9 months ago

  • And how/where should my container look for the input data?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.