Saravanan
Saravanan

Reputation: 142

Sagemaker batch transform job - Input data location

I am using custom algorithm in AWS Sagemaker and used boto3 "create_training_job" API to train the model. The "S3Uri" location of the training data is passed to this API. Sagemaker in turn copies this data to the folder "/opt/ml/input/data/" inside the docker image and I have configured the training logic based on this location - /opt/ml/input/data/.

Now I need to generate inference using "create_transform_job" API. I am passing the "S3Uri" of the inference dataset, to this API. To which location inside the docker, will this inference dataset be copied over to? This is required for configuring the location in the code.

Upvotes: 0

Views: 1794

Answers (2)

akshat garg
akshat garg

Reputation: 194

Batch Transform does not take any python code for input. It takes model name (model is created using Model class - from sagemaker.model import Model and CreateModelStep). Model class accepts an inference script (not mandatory but is one of the parameters) which just focuses on handling incoming API requests. Input data is an S3 location (directory) only. All the records, in files within this directory, are sent to model for inference and corresponding ".out" files are created in output directory. The content type like 'text/csv' defines the kind of files read for inference. These differences make batch transform step/job unique.

Upvotes: 0

Andrew Packer
Andrew Packer

Reputation: 146

When running SageMaker Batch Transform, the input is not persisted to disk on the compute instance. Instead, the data is streamed to your container via HTTP requests.

For more details on how the Batch Transform feature works, see: https://docs.aws.amazon.com/sagemaker/latest/dg/how-it-works-batch.html

For more details on how your container should serve requests when running Batch Transform jobs, see: https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-batch-code.html#your-algorithms-batch-code-how-containe-serves-requests

Upvotes: 2

Related Questions