amazon-sagemaker-examples icon indicating copy to clipboard operation
amazon-sagemaker-examples copied to clipboard

Is it possible to call the /invocations endpoint asynchronously?

Open f-istvan opened this issue 8 years ago • 3 comments

Let's say I have an inferencing algorithm that runs for 10 minutes or longer so I don't want the client to wait for the result. Is it possible to tell the sagemaker service to call a callback url with the results?

f-istvan avatar Jan 22 '18 17:01 f-istvan

Hi @f-istvan , Thanks for your interest in SageMaker examples!

SageMaker Hosting is mainly used to generate realtime predictions. And, currently, SageMaker Hosting has a 60 second limit on invoke endpoint calls. So, a 10 minute inference request would generate an error that, "Amazon SageMaker couldn’t get a response from the endpoint."

10 minutes is a long time for a single inference request, so I’m guessing each inference call is computationally challenging. If you only have a single instance behind your endpoint, running multiple inference calls asynchronously is likely to overwhelm that instance anyway. Perhaps moving to a different instance type (GPU) would bring down the inference time?

If asynchronous inference is your only option and you're using your own container, you could potentially spawn a subprocess within the model container itself and then implement logic to differentiate an initial call to the endpoint vs a callback. Or you could potentially publish results to somewhere else and have another process that picks them up later.

We'd be interested in knowing more about your use case though. Perhaps there are other ways of delivering these predictions?

Thanks.

djarpin avatar Jan 24 '18 20:01 djarpin

Hi @djarpin,

Thank you for the information and the hints. I don't have any real use case, just looked at the service and a couple of question came to mind. The '10 minutes' example is a bit of an exaggeration but I got the point.

Thanks again.

f-istvan avatar Feb 07 '18 13:02 f-istvan

Is it possible to invoke multiple endpoints ? I have 30k models (Single endpoint for all), each taking 6 seconds for inference; sequentially invoking it takes lot of time. Is there a limit on number of hits, I can make on single endpoint ?

cna274 avatar Apr 10 '18 16:04 cna274