Yes, deploying the model to an Endpoint will create a separate instance - which will stay active until the Endpoint is deleted. When you invoke your model from the notebook, you're calling an API and the actual inference work will happen on the endpoint.
In general when using SageMaker I'd suggest keeping your notebook instances small (e.g. an ml.t3.medium) and use the on-demand infrastructure for heavier tasks: SageMaker Processing, Training, and Batch inference ("transform") jobs all also run on separate compute which automatically shuts down as soon as the job is completed. In cases where you do need more resources, can temporarily spin up a bigger notebook and shut it down again.
amazon web services - Endpoint Instance cost - Stack Overflow
amazon web services - Which is lower cost, Sagemaker or EC2? - Stack Overflow
SageMaker rough costs when deploying object detection model API
SageMaker costs for AI model
Videos
I've listed some pros and cons from experience...
..., as opposed to marketing materials. If I were to guess, I'd say you have a much higher chance to experience all the drawbacks of SageMaker, than any one of the benefits.
Drawbacks
- Cloud vendor lock in: free improvements in the open source projects in the future and better prices in competitor vendors are difficult to get. Why don't AWS invest developers in JupyterLab, they have done limited work in open source. Find some great points here, where people have experienced companies using as few AWS services as possible with good effect.
- SageMaker instances are currently 40% more expensive than their EC2 equivalent.
- Slow startup, it will break your workflow if every time you start the machine, it takes ~5 minutes. SageMaker Studio apparently speeds this up, but not without other issues. This is completely unacceptable when you are trying to code or run applications.
- SageMaker Studio is the first thing they show you when you enter SageMaker console. It should really be the last thing you consider.
- SageMaker Studio is more limited than SageMaker notebook instances. For example, you cannot mount an EFS drive.I spoke to a AWS solutions architect, and he confirmed this was impossible (after looking for the answer all over the internet). It is also very new, so there is almost no support on it, even by AWS developers.
- Worsens the disorganised Notebooks problem. Notebooks in a file system can be much easier to organise than using JupyterLab. With SageMaker Studio, a new volume gets created and your notebooks lives in there. What happens when you have more than 1...
- Awful/ limited terminal experience, coupled with tedious configuration (via Lifecycle configuration scripts, which require the Notebook to be turned off just to edit these scripts). Additionally, you cannot set any lifecycle configurations for Studio Notebooks.
- SageMaker endpoints are limited compared to running your own server in an EC2 instance.
- It may seem like it allows you to skip certain challenges, but in fact it provides you with more obscure challenges that no one has solved. Good luck solving them. The rigidity of SageMaker and lack of documentation means lots of workarounds and pain. This is very expensive.
Benefits
These revolve around the SageMaker SDK (the Sagemaker console and SageMaker SDK) (please comment or edit if you found any more benefits)
- Built in algorithms (which you can easily just import in your machine learning framework of choice): I would say this is worse than using open source alternatives.
- Training many models easily during hyperparameter search YouTube video by AWS (a fast way to spend money)
- Easily create machine learning related AWS mechanical turk tasks. However, mturk is very limited within SageMaker, so youre better off going to mturk yourself.
My suggestion
If you're thinking about ML on the cloud, don't use SageMaker. Spin up a VM with a prebuilt image that has PyTorch/ TensorFlow and JupyterLab and get the work done.
You are correct about EC2 being cheaper than Sagemaker. However you have to understand their differences.
- EC2 provides you computing power
- Sagemaker (try to) provides a fully configured environment and computing power with a seamless deployment model for you to start training your model on day one
If you look at Sagemaker's overview page, it comes with Jupyter notebooks, pre-installed machine learning algorithms, optimized performance, seamless rollout to production etc.
Note that this is the same as self-hosting a EC2 MYSQL server and utilizing AWS managed RDS MYSQL. Managed services always appears to be more expensive, but if you factor in the time you have to spent maintaing server, updating packages etc., the extra 30% cost may be worth it.
So in conclusion if you rather save some money and have the time to set up your own server or environment, go for EC2. If you do not want to be bothered with these work and want to start training as soon as possible, use Sagemaker.
Hi all,
Use case - I've a mobile app where for roughly 30-45 seconds in total, the user sends every 2-3 seconds an image to AWS Gateway API, this image then is passed to pre-trained model and returns results. Initial idea was to retrieve real-time results, but for phase 1 we decided to simply allow user to focus on on the object and then send an image and retrieve result - in UI user is prompt with simple dialog (is it A object or not), so no real-time processing is needed for now.
The bill surprised me (SageMaker Inference using Endpoint):
$0.00 for Host:ml.m5.xlarge per hour under monthly free tier (125hrs)
$0.245 per Hosting ml.m5.xlarge hour in EU (Stockholm) (52.573 Hrs) = USD 12.88. If a little bit more than 2 days is costing me around 13 USD I have to be doing something awfully wrong. The app currently is being tested only by 2-3 people that have made in total around 300-400 endpoint calls.
I mean, yes, I could switch to ml.m6g.large that would cost me around $0.09 - how much people would that handle for my use-case? Nonetheless, even switching out to smaller machine seems to be costly as hell. Any suggestions? Maybe for my use case I need to use other service?