[AWS] Amazon SageMaker
정의
Amazon SageMaker 는 AWS 의 엔드투엔드 머신러닝 플랫폼 입니다. 데이터 준비, 라벨링, 학습, 튜닝, 배포, 모니터링, MLOps 파이프라인을 한 콘솔/SDK 에서 다룹니다. 2017년 출시 후 여러 서비스 (Ground Truth, JumpStart, Pipelines, Model Monitor, HyperPod, Unified Studio 등) 로 팽창했습니다.
Amazon Bedrock 과의 관계: Bedrock 은 관리형 파운데이션 모델 API, SageMaker 는 자체 모델 학습/배포 플랫폼. 모델을 직접 학습/파인튜닝/배포 하려면 SageMaker 를 씁니다.
핵심 도메인 (2026 기준)
SageMaker Unified Studio (2024~)
re:Invent 2024 에서 발표된 통합 IDE. 기존 SageMaker Studio, SageMaker Notebooks, Data Wrangler, Bedrock Studio 를 하나로 통합. 프로젝트 단위로 데이터 카탈로그 (DataZone), 코드, 모델, 파이프라인을 관리.
SageMaker AI vs SageMaker Data 분리 (2024~)
Unified Studio 안에서 두 개의 큰 도메인:
- SageMaker AI (기존 SageMaker): 모델 학습/배포/파이프라인
- SageMaker Data / Lakehouse: DataZone + Athena + Redshift 통합 데이터 카탈로그/거버넌스
학습 (Training)
Managed Training Jobs
컨테이너 이미지 + 학습 스크립트 + 데이터 위치를 지정하면 SageMaker 가 인스턴스를 프로비저닝, 학습 실행, 결과를 S3 에 저장하고 인스턴스를 종료.
from sagemaker.pytorch import PyTorch
estimator = PyTorch(
entry_point="train.py",
source_dir="./src",
role="arn:aws:iam::...:role/SageMakerRole",
instance_type="ml.p4d.24xlarge", # 8x A100
instance_count=4,
framework_version="2.1",
py_version="py310",
hyperparameters={"epochs": 30, "lr": 1e-4},
max_run=86400,
use_spot_instances=True,
max_wait=90000,
)
estimator.fit({
"training": "s3://bucket/train/",
"validation": "s3://bucket/val/",
})
인스턴스 유형
- CPU: ml.m/c 시리즈, ml.g (GPU 소형)
- GPU: ml.g5 (A10G), ml.p4d (A100), ml.p5 (H100), ml.p5e/p5en (H200)
- Trainium / Inferentia: AWS 자체 AI 가속기 (Trn1, Inf2)
Distributed Training
- Data parallel (SMDDP): 모델은 각 노드에 동일, 데이터를 나눔
- Model parallel (SMMP): 모델을 여러 GPU 에 분산 (수십억~수천억 파라미터)
- PyTorch FSDP / DeepSpeed / Megatron-LM 이 기본 지원
SageMaker HyperPod
초대형 학습 (수백~수천 GPU) 용 지속적 컴퓨트 클러스터. 노드 장애 시 자동 replace, 학습이 checkpoint 에서 재개. FSx for Lustre 통합. 학습 job 이 아니라 클러스터 자체를 프로비저닝하는 모델.
배포 (Inference)
Real-time Endpoint
HTTPS endpoint 로 서빙. Auto scaling, multi-model endpoint, shadow variant 지원.
predictor = estimator.deploy(
instance_type="ml.g5.xlarge",
initial_instance_count=2,
endpoint_name="my-model-prod",
)
result = predictor.predict({"inputs": "..."})
Serverless Inference
인스턴스 없이 자동 스케일링. 콜드스타트 tradeoff, 스파이키 워크로드 유리.
Async Inference
큰 입력 (수 MB~1 GB) / 긴 처리 (수분) 워크로드. S3 에서 input, S3 로 output.
Batch Transform
정해진 데이터셋 배치 처리. 인스턴스는 job 동안만 활성.
Multi-Model Endpoint (MME)
한 endpoint 에 여러 모델을 hot swap. 모델 수 많고 요청 sparse 할 때 비용 절감.
Inference Recommender
목표 latency/throughput/cost 를 넣으면 최적 인스턴스 타입 + 개수 추천. A/B 시나리오 자동 벤치마크.
SageMaker JumpStart
사전 학습 파운데이션 모델 카탈로그. Llama, Falcon, Mistral, DeepSeek 등 오픈 웨이트를 few-click 으로 endpoint 배포. 파인튜닝 도 UI/SDK 로 실행.
from sagemaker.jumpstart.model import JumpStartModel
model = JumpStartModel(model_id="meta-textgeneration-llama-3-3-70b-instruct")
predictor = model.deploy()
resp = predictor.predict({
"inputs": "Explain kubernetes in 3 sentences.",
"parameters": {"max_new_tokens": 200}
})
- 파운데이션 모델 + task-specific 모델 (분류, 회귀, 시계열, CV) 다수
- 학습된 결과물은 자기 계정에 저장, 자체 endpoint 로 배포
- Bedrock 은 관리형 API 호출, JumpStart 는 자체 배포 (트레이드오프 다름)
Pipelines
SageMaker Pipelines 는 ML 워크플로 DAG. 스텝 유형: Processing, Training, Tuning, Model, Transform, Condition, Callback, Lambda, EMR, Notebook, ClarifyCheck, Fail.
from sagemaker.workflow.pipeline import Pipeline
from sagemaker.workflow.steps import ProcessingStep, TrainingStep
pipeline = Pipeline(
name="training-pipeline",
steps=[preprocess_step, training_step, evaluation_step, register_step],
parameters=[processing_instance_count, training_epochs],
)
pipeline.upsert(role_arn=role)
execution = pipeline.start()
- Model Registry 통합 (approval workflow)
- EventBridge 로 스케줄/이벤트 트리거
- Studio 안에서 시각화 및 재실행
데이터
Ground Truth
라벨링. 사람 라벨러 (Mechanical Turk, 자체 팀) 또는 auto-labeling (active learning). 이미지, 텍스트, 3D 포인트클라우드, 비디오 지원.
Data Wrangler
Studio 안 GUI 로 300+ 데이터 변환 (imputation, feature engineering, aggregation). Recipe 로 파이프라인 export.
Feature Store
관리형 온라인/오프라인 피처 저장소. 학습-서빙 skew 방지. Redis 온라인 + S3 오프라인 이중 구조.
Clarify
편향 (bias) 및 설명가능성 (SHAP). 학습 전후 편향 리포트, Model Monitor 와 연계해 프로덕션 감사.
MLOps
Experiments
학습 run 을 추적. 파라미터, 메트릭, 아티팩트, 모델 lineage. Studio 안 UI 로 시각적 비교.
Model Registry
승인 워크플로. PendingManualApproval -> Approved -> production endpoint 로 승격. 감사/컴플라이언스 트래일.
Model Monitor
배포된 endpoint 의 입력/출력을 캡처해 데이터 드리프트, 품질 drift, 편향 drift 를 감지.
주의: SageMaker Model Monitor 는 2026-07-30 부로 신규 고객 접근 종료. 기존 고객만 계속 사용 가능하며 신규 기능은 없습니다. 해당 위키 참조.
Debugger / Profiler
학습 job 실시간 텐서 캡처, GPU/CPU 프로파일, 자동 이상 감지 (NaN, exploding gradient, dead ReLU).
인프라 통합
- Networking: VPC endpoint 로 인터넷 우회, PrivateLink, KMS 암호화
- IAM: SageMaker Execution Role, cross-account resource share, Studio user-role
- CloudWatch: 학습/추론 로그 및 커스텀 메트릭
- CloudTrail: API audit
- EventBridge: pipeline 트리거
SageMaker Studio Notebooks
관리형 JupyterLab. 인스턴스 kernel 을 hot swap. 최근에는 Code Editor (VS Code) 도 제공. Data Wrangler / Feature Store / JumpStart 가 사이드바 통합.
요금 모델
축이 여럿:
- 학습: 인스턴스 시간당 (spot 최대 90% 절감)
- 엔드포인트: 인스턴스 시간당 (real-time 은 24/7 청구, serverless 는 request 당)
- 배치 transform: job 시간
- Studio: notebook 인스턴스 시간
- HyperPod: 클러스터 시간 (지속)
- Ground Truth: 라벨당
- Model Monitor: 인스턴스 시간
- Storage (Model artifacts): S3 표준
- Pipelines: 스텝은 각자 요금
Idle endpoint 요금 방심 금지. Real-time endpoint 를 켜 두고 잊으면 계정 요금이 폭발합니다.
SageMaker vs Bedrock 결정 가이드
| 상황 | 권장 |
|---|---|
| 앱에 LLM 호출만 필요 | Bedrock |
| 파인튜닝 없이 즉시 시작 | Bedrock |
| 자체 모델 학습 (분류/CV/시계열) | SageMaker |
| 오픈 웨이트 LLM 을 자체 endpoint 로 | SageMaker JumpStart |
| 파운데이션 모델 파인튜닝 | 소규모: Bedrock, 대규모: SageMaker HyperPod |
| RAG 앱 | Bedrock Managed Knowledge Base |
| 학습 파이프라인 관리 | SageMaker Pipelines |
| 데이터 라벨링 | SageMaker Ground Truth |
| 팀 협업 IDE | SageMaker Unified Studio |
함정
WARNING
Real-time endpoint idle 요금이 가장 흔한 SageMaker 요금 사고. dev/stg endpoint 를 잊으면 인스턴스 시간이 24/7 청구. 사용 안 하면 반드시 delete.
CAUTION
JumpStart 파운데이션 모델은 라이선스 확인 필수. 상업 이용, 결과물 배포권이 모델별로 다름. Llama Community License 등 서명 필요한 것도 있음.
WARNING
HyperPod 는 지속 클러스터. 학습이 없어도 노드 요금 청구. Auto-resume 이점과 유휴 비용을 함께 고려.
IMPORTANT
SageMaker Studio Domain 은 계정당 규정된 개수 상한. 여러 팀이 각자 domain 을 원하면 사전 quotas 확인.
CAUTION
모델 아티팩트 (S3) 를 지우면 endpoint 재배포 불가. Registry 에 등록된 model 도 아티팩트가 실체. Lifecycle 정책 신중히.
관련 위키
- Bedrock - 관리형 파운데이션 모델 API
- SageMaker Model Monitor - 배포 모니터링 (deprecated for new customers)
- S3 - 학습 데이터/모델 아티팩트 저장
- S3 Vectors - Unified Studio 벡터 저장
- IAM - Execution role, cross-account
- CloudWatch - 학습/엔드포인트 로그
- KMS - 저장 암호화
- 분류 모델 지표 - 학습 평가
- Transfer Learning - JumpStart 파인튜닝 근본 개념
- Federated Learning - 분산 학습 대안
- HELM - JumpStart LLM 평가
이 글의 용어 (11개)
- [AWS SageMaker] Model Monitor: 모델 및 데이터 드리프트 감지ml
- [!WARNING] AWS 공식 발표 (2026): 2026-07-30 부터 SageMaker Model Monitor 는 신규 고객 사용이 중단됩니다. 기존 사용 고객은 계속 …
- [AWS] Amazon Bedrockcloud
- 정의 Amazon Bedrock 은 여러 제공사의 파운데이션 모델 (foundation model) 을 단일 API 로 호출할 수 있게 하는 AWS 의 관리형 서비스입니다. 20…
- [AWS] CloudWatch: 메트릭, 로그, 알람cloud
- 정의 CloudWatch = AWS 의 모니터링 + 로그 + 알람 통합 서비스. 메트릭 수집, 로그 집계, 대시보드, 알람, 이상 감지를 하나의 서비스에서 제공. 사용 상황 | …
- [AWS] IAM: User, Role, Policy, STScloud
- 정의 IAM (Identity and Access Management) = AWS 의 권한 관리 전부. User, Group, Role, Policy 로 구성. "누가 어떤 리소…
- [AWS] KMS: 암호화 키 관리, envelope encryptioncloud
- 정의 KMS (Key Management Service) = 암호화 키 중앙 관리. envelope encryption + IAM 통합 + 감사 로그. 키 종류 | 종류 | 의미…
- [AWS] S3 Vectorscloud
- 정의 Amazon S3 Vectors 는 벡터 임베딩을 저비용, 대용량, 서버리스 로 저장하고 쿼리하기 위한 S3 의 새 버킷 유형입니다. 2024년 7월 preview, 202…
- [AWS] S3: object storage, storage classes, lifecyclecloud
- 정의 S3 = AWS 의 object storage. bucket + key + object. 11 9's durability (99.999999999%), 무한 확장. 2026…
- [LLM Eval] HELM: Holistic Evaluation of Language Modelsai
- 정의 HELM (Holistic Evaluation of Language Models) 는 Stanford CRFM (Center for Research on Foundation…
- 분류 모델 지표: Confusion Matrix, Precision, Recall, F1ml
- 정의 분류 (classification) 모델의 성능을 정량화하는 지표들입니다. 이진 분류를 기준으로 하며, multi-class 로 확장하는 방법도 함께 다룹니다. 핵심 출발점…
- Federated Learning: 분산 학습 without central dataml
- 정의 Federated Learning (FL) 은 데이터를 중앙에 모으지 않고 각 클라이언트 (edge device, 병원, 은행 등) 가 로컬 데이터로 모델을 학습한 뒤 모델…
- Transfer Learning: pre-training, fine-tuning, domain adaptationml
- 정의 Transfer Learning 은 source task/domain 에서 학습한 지식을 target task/domain 에 재사용 하여 학습 효율을 높이는 패러다임입니다…
💬 댓글