Amazon SageMaker AI
The managed place to build, train and deploy your own model. Every step of that — a notebook to explore in, a fleet to train on, a fleet to serve from — is a server you would otherwise provision, babysit and forget to turn off. SageMaker rents you each one for exactly as long as the step lasts.
Nơi được quản lý sẵn để xây, huấn luyện và triển khai mô hình của chính bạn. Mỗi bước trong đó — một notebook để mò mẫm, một cụm máy để train, một cụm máy để phục vụ dự đoán — đều là server mà nếu không có nó bạn phải tự dựng, tự trông và thường quên tắt. SageMaker cho thuê từng cái đúng bằng thời gian bước đó chạy.
Reach for it / not the right toolKhi nào dùng / khi nào không
Reach for SageMakerChọn SageMaker
- The prediction depends on your own history — churn, fraud, demand, remaining useful life. Nobody else's model has seen your data.Dự đoán phụ thuộc vào lịch sử của chính bạn — churn, gian lận, nhu cầu, tuổi thọ còn lại của thiết bị. Không mô hình của ai khác từng thấy dữ liệu của bạn.
- A data science team already has notebooks and a framework (XGBoost, PyTorch, TensorFlow) and needs somewhere to run them without owning EC2.Đội data science đã có sẵn notebook và framework (XGBoost, PyTorch, TensorFlow) và cần chỗ chạy mà không phải tự nuôi EC2.
- Training is bursty — hours of GPU once a week. Ephemeral training jobs beat a cluster that idles the other six days.Việc train diễn ra theo đợt — vài giờ GPU mỗi tuần. Training job tạm thời tốt hơn một cụm máy nằm không sáu ngày còn lại.
- The model must be retrained on a schedule and promoted like software — that's Pipelines plus a model registry.Mô hình phải được train lại định kỳ và thăng cấp như phần mềm — đó là Pipelines cộng model registry.
- Someone asks "is the model still right?" months after launch — Model Monitor exists for exactly that.Ai đó hỏi "mô hình còn đúng không?" nhiều tháng sau khi lên production — Model Monitor sinh ra đúng cho việc đó.
Not the right toolKhông phải chỗ dùng
- The task is generic — read text from a scan, detect a face, translate, transcribe. Use the AI services; there is nothing to train.Bài toán phổ thông — đọc chữ từ ảnh scan, nhận diện khuôn mặt, dịch, gỡ băng. Dùng AI services; chẳng có gì để train cả.
- You want a chatbot or a summariser on top of an existing foundation model → Bedrock, not a training job.Bạn muốn một chatbot hay bộ tóm tắt dựa trên foundation model có sẵn → Bedrock, không phải training job.
- It's really an SQL aggregation dressed up as prediction. Try Athena or Redshift first — most "ML requests" die there, cheaply.Thực ra chỉ là một phép gộp SQL khoác áo dự đoán. Thử Athena hoặc Redshift trước — phần lớn "yêu cầu ML" chết ở đó, và rẻ.
- You have no labelled data at all and no way to get it. Train on what, exactly? Fix the data problem before renting GPUs.Bạn không có dữ liệu đã gán nhãn và cũng không cách nào có. Vậy train trên cái gì? Sửa vấn đề dữ liệu trước khi đi thuê GPU.
- Plain distributed batch compute with no model in it — that's AWS Batch or EMR.Chỉ là tính toán batch phân tán không có mô hình nào — đó là AWS Batch hoặc EMR.
The loop, and what is a server at each stepVòng lặp, và chỗ nào là server
Read it as an infrastructure diagram, not a maths one. Left half is compute that exists for minutes; right half is compute that may exist forever. That split is where the bill lives, and where the exam questions live too. Hãy đọc nó như sơ đồ hạ tầng, đừng đọc như sơ đồ toán. Nửa trái là compute chỉ tồn tại vài phút; nửa phải là compute có thể tồn tại mãi mãi. Ranh giới đó là nơi hoá đơn nằm, và cũng là nơi câu hỏi thi nằm.
The worked example that makes it stick: historical rows are years of IT experience, years on AWS, hours spent studying; the label is the score that person actually got. Train on that, and the model predicts a score for someone who hasn't sat the exam yet.
Ví dụ dễ nhớ: mỗi dòng dữ liệu cũ gồm số năm làm IT, số năm dùng AWS, số giờ đã học; nhãn là điểm người đó thực sự đạt. Train trên đó, rồi mô hình dự đoán điểm cho một người còn chưa đi thi.
Which inference option — the decisionChọn kiểu inference nào — quyết định
Ask two questions in order: does a human wait for this answer right now? and how big / how slow is one request? Those two answers pick the option without any ML knowledge at all. Hỏi hai câu theo thứ tự: có ai đang đợi câu trả lời ngay lúc này không? và một request nặng cỡ nào, chậm cỡ nào? Hai câu đó chọn ra phương án mà chẳng cần biết gì về ML.
| OptionPhương án | What it actually isThực chất là gì | Pick it whenChọn khi | The catchĐánh đổi |
|---|---|---|---|
| Real-time endpointReal-time endpoint | An HTTPS endpoint on instances that are always running, behind autoscaling you configure.Một endpoint HTTPS chạy trên instance luôn bật, có autoscaling do bạn cấu hình. | A user or a service is blocked waiting — checkout fraud scoring, a recommendation on page load. Steady, predictable traffic.Một người dùng hoặc service đang đứng chờ — chấm điểm gian lận lúc thanh toán, gợi ý khi tải trang. Traffic đều và dự đoán được. | Billed per instance-hour whether or not anyone calls it. Payload and timeout are small (seconds).Tính tiền theo giờ instance dù có ai gọi hay không. Payload nhỏ và timeout ngắn (vài giây). |
| Serverless InferenceServerless Inference | Same endpoint shape, but SageMaker runs the capacity and scales it to zero between requests.Vẫn là endpoint như vậy, nhưng SageMaker tự lo capacity và co về không giữa các request. | Traffic is spiky or mostly idle — an internal tool, a low-volume API — and a first-call delay is acceptable.Traffic giật cục hoặc phần lớn thời gian rảnh — công cụ nội bộ, API ít lượt — và chấp nhận được độ trễ ở lần gọi đầu. | Cold starts. No GPU option. If the latency SLA is strict, this is the wrong answer.Cold start. Không có tuỳ chọn GPU. Nếu SLA về độ trễ ngặt nghèo thì đây là đáp án sai. |
| Asynchronous InferenceAsynchronous Inference | You submit a request, SageMaker queues it, writes the result to S3 and notifies you. Large payloads, long runtimes.Bạn gửi request, SageMaker xếp hàng đợi, ghi kết quả ra S3 rồi báo cho bạn. Payload lớn, chạy lâu. | One request is big (up to ~1 GB) or slow (up to ~1 hour) — a whole video, a scan, a genome. Nobody is staring at a spinner.Mỗi request nặng (tới ~1 GB) hoặc chậm (tới ~1 giờ) — cả một video, một bản scan, một bộ gen. Không ai ngồi nhìn vòng xoay chờ. | Answers are not immediate, and the caller has to handle a callback or poll S3. Can also scale to zero when the queue empties.Kết quả không tức thì, phía gọi phải xử lý callback hoặc tự poll S3. Cũng có thể co về không khi hàng đợi rỗng. |
| Batch TransformBatch Transform | A job, not an endpoint. Reads a whole dataset from S3, scores every row, writes results back to S3, exits.Là một job, không phải endpoint. Đọc cả tập dữ liệu từ S3, chấm mọi dòng, ghi kết quả về S3, rồi kết thúc. | Predictions are consumed on a schedule — nightly churn scores for every customer, a monthly demand forecast.Dự đoán được dùng theo lịch — điểm churn hằng đêm cho mọi khách hàng, dự báo nhu cầu hằng tháng. | No online path at all. If anything needs an answer between runs, you need one of the endpoints too.Hoàn toàn không có đường online. Nếu có thứ gì cần trả lời giữa hai lần chạy, bạn vẫn phải dựng thêm endpoint. |
The satellites worth namingNhững vệ tinh đáng nhớ tên
Dozens of sub-features share the SageMaker name. These are the ones a question can hinge on — you only need to recognise which step of the loop each one attaches to. Có hàng chục tính năng con mang tên SageMaker. Đây là những cái mà một câu hỏi có thể xoay quanh — bạn chỉ cần nhận ra mỗi cái gắn vào bước nào của vòng lặp.
The boundary: SageMaker vs AI services vs BedrockRanh giới: SageMaker, AI services và Bedrock
This is the distinction the exam actually tests, and it has nothing to do with algorithms. It is only ever: whose model is it, and who trains it? Đây mới là điểm đề thi thực sự kiểm tra, và nó chẳng liên quan gì tới thuật toán. Luôn chỉ là: mô hình của ai, và ai train nó?
| SageMaker AI | AI servicesAI services | Bedrock | |
|---|---|---|---|
| Whose modelMô hình của ai | Yours — you build and train it on your dataCủa bạn — bạn tự xây và train trên dữ liệu của mình | AWS's, pre-trained, invisible to youCủa AWS, train sẵn, bạn không nhìn thấy | A foundation model from AWS or a partner, served behind an APIMột foundation model của AWS hoặc đối tác, phục vụ sau một API |
| What you doBạn làm gì | Label, train, tune, deploy, monitorGán nhãn, train, tune, deploy, giám sát | Call an API. That's it — DetectLabels, DetectDocumentTextGọi API. Chỉ vậy — DetectLabels, DetectDocumentText |
Prompt it; optionally fine-tune or ground it on your documentsRa prompt cho nó; tuỳ chọn fine-tune hoặc gắn thêm tài liệu của bạn |
| Typical examplesVí dụ điển hình | Churn, fraud scoring, demand forecast, predictive maintenanceChurn, chấm điểm gian lận, dự báo nhu cầu, bảo trì dự đoán | Rekognition, Comprehend, Textract, Transcribe, Translate, PollyRekognition, Comprehend, Textract, Transcribe, Translate, Polly | Chat assistants, summarisation, generation, embeddingsTrợ lý hội thoại, tóm tắt, sinh nội dung, embedding |
| What you pay forTrả tiền cho cái gì | Instances — training jobs and whatever is hosting the modelInstance — training job và bất cứ thứ gì đang host mô hình | Per API call / per unit processed. No infrastructure at allTheo lượt gọi API / theo đơn vị xử lý. Không có hạ tầng nào cả | Per token, or provisioned throughput if you need guaranteesTheo token, hoặc provisioned throughput nếu cần cam kết |
| Effort / expertiseCông sức / chuyên môn | Highest — needs data, labels and someone who knows what to do with themCao nhất — cần dữ liệu, nhãn, và người biết phải làm gì với chúng | Lowest — a developer with an SDK and an afternoonThấp nhất — một dev với SDK và một buổi chiều | Low, until you start grounding it on private dataThấp, cho tới khi bạn bắt đầu gắn nó với dữ liệu nội bộ |
Things that catch you outNhững chỗ dễ vấp
- The endpoint is the money. A real-time endpoint is an always-on instance fleet; deleting the model or the notebook does not delete it. Idle endpoints from an old experiment are the classic line item nobody can explain. Tiền nằm ở endpoint. Real-time endpoint là một cụm instance luôn bật; xoá model hay xoá notebook không xoá nó. Endpoint bỏ không từ một thí nghiệm cũ là dòng chi phí kinh điển mà không ai giải thích nổi.
- Notebook instances run until you stop them. They are EC2 with a nicer face, billed by the hour, and they do not stop themselves when the browser tab closes. A lifecycle configuration that shuts idle ones down is the standard fix. Notebook instance chạy tới khi bạn tự tắt. Chúng là EC2 khoác bộ mặt dễ chịu hơn, tính tiền theo giờ, và không tự dừng khi bạn đóng tab trình duyệt. Cách chữa chuẩn là một lifecycle configuration tự tắt những cái đang rảnh.
- Drift is silent. The endpoint stays healthy, latency stays flat, CloudWatch is green — and the predictions have been quietly wrong for a month because the world moved. Nothing catches this except Model Monitor plus a retraining pipeline. Drift diễn ra âm thầm. Endpoint vẫn healthy, độ trễ vẫn phẳng, CloudWatch vẫn xanh — trong khi dự đoán đã sai suốt một tháng vì thực tế đã đổi. Không gì bắt được điều này ngoài Model Monitor cộng một pipeline train lại.
- Training data lives in S3, so S3 is your security boundary. Encryption with KMS, bucket policy, and a VPC-attached job with a gateway endpoint if the data must never touch the internet — that last one is the usual "sensitive data" answer. Dữ liệu train nằm ở S3, nên S3 chính là ranh giới bảo mật. Mã hoá bằng KMS, bucket policy, và job gắn vào VPC kèm gateway endpoint nếu dữ liệu tuyệt đối không được ra internet — cái cuối là đáp án quen thuộc cho tình huống "dữ liệu nhạy cảm".
- Batch Transform is not "async inference for big files". Async takes one request at a time and returns a result per request; batch takes one dataset and returns a file. If the wording says "for each incoming document", it's async, not batch. Batch Transform không phải là "async inference cho file lớn". Async nhận từng request một và trả về kết quả cho từng request; batch nhận cả một tập dữ liệu và trả về một file. Nếu đề viết "với mỗi tài liệu gửi đến", đó là async chứ không phải batch.
- Spot for training, never for the endpoint. Managed spot training can cut training cost sharply because a job can checkpoint and resume; a serving endpoint has no equivalent, so that saving simply does not exist on the inference side. Spot cho training, tuyệt đối không cho endpoint. Managed spot training có thể cắt mạnh chi phí train vì job biết checkpoint rồi chạy tiếp; endpoint phục vụ không có cơ chế tương đương, nên khoản tiết kiệm đó đơn giản là không tồn tại ở phía inference.
Exam reflexesPhản xạ khi thi
| The question says…Đề nói… | AnswerTrả lời |
|---|---|
| "Build a custom model on our own historical data, minimal infrastructure management""Xây mô hình riêng trên dữ liệu lịch sử của chúng tôi, quản lý hạ tầng ít nhất" | SageMaker — training jobs + a managed endpointSageMaker — training job + endpoint được quản lý |
| "Predictions for every customer, once a night, results into S3""Dự đoán cho mọi khách hàng, mỗi đêm một lần, kết quả đổ vào S3" | Batch Transform — no endpoint to run or pay forBatch Transform — không phải chạy hay trả tiền cho endpoint nào |
| "Traffic is intermittent and unpredictable; pay nothing when idle; occasional latency is fine""Traffic rời rạc và khó đoán; lúc rảnh không mất tiền; thỉnh thoảng chậm một chút cũng được" | Serverless Inference — scales to zero, accept cold startsServerless Inference — co về không, đổi lại chịu cold start |
| "Each request is a 500 MB file taking several minutes to process""Mỗi request là một file 500 MB mất vài phút để xử lý" | Asynchronous Inference — queued, large payload, result to S3Asynchronous Inference — xếp hàng, payload lớn, kết quả ra S3 |
| "Accuracy has degraded months after launch and nobody noticed""Độ chính xác đã tụt sau vài tháng chạy mà không ai nhận ra" | Model Monitor for drift + Pipelines to retrainModel Monitor để bắt drift + Pipelines để train lại |
| "Detect objects in images / extract text from PDFs, least effort""Nhận diện vật thể trong ảnh / trích xuất chữ từ PDF, ít công nhất" | Not SageMaker — AI services. Generative text? BedrockKhông phải SageMaker — AI services. Sinh văn bản? Bedrock |