Skip to content

Commit 6e8ece0

Browse files
authored
doc: update cost (#124)
* doc: update cost * doc: fix complie error
1 parent ca7c404 commit 6e8ece0

File tree

3 files changed

+1170
-1480
lines changed

3 files changed

+1170
-1480
lines changed

docs/en/architecture.md

Lines changed: 31 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -20,69 +20,47 @@ EMD deploys models to AWS using a simple three-step process:
2020

2121
EMD handles all IAM permissions and security configurations automatically.
2222

23-
## Cost Considerations
23+
## Model Deployment Cost Estimation
2424

25-
EMD uses pay-as-you-go AWS services with costs varying based on your deployment choices:
25+
EMD leverages several AWS services to deploy models. Below is an estimated cost breakdown for deploying a single model (assuming a 5GB model file and 10-minute CodeBuild execution).
2626

27-
### Compute Resources (Primary Cost)
27+
### US East (N. Virginia) Region Cost Estimation
2828

29-
| Service | Instance Type | Approx. Cost (US East) | Notes |
30-
|---------|---------------|------------------------|-------|
31-
| EC2 (Default) | g5.xlarge (1 GPU) | $1.006/hour | 4 vCPU, 16GB RAM, 1 NVIDIA A10G GPU |
32-
| EC2 | g5.2xlarge (1 GPU) | $1.212/hour | 8 vCPU, 32GB RAM, 1 NVIDIA A10G GPU |
33-
| EC2 | g5.4xlarge (1 GPU) | $1.624/hour | 16 vCPU, 64GB RAM, 1 NVIDIA A10G GPU |
34-
| SageMaker | ml.g5.xlarge | ~$1.307/hour | ~30% premium over EC2 pricing |
35-
| SageMaker | ml.g5.2xlarge | ~$1.575/hour | ~30% premium over EC2 pricing |
29+
| Service | Usage | Estimated Cost (USD) | Notes |
30+
|---------|-------|----------------------|-------|
31+
| **S3 Storage** | 5GB model file | $0.00/month | $0.023 per GB-month for standard storage. Free tier includes 5GB of S3 standard storage for 12 months |
32+
| **CodeBuild** | BUILD_GENERAL1_LARGE for 10 minutes | $0.10 | $0.005 per build-minute |
33+
| **CodePipeline** | 1 pipeline execution | $0.00 | First pipeline is free, then $1.00 per active pipeline/month |
34+
| **CloudFormation** | Stack creation | $0.00 | No charge for CloudFormation service |
35+
| **ECR** | ~2GB Docker image | $0.10/month | $0.10 per GB-month for private repository storage |
36+
| **Total Deployment Cost** | | **$0.10** + $0.10/month | One-time deployment cost + monthly storage |
3637

37-
* Costs increase with:
38-
* Larger models requiring more memory
39-
* Higher throughput requirements needing more vCPUs
40-
* Longer running deployments (24/7 vs. on-demand)
38+
#### Target Service Costs (Post-Deployment)
4139

42-
### Storage Costs
40+
- **SageMaker**: ml.g4dn.xlarge: ~$0.736/hour
41+
- **EC2**: g4dn.xlarge: ~$0.526/hour
42+
- **ECS**: Fargate or EC2 costs for container hosting
43+
- **Secrets Manager**: $0.40/month for API key storage
4344

44-
| Service | Component | Approx. Cost | Notes |
45-
|---------|-----------|--------------|-------|
46-
| ECR | Container Storage | $0.10/GB-month | Model containers can range from 5GB to 50GB+ |
47-
| S3 | Model Artifacts | $0.023/GB-month | Large models can be several GB each |
48-
| EBS | EC2 Instance Storage | $0.10/GB-month | Default 150GB gp2 volume for EC2 instances |
45+
### China North (Beijing) Region Cost Estimation
4946

50-
### Networking Costs
47+
| Service | Usage | Estimated Cost (CNY) | Notes |
48+
|---------|-------|----------------------|-------|
49+
| **S3 Storage** | 5GB model file | ¥0.00/month | ¥0.21 per GB-month for standard storage. Free tier includes 5GB of S3 standard storage for 12 months (verify availability in China regions) |
50+
| **CodeBuild** | BUILD_GENERAL1_LARGE for 10 minutes | ¥0.80 | ¥0.08 per build-minute |
51+
| **CodePipeline** | 1 pipeline execution | ¥0.00 | First pipeline is free, then ¥7.00 per active pipeline/month |
52+
| **CloudFormation** | Stack creation | ¥0.00 | No charge for CloudFormation service |
53+
| **ECR** | ~2GB Docker image | ¥0.84/month | ¥0.42 per GB-month for private repository storage |
54+
| **Total Deployment Cost** | | **¥0.80** + ¥0.84/month | One-time deployment cost + monthly storage |
5155

52-
| Component | Approx. Cost | Notes |
53-
|-----------|--------------|-------|
54-
| Load Balancer | $0.0225/hour + $0.008/GB | Required for API access |
55-
| Data Transfer Out | $0.09/GB | Costs for responses from model API |
56-
| VPC Endpoints | $0.01/hour | Optional for enhanced security |
56+
#### Target Service Costs (Post-Deployment)
5757

58-
### Pipeline Execution Costs
58+
- **SageMaker**: ml.g4dn.xlarge: ~¥6.18/hour
59+
- **EC2**: g4dn.xlarge: ~¥4.42/hour
60+
- **ECS**: Fargate or EC2 costs for container hosting
61+
- **Secrets Manager**: ¥3.36/month for API key storage
5962

60-
| Service | Component | Approx. Cost | Notes |
61-
|---------|-----------|--------------|-------|
62-
| CodeBuild | BUILD_GENERAL1_LARGE | $0.10/minute | Used during model building phase |
63-
| CodePipeline | Pipeline Execution | $1.00/pipeline/month | Plus $0.01 per pipeline execution |
64-
65-
### Cost Optimization Strategies
66-
67-
1. **Right-size your instances**:
68-
* Match instance type to your model's memory and compute requirements
69-
* Consider CPU-only instances for smaller models
70-
71-
2. **Use auto-scaling**:
72-
* Set appropriate min/max capacity values
73-
* Configure scale-in periods during low usage times
74-
75-
3. **Implement lifecycle policies**:
76-
* Clean up unused ECR images
77-
* Remove old model artifacts from S3
78-
79-
4. **Consider Spot instances**:
80-
* Use EC2 Spot instances for non-critical workloads
81-
* Can reduce costs by up to 70% compared to On-Demand pricing
82-
83-
5. **Monitor and analyze costs**:
84-
* Use AWS Cost Explorer to identify cost drivers
85-
* Set up AWS Budgets to alert on unexpected spending
63+
> **Note**: All prices are estimates as of 2024. Actual costs may vary based on your specific AWS region, usage patterns, and any applicable discounts. We recommend using AWS Cost Explorer to monitor and forecast your actual costs.
8664
8765
## Security Considerations
8866

0 commit comments

Comments
 (0)