Ngân hàng đề — AWS Certified Machine Learning Specialty

Tìm thấy 371 câu.

Câu 241
An engraving company wants to automate its quality control process for plaques. The company performs the process before mailing each customized plaque to a customer. The company has created an Amazon S3 bucket that contains images of defects that should cause a plaque to be rejected. Low-confidence predictions must be sent to an internal team of reviewers who are using Amazon Augmented AI (Amazon A2I).

Which solution will meet these requirements?
  1. A Use Amazon Textract for automatic processing. Use Amazon A2I with Amazon Mechanical Turk for manual review.
  2. B Use Amazon Rekognition for automatic processing. Use Amazon A2I with a private workforce option for manual review.
  3. C Use Amazon Transcribe for automatic processing. Use Amazon A2I with a private workforce option for manual review.
  4. D Use AWS Panorama for automatic processing. Use Amazon A2I with Amazon Mechanical Turk for manual review.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi mô tả một công ty khắc chế muốn tự động hóa quy trình kiểm soát chất lượng cho các tấm biển (plaques) trước khi gửi đến khách hàng. Họ đã tạo một Amazon S3 bucket chứa các hình ảnh khuyết điểm (defects) làm cơ sở để reject tấm biển không đạt chuẩn. Các dự đoán có độ tin cậy thấp (low-confidence predictions) phải được gửi đến đội ngũ nội bộ (internal team) sử dụng Amazon Augmented AI (Amazon A2I) để xem xét thủ công.

Yêu cầu chính:

  • Sử dụng dịch vụ AWS phù hợp để xử lý tự động hình ảnh (automatic processing) từ S3, so sánh với defects để detect vấn đề.
  • Đối với low-confidence, tích hợp Amazon A2I với tùy chọn private workforce dành cho nhân viên nội bộ (không phải public như Mechanical Turk).

Giải pháp cần phù hợp với Computer Vision cho hình ảnh, tích hợp S3 và A2I private team. ✅

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Use Amazon Rekognition for automatic processing. Use Amazon A2I with a private workforce option for manual review.

Lý do:

  • Amazon Rekognition là dịch vụ Computer Vision chuyên phân tích hình ảnh/video, hỗ trợ Custom Labels để train model detect defects dựa trên hình ảnh trong S3 bucket. Nó tự động xử lý incoming plaque images, so sánh với defects và trả về confidence scores. Low-confidence cases được gửi trực tiếp đến Amazon A2I.
  • Amazon A2I hỗ trợ private workforce (nhân viên nội bộ qua AWS IAM), phù hợp với "internal team of reviewers". Điều này đảm bảo bảo mật dữ liệu nội bộ, không dùng public workers.
  • Toàn bộ quy trình tích hợp mượt mà với S3 (event triggers qua EventBridge/SNS), scalable và serverless, phù hợp kiến trúc DevOps hiện đại (cập nhật đến 2026 với Rekognition Custom Labels v2 và A2I enhancements). 🛠️

❌ Phân tích tất cả các phương án

Dưới đây là phân tích chi tiết từng lựa chọn, giữ nguyên văn bản gốc:

  • [SAI] Use Amazon Textract for automatic processing. Use Amazon A2I with Amazon Mechanical Turk for manual review.
    ❌ Sai vì: Amazon Textract chỉ chuyên OCR (Optical Character Recognition) để extract text từ hình ảnh/documents, không phù hợp detect defects hình ảnh (như vết xước trên plaque). Ngoài ra, Amazon Mechanical Turk là public workforce (crowdsourcing bên ngoài), không dành cho "internal team" – vi phạm yêu cầu bảo mật nội bộ.

  • [ĐÚNG] Use Amazon Rekognition for automatic processing. Use Amazon A2I with a private workforce option for manual review.
    ✅ Đúng vì: Như giải thích ở trên, Rekognition lý tưởng cho image analysis/custom defect detection từ S3. A2I private workforce chính xác cho internal reviewers, hỗ trợ low-confidence routing tự động.

  • [SAI] Use Amazon Transcribe for automatic processing. Use Amazon A2I with a private workforce option for manual review.
    ❌ Sai vì: Amazon Transcribe chỉ dùng cho speech-to-text (chuyển giọng nói thành văn bản), hoàn toàn không liên quan đến xử lý hình ảnh defects. Dù phần A2I private đúng, nhưng automatic processing sai hoàn toàn.

  • [SAI] Use AWS Panorama for automatic processing. Use Amazon A2I with Amazon Mechanical Turk for manual review.
    ❌ Sai vì: AWS Panorama là hardware appliance cho on-premises video analytics (edge computing với cameras), không phù hợp xử lý batch images từ S3 cloud. Mechanical Turk lại là public workforce, không dùng cho internal team.

📘 Tài liệu tham khảo

Hy vọng phân tích này giúp bạn ôn thi hiệu quả! 🚀 Nếu cần thêm chi tiết, hỏi nhé!

Câu 242
A machine learning (ML) engineer at a bank is building a data ingestion solution to provide transaction features to financial ML models. Raw transactional data is available in an Amazon Kinesis data stream.

The solution must compute rolling averages of the ingested data from the data stream and must store the results in Amazon SageMaker Feature Store. The solution also must serve the results to the models in near real time.

Which solution will meet these requirements?
  1. A Load the data into an Amazon S3 bucket by using Amazon Kinesis Data Firehose. Use a SageMaker Processing job to aggregate the data and to load the results into SageMaker Feature Store as an online feature group.
  2. B Write the data directly from the data stream into SageMaker Feature Store as an online feature group. Calculate the rolling averages in place within SageMaker Feature Store by using the SageMaker GetRecord API operation.
  3. C Consume the data stream by using an Amazon Kinesis Data Analytics SQL application that calculates the rolling averages. Generate a result stream. Consume the result stream by using a custom AWS Lambda function that publishes the results to SageMaker Feature Store as an online feature group.
  4. D Load the data into an Amazon S3 bucket by using Amazon Kinesis Data Firehose. Use a SageMaker Processing job to load the data into SageMaker Feature Store as an offline feature group. Compute the rolling averages at query time.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi xoay quanh việc xây dựng một giải pháp ingestion dữ liệu cho kỹ sư ML tại ngân hàng, sử dụng Amazon Kinesis Data Stream chứa dữ liệu giao dịch thô (raw transactional data).

Yêu cầu chính của giải pháp:

  • 📊 Tính toán rolling averages (trung bình trượt) từ dữ liệu stream.
  • 💾 Lưu kết quả vào Amazon SageMaker Feature Store.
  • ⚡ Phục vụ kết quả cho các mô hình ML gần real-time (near real-time).

Giải pháp phải xử lý streaming data từ Kinesis, thực hiện aggregation thời gian thực (rolling averages thường dùng window functions), và hỗ trợ online serving từ Feature Store để đạt độ trễ thấp. SageMaker Feature Store có hai loại: online (cho low-latency lookups, near RT) và offline (batch analytics). Kiến thức cập nhật đến 2026: Kinesis Data Analytics (nay là Amazon Managed Service for Apache Flink) hỗ trợ SQL streaming cho windowed aggregates; Feature Store online hỗ trợ ingest qua PutRecord API.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Consume the data stream by using an Amazon Kinesis Data Analytics SQL application that calculates the rolling averages. Generate a result stream. Consume the result stream by using a custom AWS Lambda function that publishes the results to SageMaker Feature Store as an online feature group.

Lý do chọn 🛠️:

  • Kinesis Data Analytics (SQL) lý tưởng cho streaming analytics với window functions (như TUMBLE, HOP để tính rolling averages) trên Kinesis stream, tạo output stream chứa kết quả đã aggregate.
  • Lambda consume output stream, sử dụng PutRecord API của SageMaker Feature Store để ingest vào online feature group – hỗ trợ near real-time serving (latency <100ms) cho ML models.
  • Toàn bộ quy trình serverless, scalable, phù hợp production ML pipeline tại bank (high throughput transactions).
  • Không dùng batch processing, đảm bảo end-to-end streaming.

📋 Phân tích tất cả các phương án (đúng/sai)

  • Phương án A ❌:
    Load the data into an Amazon S3 bucket by using Amazon Kinesis Data Firehose. Use a SageMaker Processing job to aggregate the data and to load the results into SageMaker Feature Store as an online feature group.
    Giải thích sai 🚫: Kinesis Data Firehose chỉ buffer và deliver batch vào S3 (không streaming real-time). SageMaker Processing job là batch processing (chạy trên EC2/Spot, giờ hàng giờ), không hỗ trợ near real-time. Dù load vào online Feature Store, aggregation batch làm chậm serving cho models.

  • Phương án B ❌:
    Write the data directly from the data stream into SageMaker Feature Store as an online feature group. Calculate the rolling averages in place within SageMaker Feature Store by using the SageMaker GetRecord API operation.
    Giải thích sai 🚫: Feature Store không hỗ trợ write trực tiếp từ Kinesis stream mà không qua intermediary (cần Lambda/Kinesis Agent). GetRecord API chỉ retrieve records (read-only), không compute rolling averages in-place – Feature Store là storage layer, không phải compute engine cho aggregation streaming.

  • Phương án C ✅:
    Consume the data stream by using an Amazon Kinesis Data Analytics SQL application that calculates the rolling averages. Generate a result stream. Consume the result stream by using a custom AWS Lambda function that publishes the results to SageMaker Feature Store as an online feature group.
    Giải thích đúng 🟢: Như đã phân tích ở trên. KDA SQL xử lý windowed aggregation (ví dụ: AVG(OVER (ORDER BY ROWTIME ROWS 100 PRECEDING)) cho rolling avg). Output stream -> Lambda trigger -> PutRecord vào online Feature Store, đảm bảo near RT serving. Scalable, fault-tolerant.

  • Phương án D ❌:
    Load the data into an Amazon S3 bucket by using Amazon Kinesis Data Firehose. Use a SageMaker Processing job to load the data into SageMaker Feature Store as an offline feature group. Compute the rolling averages at query time.
    Giải thích sai 🚫: Tương tự A, batch via Firehose + Processing không near RT. Offline Feature Store dành cho batch training (Athena/S3 queries), không low-latency serving. Compute at query time (real-time query) làm tăng latency, không phù hợp serve to models near RT.

📘 Tài liệu tham khảo (AWS docs cập nhật 2026)

Giải pháp C là best practice cho real-time feature engineering! 🎯

Câu 243
Each morning, a data scientist at a rental car company creates insights about the previous day’s rental car reservation demands. The company needs to automate this process by streaming the data to Amazon S3 in near real time. The solution must detect high-demand rental cars at each of the company’s locations. The solution also must create a visualization dashboard that automatically refreshes with the most recent data.

Which solution will meet these requirements with the LEAST development time?
  1. A Use Amazon Kinesis Data Firehose to stream the reservation data directly to Amazon S3. Detect high-demand outliers by using Amazon QuickSight ML Insights. Visualize the data in QuickSight.
  2. B Use Amazon Kinesis Data Streams to stream the reservation data directly to Amazon S3. Detect high-demand outliers by using the Random Cut Forest (RCF) trained model in Amazon SageMaker. Visualize the data in Amazon QuickSight.
  3. C Use Amazon Kinesis Data Firehose to stream the reservation data directly to Amazon S3. Detect high-demand outliers by using the Random Cut Forest (RCF) trained model in Amazon SageMaker. Visualize the data in Amazon QuickSight.
  4. D Use Amazon Kinesis Data Streams to stream the reservation data directly to Amazon S3. Detect high-demand outliers by using Amazon QuickSight ML Insights. Visualize the data in QuickSight.
Xem giải thích

🧩 Giải thích nội dung câu hỏi

Câu hỏi tập trung vào việc tự động hóa quy trình tạo insights hàng ngày về nhu cầu thuê xe từ dữ liệu đặt chỗ (reservation data) của công ty cho thuê xe. Các yêu cầu chính bao gồm:

  • Stream dữ liệu đến Amazon S3 gần thời gian thực (near real-time) để xử lý nhanh chóng dữ liệu của ngày hôm trước.
  • Phát hiện xe có nhu cầu cao (high-demand outliers) tại từng địa điểm của công ty.
  • Tạo dashboard trực quan hóa (visualization dashboard) tự động làm mới với dữ liệu mới nhất.
  • Tiêu chí chọn giải pháp: LEAST development time (ít thời gian phát triển nhất), nghĩa là ưu tiên các dịch vụ AWS managed, serverless, không cần code phức tạp hoặc train model thủ công.
    ✅ Đây là tình huống điển hình trong AWS Analytics pipeline, sử dụng streaming data với anomaly detection và BI visualization. Kiến thức cập nhật đến 2026: Kinesis Data Firehose và QuickSight ML Insights vẫn là lựa chọn tối ưu cho near real-time S3 delivery và ML no-code anomaly detection.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng:
Use Amazon Kinesis Data Firehose to stream the reservation data directly to Amazon S3. Detect high-demand outliers by using Amazon QuickSight ML Insights. Visualize the data in QuickSight.

Lý do chi tiết:
🛠️ Kinesis Data Firehose hỗ trợ stream trực tiếp (direct delivery) đến S3 với buffer tự động, transformation (nếu cần), và near real-time (latency ~60s), không cần viết code consumer như Kinesis Data Streams.
🧠 QuickSight ML Insights cung cấp anomaly detection built-in (sử dụng ML algorithms như Random Cut Forest nội bộ) không cần train model, chỉ cần connect dataset từ S3 và enable ML insights – least dev time.
📊 QuickSight visualization tự động refresh dashboard với dữ liệu S3 mới, hỗ trợ SPICE engine cho performance cao.
➡️ Giải pháp này serverless hoàn toàn, deploy nhanh trong vài phút, phù hợp DOP best practices cho automation.

📘 Tài liệu tham khảo:

🔍 Phân tích tất cả các phương án

Dưới đây là phân tích chi tiết từng lựa chọn, giữ nguyên văn bản gốc bằng tiếng Anh. Tôi đánh giá dựa trên least dev time, tính khả thi kỹ thuật và cập nhật AWS 2026.

  • Use Amazon Kinesis Data Firehose to stream the reservation data directly to Amazon S3. Detect high-demand outliers by using Amazon QuickSight ML Insights. Visualize the data in QuickSight.
    ✅ Đúng – Giải pháp tối ưu. Như đã giải thích ở trên: Firehose direct-to-S3 (near real-time, no code), QuickSight ML Insights no-training cho outlier detection (high-demand), và viz tự refresh. Least dev time (setup <1 giờ).

  • Use Amazon Kinesis Data Streams to stream the reservation data directly to Amazon S3. Detect high-demand outliers by using the Random Cut Forest (RCF) trained model in Amazon SageMaker. Visualize the data in Amazon QuickSight.
    ❌ Sai. Kinesis Data Streams KHÔNG hỗ trợ stream trực tiếp đến S3 (cần Lambda/Kinesis Client Library để consume và push, tăng dev time đáng kể). SageMaker RCF yêu cầu train model thủ công (code notebook, deploy endpoint), phức tạp và tốn thời gian hơn QuickSight ML. QuickSight viz OK nhưng tổng thể high dev effort.

  • Use Amazon Kinesis Data Firehose to stream the reservation data directly to Amazon S3. Detect high-demand outliers by using the Random Cut Forest (RCF) trained model in Amazon SageMaker. Visualize the data in Amazon QuickSight.
    ❌ Sai. Firehose + S3 đúng cho streaming (near real-time). Nhưng SageMaker RCF yêu cầu train/deploy model (code Python, Jupyter, endpoint management), tăng dev time lớn so với QuickSight ML Insights built-in. QuickSight viz OK, nhưng không phải least effort.

  • Use Amazon Kinesis Data Streams to stream the reservation data directly to Amazon S3. Detect high-demand outliers by using Amazon QuickSight ML Insights. Visualize the data in QuickSight.
    ❌ Sai. Kinesis Data Streams KHÔNG direct-to-S3 (phải dùng Lambda/Firehose làm bridge, thêm code và shards management). QuickSight ML Insights + viz tốt cho detection, nhưng streaming failure làm toàn bộ giải pháp không feasible và tăng dev time.

Kết luận tổng quát 🎯: Chỉ phương án đầu tiên kết hợp streaming managed + ML no-code + BI refresh để đạt least development time. Các sai lầm phổ biến là nhầm lẫn KDS vs KDF và overlook SageMaker training overhead!

Câu 244
A machine learning (ML) engineer is integrating a production model with a customer metadata repository for real-time inference. The repository is hosted in Amazon SageMaker Feature Store. The engineer wants to retrieve only the latest version of the customer metadata record for a single customer at a time.

Which solution will meet these requirements?
  1. A Use the SageMaker Feature Store BatchGetRecord API with the record identifier. Filter to find the latest record.
  2. B Create an Amazon Athena query to retrieve the data from the feature table.
  3. C Create an Amazon Athena query to retrieve the data from the feature table. Use the write_time value to find the latest record.
  4. D Use the SageMaker Feature Store GetRecord API with the record identifier.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi xoay quanh một Machine Learning (ML) Engineer đang tích hợp model sản xuất (production model) với kho lưu trữ metadata khách hàng (customer metadata repository) để thực hiện suy luận thời gian thực (real-time inference). Kho lưu trữ này được host trên Amazon SageMaker Feature Store.

Yêu cầu cụ thể:

  • Chỉ lấy phiên bản mới nhất (latest version) của bản ghi metadata (record) cho một khách hàng duy nhất (single customer) tại mỗi lần truy vấn.
  • Phù hợp với real-time inference, nghĩa là cần độ trễ thấp (low latency), online truy vấn nhanh chóng, không phải batch processing chậm.

Mục tiêu chính: Tìm giải pháp tối ưu sử dụng API hoặc công cụ của SageMaker Feature Store để lấy dữ liệu latest record cho một record identifier (ví dụ: customer ID) một cách hiệu quả nhất. 📈

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Use the SageMaker Feature Store GetRecord API with the record identifier.

Lý do:

  • GetRecord API được thiết kế chính xác cho online truy vấn real-time trên SageMaker Feature Store (phiên bản mới nhất 2024-2026).
  • Nó tự động trả về phiên bản mới nhất của record dựa trên record identifier (như customer ID), không cần filter thủ công.
  • Hoàn hảo cho single record, low-latency (milliseconds), phù hợp real-time inference. 🛠️
  • Theo docs AWS, đây là API chuẩn cho real-time feature retrieval.

📋 Giải thích tất cả các phương án (Đúng/Sai)

Dưới đây là phân tích từng lựa chọn một, giữ nguyên văn bản gốc tiếng Anh. Mỗi phương án được đánh dấu ✅ hoặc ❌, kèm giải thích chi tiết bằng tiếng Việt dựa trên tính năng AWS mới nhất (SageMaker Feature Store v3+).

  • ❌ [SAI] Use the SageMaker Feature Store BatchGetRecord API with the record identifier. Filter to find the latest record.

    • Lý do sai: BatchGetRecord dùng cho nhiều records (batch up to 100), không tối ưu cho single record. Nó đã tự trả latest version cho mỗi identifier, không cần filter. Sử dụng sẽ thừa thãi, tăng latency không cần thiết cho real-time. Phù hợp batch hơn single. 🚫
  • ❌ [SAI] Create an Amazon Athena query to retrieve the data from the feature table.

    • Lý do sai: Athena là query engine cho batch analytics/offline trên dữ liệu Feature Store (qua Online Store snapshot hoặc Offline Store). Không hỗ trợ real-time (latency cao, giây/phút), không phù hợp inference. Feature Store khuyến nghị API trực tiếp cho online queries. ⏳
  • ❌ [SAI] Create an Amazon Athena query to retrieve the data from the feature table. Use the write_time value to find the latest record.

    • Lý do sai: Tương tự trên, Athena chậm cho real-time. Có thể dùng write_time để filter latest (trên Offline Store), nhưng vẫn không phải giải pháp online. AWS docs nhấn mạnh: Athena cho historical analysis, không inference. 📊
  • ✅ [ĐÚNG] Use the SageMaker Feature Store GetRecord API with the record identifier.

    • Lý do đúng: API online, real-time, tự động latest version cho single identifier. Latency thấp, tích hợp trực tiếp inference pipeline. Best practice AWS cho production ML serving. 🔥

📘 Tài liệu tham khảo (Cập nhật mới nhất đến 2026)

  • AWS SageMaker Feature Store Documentation: Feature Store APIs – Chi tiết GetRecord vs BatchGetRecord.
  • API Reference: GetRecord (returns latest only).
  • Best Practices: Real-time Inference with Feature Store (2023+, vẫn valid 2026).
  • Exam Prep: AWS Certified Machine Learning Specialty/DevOps Pro – Topic: SageMaker Feature Management.

Hy vọng phân tích này giúp bạn nắm vững! Nếu cần thêm ví dụ code Boto3, hãy hỏi nhé. 🚀

Câu 245 Chọn nhiều đáp án
A company’s data scientist has trained a new machine learning model that performs better on test data than the company’s existing model performs in the production environment. The data scientist wants to replace the existing model that runs on an Amazon SageMaker endpoint in the production environment. However, the company is concerned that the new model might not work well on the production environment data.

The data scientist needs to perform A/B testing in the production environment to evaluate whether the new model performs well on production environment data.

Which combination of steps must the data scientist take to perform the A/B testing? (Choose two.)
  1. A Create a new endpoint configuration that includes a production variant for each of the two models.
  2. B Create a new endpoint configuration that includes two target variants that point to different endpoints.
  3. C Deploy the new model to the existing endpoint.
  4. D Update the existing endpoint to activate the new model.
  5. E Update the existing endpoint to use the new endpoint configuration.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi tập trung vào Amazon SageMaker, một dịch vụ managed ML của AWS, cụ thể là cách thực hiện A/B testing cho hai mô hình machine learning (model cũ đang chạy production và model mới tốt hơn trên test data).

  • Bối cảnh: Công ty lo ngại model mới chưa chắc hoạt động tốt trên dữ liệu production thực tế. Data scientist cần test song song (A/B testing) trên SageMaker endpoint hiện tại mà không làm gián đoạn dịch vụ.
  • Mục tiêu: Chọn hai bước kết hợp để triển khai A/B testing, nơi traffic inference được phân bổ (ví dụ: 50/50) giữa hai model trên cùng một endpoint, sử dụng production variants trong endpoint configuration.
  • Khái niệm chính (cập nhật SageMaker 2026): SageMaker hỗ trợ multi-model endpoints qua production variants – mỗi variant đại diện cho một model version, với traffic split (InitialVariantWeight). Bạn tạo endpoint configuration mới chứa các variants, rồi update endpoint để áp dụng mà không downtime. Điều này cho phép A/B testing an toàn, dễ monitor metrics qua CloudWatch.

✅ Đáp án đúng và lý do lựa chọn

Hai bước PHẢI THỰC HIỆN (chọn đúng theo câu hỏi):

  1. Create a new endpoint configuration that includes a production variant for each of the two models.
    🛠️ Lý do: Đây là bước đầu tiên để định nghĩa A/B testing. Endpoint configuration mới chứa hai production variants (mỗi variant cho một model), với traffic weights (ví dụ: VariantA=0.5, VariantB=0.5). SageMaker tự động route traffic ngẫu nhiên hoặc theo tỷ lệ.

  2. Update the existing endpoint to use the new endpoint configuration.
    🛠️ Lý do: Bước thứ hai để kích hoạt config mới trên endpoint production hiện tại. Update này zero-downtime (blue-green deployment), traffic ngay lập tức split giữa hai variants. Không cần tạo endpoint mới, giữ nguyên DNS/ARN.

Kết hợp hai bước này đảm bảo A/B testing trên production data mà không rủi ro.

📋 Phân tích tất cả các phương án

Dưới đây là phân tích từng lựa chọn một, giữ nguyên văn bản gốc tiếng Anh. Mỗi phương án được đánh giá ✅ (đúng) hoặc ❌ (sai), kèm giải thích chi tiết bằng tiếng Việt dựa trên tài liệu SageMaker mới nhất.

  • ✅ Create a new endpoint configuration that includes a production variant for each of the two models.
    🛠️ Đúng vì: Production variants cho phép host nhiều model trên một endpoint, hỗ trợ A/B bằng traffic splitting. Tạo config mới tránh overwrite config cũ. (Ví dụ API: CreateEndpointConfig với ProductionVariants=[{'VariantName': 'ModelA', 'ModelName': 'model-old', 'InitialInstanceCount':1}, {'VariantName': 'ModelB', 'ModelName': 'model-new', 'InitialVariantWeight': 0.5}]).

  • ❌ Create a new endpoint configuration that includes two target variants that point to different endpoints.
    🧩 Sai vì: Target variants dùng cho provisioned concurrency hoặc autoscaling (trong Lambda/SageMaker), không phải split traffic giữa hai endpoints riêng biệt. SageMaker A/B testing yêu cầu single endpoint với variants nội bộ, không "point to different endpoints" (sẽ phức tạp, không zero-downtime).

  • ❌ Deploy the new model to the existing endpoint.
    🛠️ Sai vì: "Deploy" chỉ thêm model mới vào registry, không tự động tạo variants hoặc split traffic. Endpoint hiện tại chỉ chạy một model chính, deploy mới sẽ overwrite (không A/B). Phải qua endpoint config để multi-variant.

  • ❌ Update the existing endpoint to activate the new model.
    🧩 Sai vì: Update endpoint chỉ kích hoạt một model duy nhất (hoặc config hiện tại), không hỗ trợ A/B testing tự động. "Activate new model" ngụ ý thay thế hoàn toàn, gây downtime hoặc mất model cũ – trái với yêu cầu test song song.

  • ✅ Update the existing endpoint to use the new endpoint configuration.
    🛠️ Đúng vì: Sau khi có config với variants, dùng UpdateEndpoint (API: UpdateEndpoint --EndpointName prod-endpoint --EndpointConfigName new-config) để atomic update traffic split. SageMaker handle rollout gradual, monitor qua Invocation metrics trên CloudWatch.

📘 Tài liệu tham khảo (AWS cập nhật 2026)

Hy vọng phân tích này giúp bạn ôn thi DOP-C02 hiệu quả! 🚀 Nếu cần ví dụ code boto3, hỏi thêm nhé!

Câu 246
A data scientist is working on a forecast problem by using a dataset that consists of .csv files that are stored in Amazon S3. The files contain a timestamp variable in the following format:


March 1st, 2020, 08:14pm -

There is a hypothesis about seasonal differences in the dependent variable. This number could be higher or lower for weekdays because some days and hours present varying values, so the day of the week, month, or hour could be an important factor. As a result, the data scientist needs to transform the timestamp into weekdays, month, and day as three separate variables to conduct an analysis.

Which solution requires the LEAST operational overhead to create a new dataset with the added features?
  1. A Create an Amazon EMR cluster. Develop PySpark code that can read the timestamp variable as a string, transform and create the new variables, and save the dataset as a new file in Amazon S3.
  2. B Create a processing job in Amazon SageMaker. Develop Python code that can read the timestamp variable as a string, transform and create the new variables, and save the dataset as a new file in Amazon S3.
  3. C Create a new flow in Amazon SageMaker Data Wrangler. Import the S3 file, use the Featurize date/time transform to generate the new variables, and save the dataset as a new file in Amazon S3.
  4. D Create an AWS Glue job. Develop code that can read the timestamp variable as a string, transform and create the new variables, and save the dataset as a new file in Amazon S3.
Xem giải thích

🧩 Giải thích nội dung câu hỏi

Câu hỏi tập trung vào một nhà khoa học dữ liệu (data scientist) đang làm việc với bài toán dự báo (forecast) sử dụng bộ dữ liệu CSV lưu trữ trên Amazon S3. Các file chứa biến thời gian (timestamp) ở định dạng chuỗi không chuẩn: "March 1st, 2020, 08:14pm -".
Có giả thuyết về sự khác biệt theo mùa vụ (seasonal differences) trong biến phụ thuộc, ví dụ: giá trị cao/thấp hơn vào các ngày trong tuần, giờ khác nhau. Do đó, cần biến đổi timestamp thành 3 biến riêng biệt: ngày trong tuần (weekday), tháng (month), và ngày (day) để phân tích.
Mục tiêu: Tìm giải pháp ít overhead vận hành nhất (LEAST operational overhead) để tạo bộ dữ liệu mới với các feature bổ sung, lưu lại S3.
Overhead ở đây bao gồm: quản lý infrastructure, viết code phức tạp, scale cluster, monitoring job... (dựa trên AWS best practices 2024-2026, ưu tiên serverless/no-code tools).

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Create a new flow in Amazon SageMaker Data Wrangler. Import the S3 file, use the Featurize date/time transform to generate the new variables, and save the dataset as a new file in Amazon S3.

Lý do:
🛠️ Amazon SageMaker Data Wrangler (phiên bản mới nhất 2026) là công cụ visual, no-code/low-code chuyên prepare data cho ML, tích hợp trực tiếp S3. Nó có transform sẵn "Featurize date/time" tự động parse timestamp (kể cả định dạng phức tạp như "March 1st, 2020, 08:14pm") và extract weekday, month, day/hour mà không cần viết code.

  • Ít overhead nhất: Chỉ tạo "flow" qua UI (drag-drop), import/export S3 tự động, serverless (không quản lý cluster/job). Profiling/visualization tích hợp, export code nếu cần scale sang SageMaker Pipelines.
  • So sánh: Các option khác yêu cầu code custom + infrastructure (EMR cluster, Processing/Glue jobs).
    📘 Nguồn: AWS SageMaker Data Wrangler Docs (cập nhật 2025: hỗ trợ 100+ transforms, auto-parse datetime variants).

📋 Phân tích tất cả các phương án

Dưới đây là phân tích chi tiết từng lựa chọn, giữ nguyên văn bản gốc tiếng Anh. Mỗi phương án được đánh giá ✅ (đúng) hoặc ❌ (sai), kèm lý do cụ thể dựa trên overhead vận hành (code, infra, scale).

  • ❌ [SAI] Create an Amazon EMR cluster. Develop PySpark code that can read the timestamp variable as a string, transform and create the new variables, and save the dataset as a new file in Amazon S3.
    Lý do sai: EMR yêu cầu tạo và quản lý cluster (EC2 instances, scaling, termination), viết PySpark code custom để parse datetime (sử dụng to_date, dayofweek, regex cho "1st"). Overhead cao: monitoring via YARN, cost cluster idle, không visual. Phù hợp big data nhưng thừa cho task đơn giản này (2026: EMR Serverless giảm nhưng vẫn > Data Wrangler).

  • ❌ [SAI] Create a processing job in Amazon SageMaker. Develop Python code that can read the timestamp variable as a string, transform and create the new variables, and save the dataset as a new file in Amazon S3.
    Lý do sai: SageMaker Processing cần viết Python code (pandas pd.to_datetime với custom format, dt.weekday, dt.month), containerize, submit job (managed endpoints). Overhead trung bình: scale theo instance, logging CloudWatch, nhưng vẫn code-heavy + job orchestration. Không no-code như Data Wrangler (2026: Processing hỗ trợ distributed nhưng không auto-featurize).

  • ✅ [ĐÚNG] Create a new flow in Amazon SageMaker Data Wrangler. Import the S3 file, use the Featurize date/time transform to generate the new variables, and save the dataset as a new file in Amazon S3.
    Lý do đúng: Như đã giải thích trên – visual flow, transform sẵn, zero-code cho parse/extract (weekday: Mon-Sun, month: 1-12, day: 1-31). Export CSV/Parquet trực tiếp S3, integrate SageMaker Studio. Overhead thấp nhất: serverless, UI-driven, auto-handle large datasets (2026: tích hợp Canvas cho non-coders).

  • ❌ [SAI] Create an AWS Glue job. Develop code that can read the timestamp variable as a string, transform and create the new variables, and save the dataset as a new file in Amazon S3.
    Lý do sai: AWS Glue (ETL serverless 2026) cần viết Spark/SQL/PySpark code custom (Glue DynamicFrame, to_timestamp, date_format functions). Overhead: job triggers, crawler catalog, monitoring Glue Console. Tốt cho ETL pipeline lớn nhưng thừa code cho feature engineering đơn giản; không có visual transform như Data Wrangler.

🚀 Kết luận & Best Practices

Giải pháp SageMaker Data Wrangler là optimal cho ML data prep, giảm time-to-insight từ giờ xuống phút. Nếu scale production, export flow sang SageMaker Pipelines (zero overhead refactor).
📘 Tài liệu tham khảo thêm:

Câu 247
A manufacturing company has a production line with sensors that collect hundreds of quality metrics. The company has stored sensor data and manual inspection results in a data lake for several months. To automate quality control, the machine learning team must build an automated mechanism that determines whether the produced goods are good quality, replacement market quality, or scrap quality based on the manual inspection results.

Which modeling approach will deliver the MOST accurate prediction of product quality?
  1. A Amazon SageMaker DeepAR forecasting algorithm
  2. B Amazon SageMaker XGBoost algorithm
  3. C Amazon SageMaker Latent Dirichlet Allocation (LDA) algorithm
  4. D A convolutional neural network (CNN) and ResNet
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi xoay quanh một công ty sản xuất sử dụng dây chuyền sản xuất với cảm biến (sensors) thu thập hàng trăm chỉ số chất lượng (quality metrics). Dữ liệu cảm biến và kết quả kiểm tra thủ công (manual inspection results) đã được lưu trữ trong data lake trong vài tháng. Nhiệm vụ của đội ngũ machine learning là xây dựng cơ chế tự động hóa kiểm soát chất lượng, cụ thể là phân loại sản phẩm thành 3 loại: good quality (chất lượng tốt), replacement market quality (chất lượng thay thế thị trường), hoặc scrap quality (chất lượng phế liệu), dựa trên dữ liệu kiểm tra thủ công làm nhãn (labels).

📌 Đây là bài toán Machine Learning kiểu CLASSIFICATION (phân loại) đa lớp (multi-class classification) trên dữ liệu tabular (dữ liệu bảng) từ cảm biến – tức là các chỉ số số học (metrics) dạng số, không phải dữ liệu thời gian thuần túy, văn bản hay hình ảnh. Mục tiêu là chọn mô hình (modeling approach) cho dự đoán chính xác nhất (MOST accurate prediction) bằng Amazon SageMaker.

✅ Đáp án đúng: Amazon SageMaker XGBoost algorithm

Lý do lựa chọn:
XGBoost là thuật toán gradient boosting mạnh mẽ, được tối ưu hóa cho dữ liệu tabular với hàng trăm features số (quality metrics từ sensors). Nó xuất sắc trong multi-class classification nhờ khả năng xử lý nhiễu, tương tác features phức tạp và tránh overfitting. Trong SageMaker (phiên bản mới nhất 2024-2026), XGBoost hỗ trợ built-in algorithm dễ train trên data lake (S3), tích hợp AutoML và Hyperparameter Tuning, đạt độ chính xác cao nhất cho bài toán này. Kết quả kiểm tra thủ công làm ground truth labels hoàn hảo cho supervised learning. 🏆

🛠️ Giải thích TẤT CẢ các phương án (đúng/sai)

  • ❌ Amazon SageMaker DeepAR forecasting algorithm
    Sai vì DeepAR là thuật toán dự báo chuỗi thời gian (time series forecasting), dùng cho dự đoán giá trị tương lai liên tục (continuous values) như doanh số hoặc nhu cầu, không phải phân loại rời rạc (categorical classification) chất lượng sản phẩm. Dữ liệu ở đây không tập trung vào forecasting mà là classification dựa trên metrics hiện tại.

  • ✅ Amazon SageMaker XGBoost algorithm
    Đúng như đã giải thích ở trên. Đây là lựa chọn tối ưu cho tabular classification với độ chính xác cao, hỗ trợ multi-class natively qua tham số num_class. SageMaker XGBoost cập nhật 2024+ tích hợp GPU acceleration và one-click deployment.

  • ❌ Amazon SageMaker Latent Dirichlet Allocation (LDA) algorithm
    Sai vì LDA là thuật toán topic modeling không giám sát (unsupervised) cho dữ liệu văn bản (text), dùng để khám phá chủ đề ẩn trong corpus lớn. Không phù hợp với dữ liệu số từ sensors (không phải text) và không hỗ trợ classification có nhãn.

  • ❌ A convolutional neural network (CNN) and ResNet
    Sai vì CNN/ResNet là mô hình deep learning cho hình ảnh (image classification), chuyên xử lý pixel data với convolution layers. Dữ liệu sensors là tabular numerical metrics (không phải ảnh), nên dùng CNN sẽ kém hiệu quả, tốn tài nguyên và dễ underfit mà không có data augmentation phù hợp.

📘 Tài liệu tham khảo (AWS cập nhật mới nhất đến 2026)

  • AWS SageMaker Algorithms: docs.aws.amazon.com/sagemaker/latest/dg/algos.html (XGBoost cho classification).
  • XGBoost in SageMaker: docs.aws.amazon.com/sagemaker/latest/dg/xgboost.html (hỗ trợ multi-class).
  • So sánh algorithms: AWS re:Invent 2024 ML sessions & SageMaker Best Practices (tabular data ưu tiên XGBoost/Tabular algorithms).
    🧠 Lời khuyên: Sử dụng SageMaker Processing để chuẩn bị data từ data lake (S3), rồi train XGBoost với Managed Spot Instances tiết kiệm chi phí!
Câu 248
A healthcare company wants to create a machine learning (ML) model to predict patient outcomes. A data science team developed an ML model by using a custom ML library. The company wants to use Amazon SageMaker to train this model. The data science team creates a custom SageMaker image to train the model. When the team tries to launch the custom image in SageMaker Studio, the data scientists encounter an error within the application.

Which service can the data scientists use to access the logs for this error?
  1. A Amazon S3
  2. B Amazon Elastic Block Store (Amazon EBS)
  3. C AWS CloudTrail
  4. D Amazon CloudWatch
Xem giải thích

🧩 Giải thích nội dung câu hỏi

Câu hỏi mô tả tình huống một công ty y tế đang xây dựng mô hình machine learning (ML) để dự đoán kết quả bệnh nhân. Đội ngũ data science đã phát triển mô hình bằng thư viện ML tùy chỉnh và muốn sử dụng Amazon SageMaker để huấn luyện (train) mô hình này. Họ tạo một custom SageMaker image (hình ảnh tùy chỉnh) để hỗ trợ thư viện đó. Tuy nhiên, khi cố gắng launch (khởi chạy) hình ảnh tùy chỉnh này trong SageMaker Studio, các data scientist gặp lỗi trong ứng dụng.

🛠️ Vấn đề cốt lõi: Cần xác định dịch vụ AWS nào để truy cập logs (nhật ký) của lỗi này. SageMaker Studio là môi trường IDE dựa trên JupyterLab, tích hợp chặt chẽ với các dịch vụ logging của AWS. Logs từ training jobs, kernels, và ứng dụng Studio thường được lưu trữ tự động để debug lỗi như image không tương thích hoặc failure khi launch.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Amazon CloudWatch

📊 Lý do chi tiết: Amazon CloudWatch là dịch vụ chính để thu thập, giám sát và truy cập logs từ SageMaker, bao gồm CloudWatch Logs cho các lỗi ứng dụng trong SageMaker Studio. Khi launch custom image trong Studio (như kernel hoặc app), logs được đẩy tự động vào CloudWatch Logs Groups (ví dụ: /aws/sagemaker/Studio hoặc training job logs). Data scientists có thể sử dụng CloudWatch Logs Insights để query và phân tích lỗi realtime. Đây là cách chuẩn theo best practices AWS (cập nhật đến 2026), hỗ trợ full observability cho SageMaker workloads mà không cần config thủ công.

📋 Phân tích tất cả các phương án

Dưới đây là phân tích từng lựa chọn, với đánh dấu ✅ đúng hoặc ❌ sai, giữ nguyên văn bản gốc:

  • ❌ Amazon S3
    Amazon S3 là dịch vụ lưu trữ object dùng để lưu dữ liệu huấn luyện, mô hình đã train, hoặc artifacts từ SageMaker (như qua s3_output_path). Tuy nhiên, nó không lưu logs lỗi ứng dụng từ SageMaker Studio. S3 chỉ dùng cho persistent storage, không phải realtime logging hay debugging app errors.

  • ❌ Amazon Elastic Block Store (Amazon EBS)
    Amazon EBS cung cấp block storage volumes cho EC2 instances hoặc SageMaker (như attach volume cho notebook). Nó lưu dữ liệu file hệ thống, nhưng không phải là nơi lưu logs lỗi. EBS chỉ hỗ trợ storage bền vững, không có cơ chế log aggregation hay query như CloudWatch.

  • ❌ AWS CloudTrail
    AWS CloudTrail ghi lại API calls và events quản trị (như CreateTrainingJob hoặc launch Studio domain). Nó hữu ích cho audit/security, nhưng không lưu logs chi tiết ứng dụng hoặc kernel errors từ custom image trong Studio. CloudTrail chỉ track control plane actions, không phải data plane logs.

  • ✅ Amazon CloudWatch
    Như đã giải thích ở trên, đây là lựa chọn đúng vì CloudWatch Logs tự động capture tất cả logs từ SageMaker Studio apps, training jobs, và custom containers. Data scientists truy cập qua Console hoặc CLI để debug nhanh (ví dụ: lỗi Docker image incompatible).

📘 Tài liệu tham khảo

Hy vọng phân tích này giúp bạn ôn thi DOP-C02 hiệu quả! 🚀 Nếu cần thêm ví dụ code CLI, hãy hỏi nhé!

Câu 249
A data scientist wants to build a financial trading bot to automate investment decisions. The financial bot should recommend the quantity and price of an asset to buy or sell to maximize long-term profit. The data scientist will continuously stream financial transactions to the bot for training purposes. The data scientist must select the appropriate machine learning (ML) algorithm to develop the financial trading bot.

Which type of ML algorithm will meet these requirements?
  1. A Supervised learning
  2. B Unsupervised learning
  3. C Semi-supervised learning
  4. D Reinforcement learning
Xem giải thích

🧠 Phân tích câu hỏi trắc nghiệm AWS về Machine Learning (Phiên bản cập nhật AWS 2026)

📖 Giải thích nội dung câu hỏi một cách chi tiết và rõ ràng:
Câu hỏi mô tả một data scientist muốn xây dựng bot giao dịch tài chính tự động (financial trading bot) để tự động hóa các quyết định đầu tư. Bot này cần khuyến nghị số lượng và giá mua/bán tài sản (quantity and price of an asset to buy or sell) nhằm tối đa hóa lợi nhuận dài hạn (maximize long-term profit). Dữ liệu giao dịch tài chính sẽ được stream liên tục (continuously stream) đến bot để huấn luyện.
🛠️ Yêu cầu cốt lõi: Bot phải học từ môi trường động (thị trường tài chính biến động), thử nghiệm hành động (mua/bán), nhận phản hồi dưới dạng phần thưởng (reward = lợi nhuận), và cải thiện chiến lược qua thời gian mà không cần dữ liệu có nhãn sẵn. Đây là tình huống điển hình của AWS SageMaker hỗ trợ các thuật toán ML cho trading bots, nơi môi trường tương tác thời gian thực là yếu tố quyết định.

✅ Đáp án đúng: Reinforcement learning
Lý do lựa chọn (bằng kiến thức AWS cập nhật 2026):
Reinforcement Learning (RL) là loại thuật toán ML lý tưởng vì bot hoạt động như một agent học qua trial-and-error trong môi trường thị trường, nhận reward từ lợi nhuận dài hạn (positive/negative dựa trên quyết định mua/bán). AWS SageMaker RL hỗ trợ tích hợp với môi trường tùy chỉnh (như Gym hoặc custom trading env), stream dữ liệu từ Kinesis/Amazon MSK, và tối ưu policy qua algorithms như Proximal Policy Optimization (PPO) hoặc Deep Q-Networks (DQN). Điều này phù hợp hoàn hảo với yêu cầu stream dữ liệu liên tục và tối ưu hóa dài hạn, không cần dữ liệu nhãn cố định.
📘 Tài liệu tham khảo:

🧩 Phân tích tất cả các phương án (đúng/sai):
Dưới đây là phân tích chi tiết từng lựa chọn, giữ nguyên văn bản gốc bằng tiếng Anh. Mỗi phương án được đánh giá dựa trên đặc trưng của bài toán (tương tác môi trường, reward dài hạn, stream dữ liệu không nhãn).

  • ❌ Supervised learning
    Giải thích sai: Supervised learning yêu cầu dữ liệu có nhãn sẵn (labeled data) như cặp input-output (ví dụ: giá cổ phiếu → quyết định mua/bán đúng). Bot trading không có nhãn cố định vì thị trường biến động, quyết định phụ thuộc tương tác thời gian thực và reward dài hạn. Sử dụng supervised sẽ không xử lý được stream dữ liệu liên tục để tự tối ưu profit, dẫn đến overfitting hoặc không thích ứng. AWS SageMaker hỗ trợ supervised (như XGBoost), nhưng không phù hợp đây.

  • ❌ Unsupervised learning
    Giải thích sai: Unsupervised learning chỉ tìm pattern/clustering trong dữ liệu không nhãn (ví dụ: phân nhóm giao dịch tương tự), không học quyết định hành động cụ thể (mua/bán quantity/price) hay tối ưu reward dài hạn. Bot cần agent chủ động tương tác môi trường để nhận feedback profit, unsupervised không hỗ trợ điều này. Trong AWS SageMaker, unsupervised (như K-Means) hữu ích cho anomaly detection nhưng không build trading bot.

  • ❌ Semi-supervised learning
    Giải thích sai: Semi-supervised kết hợp ít dữ liệu nhãn với nhiều dữ liệu không nhãn để cải thiện model, nhưng vẫn dựa trên nhãn cố định và không xử lý reward-based learning từ tương tác động. Bot trading cần học policy tối ưu qua episodes (giao dịch liên tục), không chỉ propagate nhãn. AWS SageMaker hỗ trợ semi-supervised qua AutoML, nhưng không đáp ứng yêu cầu maximize long-term profit qua trial-and-error.

  • ✅ Reinforcement learning
    Giải thích đúng (tóm tắt lại): Như đã phân tích, RL hoàn hảo với Markov Decision Process (MDP): state (thị trường data), action (buy/sell quantity/price), reward (profit). AWS SageMaker RL tích hợp Coach/RLlib, stream từ Amazon Kinesis, và deploy endpoint real-time cho bot. Không phương án nào khác đáp ứng đầy đủ.

🔥 Kết luận: Reinforcement learning là lựa chọn tối ưu cho AWS-based trading bots, đặc biệt với SageMaker Pipelines cho CI/CD DevOps workflow!

Câu 250
A manufacturing company wants to create a machine learning (ML) model to predict when equipment is likely to fail. A data science team already constructed a deep learning model by using TensorFlow and a custom Python script in a local environment. The company wants to use Amazon SageMaker to train the model.

Which TensorFlow estimator configuration will train the model MOST cost-effectively?
  1. A Turn on SageMaker Training Compiler by adding compiler_config=TrainingCompilerConfig() as a parameter. Pass the script to the estimator in the call to the TensorFlow fit() method.
  2. B Turn on SageMaker Training Compiler by adding compiler_config=TrainingCompilerConfig() as a parameter. Turn on managed spot training by setting the use_spot_instances parameter to True. Pass the script to the estimator in the call to the TensorFlow fit() method.
  3. C Adjust the training script to use distributed data parallelism. Specify appropriate values for the distribution parameter. Pass the script to the estimator in the call to the TensorFlow fit() method.
  4. D Turn on SageMaker Training Compiler by adding compiler_config=TrainingCompilerConfig() as a parameter. Set the MaxWaitTimeInSeconds parameter to be equal to the MaxRuntimeInSeconds parameter. Pass the script to the estimator in the call to the TensorFlow fit() method.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi tập trung vào việc tối ưu hóa chi phí (MOST cost-effectively) khi huấn luyện một mô hình deep learning TensorFlow trên Amazon SageMaker. Công ty sản xuất đã xây dựng mô hình bằng TensorFlow và script Python tùy chỉnh trên môi trường local, giờ muốn chuyển sang SageMaker để train.

Mục tiêu chính: Sử dụng TensorFlow estimator (một phần của SageMaker Python SDK) để cấu hình training job sao cho tiết kiệm chi phí nhất. Các yếu tố ảnh hưởng đến chi phí bao gồm:

  • 🛠️ Thời gian training ngắn hơn (giảm billable seconds).
  • 💰 Sử dụng tài nguyên rẻ hơn như Spot instances thay vì On-Demand.
  • ⚡ Tối ưu hóa mô hình mà không cần thay đổi lớn code.

SageMaker hỗ trợ TensorFlow estimator qua sagemaker.tensorflow.TensorFlow, và các tính năng như Training Compiler (tối ưu graph cho TensorFlow, giảm thời gian train lên đến 40-50%) và Managed Spot Training (sử dụng Spot instances, tiết kiệm đến 90% so với On-Demand) là chìa khóa để đạt chi phí thấp nhất (dựa trên tài liệu AWS cập nhật 2024-2026).

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Turn on SageMaker Training Compiler by adding compiler_config=TrainingCompilerConfig() as a parameter. Turn on managed spot training by setting the use_spot_instances parameter to True. Pass the script to the estimator in the call to the TensorFlow fit() method.

Lý do:

  • ✅ Kết hợp tối ưu nhất: Training Compiler giảm thời gian train bằng cách compile graph TensorFlow hiệu quả hơn (hỗ trợ TF 2.x+, cập nhật SageMaker 2024). Managed Spot Training sử dụng Spot instances rẻ hơn, tự động quản lý interruption với checkpointing.
  • 💰 Tiết kiệm cao nhất: Compiler giảm thời gian → ít instance-hours hơn; Spot giảm giá instance → tổng chi phí thấp nhất (có thể >90% savings).
  • 🛠️ Dễ implement: Chỉ thêm 2 tham số vào estimator, không sửa script gốc.
  • Không ảnh hưởng độ chính xác model, phù hợp với script local có sẵn.

📋 Giải thích tất cả các phương án (đúng/sai)

Dưới đây là phân tích từng lựa chọn giữ nguyên văn bản gốc bằng tiếng Anh, với giải thích chi tiết bằng tiếng Việt dựa trên tính năng SageMaker mới nhất (2026):

  • ❌ [SAI] Turn on SageMaker Training Compiler by adding compiler_config=TrainingCompilerConfig() as a parameter. Pass the script to the estimator in the call to the TensorFlow fit() method.
    Chỉ dùng Training Compiler giúp train nhanh hơn (giảm ~40% thời gian), tiết kiệm chi phí phần nào nhờ ít billable time. Nhưng không phải MOST cost-effective vì vẫn dùng On-Demand instances đắt đỏ, không tận dụng Spot để giảm giá instance.

  • ✅ [ĐÚNG] Turn on SageMaker Training Compiler by adding compiler_config=TrainingCompilerConfig() as a parameter. Turn on managed spot training by setting the use_spot_instances parameter to True. Pass the script to the estimator in the call to the TensorFlow fit() method.
    (Như đã giải thích ở trên) Kết hợp Compiler (tối ưu thời gian) + Spot (tối ưu giá) → chi phí thấp nhất, SageMaker tự handle checkpoint/resume cho Spot interruptions.

  • ❌ [SAI] Adjust the training script to use distributed data parallelism. Specify appropriate values for the distribution parameter. Pass the script to the estimator in the call to the TensorFlow fit() method.
    Distributed Data Parallelism (DDP, qua distribution={'mpi': {...}}) scale training multi-instance để nhanh hơn với dataset lớn. Nhưng tốn kém hơn vì cần nhiều instances hơn (scale out), tăng tổng chi phí instance-hours. Không tập trung vào "cost-effectively" mà ưu tiên speed với hardware mạnh, không phù hợp script local đơn giản.

  • ❌ [SAI] Turn on SageMaker Training Compiler by adding compiler_config=TrainingCompilerConfig() as a parameter. Set the MaxWaitTimeInSeconds parameter to be equal to the MaxRuntimeInSeconds parameter. Pass the script to the estimator in the call to the TensorFlow fit() method.
    Compiler tốt, nhưng set MaxWaitTimeInSeconds = MaxRuntimeInSeconds chỉ áp dụng cho Spot training (MaxWait là thời gian chờ Spot availability). Không hiệu quả vì: Spot có thể interrupt bất kỳ lúc nào (không chờ đủ lâu), dẫn đến job fail/restart thường xuyên, tăng chi phí thay vì tiết kiệm. Không kích hoạt Spot thật sự (thiếu use_spot_instances=True).

📘 Tài liệu tham khảo (AWS cập nhật mới nhất 2024-2026)

  • SageMaker Training Compiler: AWS Docs - SageMaker Training Compiler (hỗ trợ TensorFlow 2.15+, giảm latency lên đến 50%).
  • Managed Spot Training: AWS Docs - Managed Spot Training (savings lên đến 90%, tích hợp estimator từ SDK v2.200+).
  • TensorFlow Estimator: SageMaker Python SDK - TensorFlow (code samples với compiler_config và use_spot_instances).
  • Best Practices DOP-C02: AWS Certified DevOps Engineer Professional Exam Guide (2024 edition) nhấn mạnh Spot + Compiler cho ML cost optimization.

Hy vọng phân tích này giúp bạn ôn thi hiệu quả! 🚀 Nếu cần code sample, hãy hỏi thêm.