What is Amazon Sagemaker?
Amazon SageMaker is a fully managed machine learning (ML) platform designed to empower developers and data scientists, to rapidly create, train, and deploy ML models. SageMaker offers an extensive toolkit and features covering the entire ML lifecycle, from data preparation and feature engineering to model training and deployment. It also includes a diverse selection of pre-built models, algorithms and sample solutions suitable for various ML tasks, from more complex tasks, like Generative AI, to classical problems like, computer vision, classification and regression.
SageMaker suite of services range between a wide realm of applications. Some of the most notable features include:
- No-code version for business analysts: analysts can make use of SageMaker Canvas to create a visual point-and-click interface to generate accurate ML predictions without having to write a single line of code. Or leverage Autopilot where a user simply provides a tabular dataset and selects the target column to predict, and SageMaker Autopilot will automatically explore different solutions to find the best model.
- IDE for data scientists: SageMaker Studio offers a great IDE for data scientists to explore and experiment with their data and different ML models and solutions, giving them flexibility and a secure and private environment to perform their tasks. Also SageMaker Studio Notebooks can be connected to multiple AWS Services, such as S3, ECR, Redshift and Bedrock.
- MLOps: For MLOps, SageMaker offers SageMaker Projects. This functionality assists organizations in establishing and unifying developer environments for data scientists and CI/CD systems used by MLOps engineers. Although SageMaker notebooks serve as excellent tools for experimentation and model development, data science and machine learning teams often require a more scalable approach to manage their code and implementations. This is where Projects comes in handy. Projects also play a pivotal role in assisting organizations with tasks such as configuring dependency management, overseeing code repository management, ensuring build reproducibility, and facilitating the sharing of artifacts. Within Projects, users can implement lots of different features, one of them being SageMaker Pipelines: an orchestration tool that allows engineers to organize and scale their ML workflow, from EDA up until deployment and monitoring.
- SageMaker Pipelines: SageMaker Pipelines is a purpose-built workflow orchestration service to automate all phases of machine learning (ML) from data pre-processing to model monitoring. With an user-friendly UI and a seamless Python integration for building and managing the pipeline, SageMaker Pipelines is a great tool to create orchestrations and integration of ML workflow. You can add training jobs, processing jobs, model deployment and many other steps in a custom orchestration logic so the ML workflow is easily automated.
- Spot Training: With spot training, SageMaker enables training models using spot instances. With that feature users can save up to 90% in training cost.
- JumpStart: SageMaker JumpStart offers a wide variety of sample notebooks, solutions and pre-trained models in order to facilitate and explain how to perform tasks in SageMaker. From pre-trained models for Computer Vision and GenAI, up to notebooks for MLOps, SageMaker JumpStart offers great samples for developers to hit the ground running with pre-built solutions. The image below depicts some examples from SageMaker JumpStart.
Use cases: Bedrock vs Sagemaker
Bedrock use cases are Generative AI tasks, and are more aligned with users that want to quickly excel in the AI realm with advanced capabilities, without worrying about infrastructure and lots of code for model build and deployment. You can use Bedrock to perform a multitude of GenAI tasks like code generation, chatbots, image generation and text generation. Bedrock also allows fine-tuning of its provided FMs.
With SageMaker on the other hand, you can implement and develop solutions for GenAI and a wide range of ML use-cases, providing more flexibility by controlling infrastructure and codes for model build, train, deployment and inference. Some examples of ML tasks that SageMaker handles are computer vision, anomaly detection (e.g. fraud detection), feature reduction (e.g. risk assessment), forecasting (e.g. market projection), classification, regression and natural language processing.
Bedrock vs Sagemaker: Major Differences
The major difference between Bedrock and SageMaker lies in the complexity of the development cycle. We can summarize the complexity of both as:
- The simplicity of Bedrock is a virtue for lean startups looking to create and integrate advanced capabilities of Generative AI quickly .
- The complexity of Sagemaker is a virtue for teams that are invested in exceptionally sophisticated data management, ML workflows and experimentation.
To sum this major difference up, the following diagram can be a good starting point to decide which service to choose for your use-case.
There are other differences that may impact your decision, other than complexity and ML use-case. Some of those differences are related to how cost is calculated, how to set the environment up, how privacy is implemented and the learning curve needed for working with each one of those services.
Set-up
Regarding setup, in a nutshell, Bedrock is easier to setup than SageMaker.
Being fully managed by AWS, Bedrock requires less effort compared to SageMaker considering that users and developers select one of the provided pre-trained models, run some customizations if applicable and hit the ground running.
For SageMaker, by having to set up networking and privacy configurations, environment isolation and because of the larger feature set, SageMaker requires a bigger effort for setup. Also, for using the service, users need to be more hands-on in terms of customization and code development, so there is a bigger learning curve when comparing it to Bedrock.
Privacy
- Sagemaker users have more control over infrastructure, and so they have more control over their data.
- Bedrock users work within AWS managed environment, so they have less control (although user data is encrypted and AWS will not use your data to train FMs)
Regarding privacy concerns, the main difference lies again in the customization capabilities of each service, even though both services provide robust security features.
SageMaker provides more control over privacy and security. Users can define and create their own VPC with the needed configurations for internet access, encrypt data at rest and in transit and manage data and service access through IAM roles.
Bedrock, on the other hand, processes data within the AWS environment. Bedrock provides and ensures that the user data does not leave the user's VPC and that it is encrypted. Also it guarantees that the user data is not used to train the foundational models used. One other cool feature of Bedrock is that, for customization jobs (model fine tuning), Bedrock makes a private copy of the foundational model to be fine-tuned, so proprietary data is not shared with model providers.
In the end, the choice between services, when it comes to privacy and security is, again, how much control your solution requires.
Customization
Regarding customization, as we have been discussing throughout this blog, SageMaker offers more flexibility when compared to Bedrock.
In Bedrock, users can customize the provided FMs with their own data, creating fine-tuned models and using those through its API.
SageMaker offers more customizations. The main one is the ability to perform other ML tasks than GenAI. Also, in SageMaker users can incorporate their own algorithms, third-party algorithms and open-source LLMs. Users have full control over codes that are used for processing, training, evaluation, deploying and predicting.
Pricing
Bedrock pricing model is dependent on the modality, provider, and model. Pricing models are separated into:
- On-Demand: pay as you use methodology, with no time-based commitment.
- Batch: intended for large-scale use-cases, where an user can pass multiple prompts in a single input file and all the responses are stored within a single output file. Batch pricing is the same as On-Demand.
- Provisioned Throughput: user purchases model units for base or custom models. Its primary design is aimed at large consistent inference workloads that need guaranteed throughput. The rationale is that a model unit provides a certain throughput, measured by the maximum number of input and output tokens, and you are charged by hour having the flexibility to choose how much time to commit (between 1 month and 6 months commitment).
- Model Customization: you are charged for model training based on the number of tokens used for fine-tuning the model and for model storage. As mentioned, for custom models you must get Provisioned Throughput to run inference. One model unit is provided with no commitment. If more is needed, you must purchase a 1-month or 6-months commitment plan.
One example of On-Demand pricing is the price of running Anthropic's Claude base model. The table below depicts the cost of both models available based on input and output-tokens.
Note: for Agents for Bedrock and Knowledge Bases for Bedrock, you are only charged for the models and vector databases you use, when applicable.
On the other hand, SageMaker pricing is based on usage, however there is more complexity involved in it. Notebook instances are charged for the time they are up and jobs like training, processing and inference are also charged for the time that the selected instance was up and running. Idle notebook instances are also charged, but you can get rid of those charges by leveraging a Lifecycle Configuration with a script that shuts down notebook instances that are idle after a user-defined period of time. Model endpoints are also charged based on time they are available and their usage.
As SageMaker is a more robust suite of services and has instances and infrastructure attached to its features, the cost breakdown is more complicated. As mentioned, there is cost associated with different features like training jobs, endpoints, notebook instances and more. AWS explanation is pretty well defined in the pricing page for SageMaker, with examples, instance types and deeper details around the cost breakdown.
Which one is right for your company?
To choose the right service for your own use-case, the following questions can serve as guidance:
- What is your ML use-case?
- Bedrock only provides GenAI capabilities.
- SageMaker is suitable for a broader range of ML use-cases and GenAI as well.
- How much are you willing to invest?
- SageMaker will likely require a larger investment.
- Can you manage granular costs?
- SageMaker runs the risk of granular cost creep.
- Who on your team will be using it?
- Bedrock seems like a great fit for lean dev teams.
- SageMaker has features for data scientists as well as business analysts.
- What is your timeline?
- Bedrock provides more off-the-shelf solutions and quicker time-to-market.
- How much customization do you require?
- Sagemaker enables much greater customization and set of tools to use.
If you're looking for help strategizing how to operationalize your GenAI initiatives, Caylent can help. Our Generative AI Proof Of Value Caylent Catalyst can help you build an AI roadmap for your organization and demonstrate how generative AI can positively impact you. If you have a specific GenAI vision, we can also tailor an engagement exactly to your requirements. Get in touch with our team to explore opportunities to innovate with AI.