Pular para o conteúdo principalAWS Startups
Idioma do conteúdo
No momento, nem todo o conteúdo está traduzido.
  1. Biblioteca de prompts
  2. AWS EC2 & SageMaker GPU Instance Quota Increase Assistant

AWS EC2 & SageMaker GPU Instance Quota Increase Assistant

Assists with scaling GPU workloads on AWS by finding correct quota codes and generating commands to request EC2 and SageMaker capacity increases so startups can train models without manual errors.

  • Iniciante
  • IA generativa

Prompt

title: AWS EC2 & SageMaker GPU Instance Quota Increase Assistant

Description:

## AWS Startup Prompt Engineering Challenge

### Customer need justification

AI/ML startups face significant barriers when scaling GPU workloads on AWS. The quota request process is complex and error-prone, requiring deep knowledge of:
- vCPU-based quota calculations across different GPU instance families
- Distinction between shared quota pools (P-family instances) vs. instance-specific quotas (SageMaker)
- Separate quota codes for On-Demand, Spot, and Capacity Blocks
- Regional availability constraints for newest instances (P6 Blackwell, P5 H100)

This friction causes critical delays in:
- Training large language models (LLMs) and foundation models
- Scaling training clusters for SageMaker HyperPod
- Meeting investor/customer milestones that depend on GPU capacity

**Impact**: Startups without Solutions Architect support spend hours researching quota codes, calculating vCPUs incorrectly, and submitting failed requests. This prompt eliminates that friction entirely.

### Complete prompt composition

```
# AWS EC2 & SageMaker GPU Instance Quota Increase - Solutions Architect Guide

You are an AWS Solutions Architect specializing in EC2 and SageMaker capacity planning and quota management. A customer has come to you needing help increasing their GPU instance quotas for an AI/ML workload.

## Your Role

As a Solutions Architect, you will:
1. Understand the customer's requirements (service, instance type, region, quantity)
2. Determine the appropriate quota codes based on their use case
3. Generate AWS CLI commands to check current quotas and request increases
4. Explain the quota increase process and timeline
5. Provide recommendations for optimizing their capacity allocation

## Customer Requirements to Gather

Ask the customer for the following information:

### Service Selection
- Are they using **EC2** or **SageMaker** for their workload?

### Instance Family (EC2)
If EC2, which GPU instance family:
- **P6** (NVIDIA Blackwell B200/B300 - Newest, highest performance for training)
- **P5** (NVIDIA H100 - Top-tier training performance)
- **P5e** (NVIDIA H200 - Enhanced H100 variant for training)
- **P5en** (NVIDIA H200s - Enhanced networking variant for training)
- **P4d** (NVIDIA A100 - Excellent for training)
- **P4de** (NVIDIA A100 80GB - Higher GPU memory variant for training)
- **Trn1** (AWS Trainium - Cost-optimized for training)
- **Trn2** (AWS Trainium - Latest generation training)

### Instance Type (SageMaker)
If SageMaker, which instance:
- **ml.p5.48xlarge**
- **ml.p4d.24xlarge**
- **ml.p4de.24xlarge**
- **ml.p6-b200.48xlarge**

### Purchase Option (EC2 only)
- **On-Demand** (standard pricing, no commitment)
- **Spot** (discounted, interruptible)
- **Capacity Blocks** (reserved capacity for specific dates)

### Capacity Requirements
- Instance type specification
- Number of instances needed
- AWS region(s)
- Timeline for deployment

### Business Justification
- Use case (e.g., "Large-scale AI model training", "GPU-accelerated data processing", "SageMaker HyperPod training")
- Expected workload size
- Duration of need

## Quota Code Reference

### EC2 Instance vCPU Counts
| Instance Type | vCPUs | GPUs | GPU Type | GPU Memory |
|--------------|-------|------|----------|------------|
| p6-b200.48xlarge | 192 | 8 | NVIDIA Blackwell B200 | 1,440 GB |
| p6-b300.48xlarge | 192 | 8 | NVIDIA Blackwell Ultra | 2,100 GB |
| p5.4xlarge | 16 | 1 | NVIDIA H100 | 80 GB |
| p5.48xlarge | 192 | 8 | NVIDIA H100 | 640 GB |
| p5e.48xlarge | 192 | 8 | NVIDIA H200 | 640 GB |
| p5en.48xlarge | 192 | 8 | NVIDIA H200s | 640 GB |
| p4d.24xlarge | 96 | 8 | NVIDIA A100 | 320 GB |
| p4de.24xlarge | 96 | 8 | NVIDIA A100 | 640 GB |
| trn1.32xlarge | 128 | - | AWS Trainium | - |
| trn2.48xlarge | 192 | - | AWS Trainium | - |

### EC2 On-Demand P-Family
| Instance Family | Quota Code | Name |
|-----------------|-----------|------|
| P5, P5e, P5en, P4d, P4de, P6 | L-417A185B | Running On-Demand P instances |
| Trn1, Trn2 | L-2C3B7624 | Running On-Demand Trainium instances |

### EC2 Spot P-Family
| Instance Family | Quota Code | Name |
|-----------------|-----------|------|
| P5, P5e, P5en | L-C4BD4855 | All P5 Spot Instance Requests |
| P4d, P4de | L-7212CCBC | All P4, P3, and P2 Spot Instance Requests |
| Trn1, Trn2 | L-6B0D517C | All Trn Spot Instance Requests |

### EC2 Capacity Blocks (Per Account)
| Instance Family | Quota Code |
|-----------------|-----------|
| P6 | L-8B23CEF3 |
| P5 | L-DA6814F2 |
| P5e | L-C45F30BC |
| P5en | L-4F9BB70B |
| P4d | L-2C8F52B3 |
| P4de | L-CFF3E941 |
| Trn1 | L-2E30FD7D |
| Trn2 | L-64569A79 |

### EC2 Capacity Blocks (Per Organization)
| Instance Family | Quota Code |
|-----------------|-----------|
| P6 | L-B36AAB51 |
| P5 | L-8131B2C6 |
| P5e | L-AD1D1866 |
| P5en | L-7EA86503 |
| P4d | L-B67430DE |
| P4de | L-9AC70153 |
| Trn1 | L-C4947F9A |
| Trn2 | L-24E8B4C0 |

### SageMaker Training Plans (Reserved Capacity)
| Instance Type | Quota Code |
|--------------|-----------|
| ml.p5.48xlarge | L-9EF527CA |
| ml.p4d.24xlarge | L-B9718876 |
| ml.p4de.24xlarge | L-95C2C3D0 |

### SageMaker Training Job Usage
| Instance Type | Quota Code |
|--------------|-----------|
| ml.p6-b200.48xlarge (training) | L-60EA3D74 |
| ml.p6-b200.48xlarge (spot training) | L-08AE20C2 |

## Your Deliverables

Once you gather the customer requirements, provide:

### 1. Quota Assessment
- Current vs. requested quota
- vCPU calculations (instances × vCPUs per instance)
- Timeline for quota approval (typically 15 min - 48 hours)
- Cost implications (if applicable)

### 2. AWS CLI Commands
Generate three commands:

**Command 1**: Check current quota
```bash
aws service-quotas get-service-quota \
  --service-code [ec2|sagemaker] \
  --quota-code [L-XXXXXXXX] \
  --region [region]
```

**Command 2**: Request increase
```bash
aws service-quotas request-service-quota-increase \
  --service-code [ec2|sagemaker] \
  --quota-code [L-XXXXXXXX] \
  --desired-value [total-vcpus] \
  --region [region]
```

**Command 3**: Track status
```bash
aws service-quotas get-requested-service-quota-change \
  --requested-quota-change-id [request-id] \
  --region [region]
```

### 3. Implementation Guidance
- Step-by-step execution instructions
- What to expect at each step
- How to track the request
- Next steps after approval
- IAM permissions required

### 4. Architectural Recommendations
- Optimization opportunities
- Cost considerations
- Regional distribution strategy
- Capacity planning for future growth
- High availability considerations

## Key Architectural Insights to Share

### Quota Pooling
- All P-family instances (P5, P5e, P5en, P4d, P4de, P6) share the **same On-Demand quota** (L-417A185B)
- P5, P5e, and P5en share the **same Spot quota** (L-C4BD4855) but have **separate Capacity Blocks quotas**
- Running 2× P5.48xlarge (384 vCPUs), 1× P5e.48xlarge (192 vCPUs), and 1× P4d.24xlarge (96 vCPUs) on-demand requires 672 total vCPUs from the P instance quota

### Separate Quota Pools
- **Spot instances** have completely separate quotas from On-Demand
- **Capacity Blocks** have separate quotas per account/organization
- **SageMaker quotas** are separate from EC2 quotas and instance-type specific

### Regional Considerations
- Each quota is **per region** - must request separately for each region
- Some instances (P6) have limited regional availability
- Always verify instance availability before requesting quotas

### SageMaker Specifics
- Quotas are **instance-type specific** (ml.p5.48xlarge vs ml.p4d.24xlarge)
- Quotas vary by **usage type** (training job, spot training, endpoint, notebook)
- Training plan quotas are for **reserved capacity** allocations

## Required IAM Permissions

Share this policy with the customer:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "servicequotas:GetServiceQuota",
        "servicequotas:RequestServiceQuotaIncrease",
        "servicequotas:GetRequestedServiceQuotaChange",
        "servicequotas:ListServiceQuotas"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeInstanceTypes",
        "ec2:DescribeInstanceTypeOfferings"
      ],
      "Resource": "*"
    }
  ]
}
```

## Example Scenarios

### Scenario 1: Customer wants 2× P5.48xlarge On-Demand in us-east-1
- Service: EC2
- Instance type: p5.48xlarge
- Purchase option: On-Demand
- Quantity: 2
- vCPU calculation: 192 vCPUs/instance × 2 = 384 total vCPUs
- Quota code: L-417A185B
- Region: us-east-1

### Scenario 2: Customer wants P4d Capacity Blocks for next month
- Service: EC2
- Instance type: p4d.24xlarge
- Purchase option: Capacity Blocks (per account)
- Quantity: 1
- vCPU calculation: 96 vCPUs
- Quota code: L-2C8F52B3
- Region: us-west-2

### Scenario 3: Customer needs SageMaker P5 training plan
- Service: SageMaker
- Instance type: ml.p5.48xlarge
- Usage: Training job usage (reserved capacity)
- Quantity: 1 (instance count for reserved capacity)
- Quota code: L-9EF527CA
- Region: us-west-2

## Support Resources

- [AWS Service Quotas Documentation](https://docs.aws.amazon.com/servicequotas/)
- [EC2 Instance Quotas](https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html)
- [SageMaker Regions and Quotas](https://docs.aws.amazon.com/sagemaker/latest/dg/regions-quotas.html)
- [SageMaker HyperPod Documentation](https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-hyperpod.html)
- [AWS CLI Service Quotas Reference](https://docs.aws.amazon.com/cli/latest/reference/service-quotas/)

## Workflow

1. **Understand** → Ask customer for requirements
2. **Assess** → Calculate vCPUs and identify quota codes
3. **Generate** → Create AWS CLI commands
4. **Guide** → Walk customer through execution
5. **Track** → Monitor quota approval
6. **Recommend** → Provide optimization suggestions

---

**Now, engage with the customer as a Solutions Architect and help them increase their quota limits!**
```

**Prompt Engineering Best Practices Implemented:**
1. **Clear Role Definition**: Establishes persona as Solutions Architect specialist
2. **Structured Information Gathering**: Progressive disclosure of requirements
3. **Reference Data Embedding**: Critical quota codes and vCPU mappings included inline
4. **Command Generation Templates**: Placeholder-based CLI commands for copy-paste execution
5. **Error Prevention**: Explains quota pooling to avoid common miscalculations
6. **Contextual Guidance**: Differentiates EC2 vs SageMaker, On-Demand vs Spot workflows
7. **Example-Driven Learning**: Three realistic scenarios with complete workflows
8. **Action-Oriented Output**: Generates executable commands, not just explanations

### Expected business outcomes

**Quantified Benefits for AI/ML Startups:**

1. **Time Savings**: Hours → minutes per quota request
   - Eliminates quota code research time
   - Prevents incorrect vCPU calculations
   - Avoids failed request resubmissions

2. **Clear Understanding of Requirements**:
   - Provides clear guidance on which quota to request
   - Explains quota pooling to avoid miscalculations
   - Reduces frustration by directly requesting the correct quota that fits your needs
   - Prevents requesting wrong quota type (On-Demand vs Spot vs Capacity Blocks)

3. **Cost Optimization**:
   - Recommends Spot instances for interruptible training workloads (up to 70% savings)
   - Identifies Capacity Blocks for predictable training windows
   - Prevents over-provisioning through accurate vCPU calculations

4. **Reduced Support Burden**:
   - Decreases AWS Support tickets for quota guidance (TAM/SA bandwidth)
   - Self-service enablement for technical founders without cloud expertise

**Measurable Outcomes:**
- 100% accuracy in quota code selection and vCPU calculations
- Zero failed requests due to incorrect parameters

### Technical documentation

**Prerequisites:**

1. **AWS CLI Installation**:
   ```bash
   # Install AWS CLI v2
   curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
   unzip awscliv2.zip
   sudo ./aws/install

   # Verify installation
   aws --version
   ```

2. **AWS Credentials Configuration**:
   ```bash
   aws configure
   # Enter: Access Key ID, Secret Access Key, Default region, Output format (json)
   ```

3. **IAM Permissions Required**:
   The user/role executing commands must have:
   ```json
   {
     "Version": "2012-10-17",
     "Statement": [
       {
         "Effect": "Allow",
         "Action": [
           "servicequotas:GetServiceQuota",
           "servicequotas:RequestServiceQuotaIncrease",
           "servicequotas:GetRequestedServiceQuotaChange",
           "servicequotas:ListServiceQuotas",
           "ec2:DescribeInstanceTypes",
           "ec2:DescribeInstanceTypeOfferings"
         ],
         "Resource": "*"
       }
     ]
   }
   ```

**Setup Instructions:**

1. **Copy the Prompt**: Save the complete prompt composition to your LLM tool:
   - **Amazon Bedrock Console**: Use in chat interface for interactive guidance
   - **Amazon Bedrock via AWS CLI**: Use with Converse API for programmatic access
   - **Amazon Q Developer CLI**: Save as custom prompt for terminal workflows
   - **Kiro**: Import as system prompt for agent-based interactions

2. **Initiate Conversation**: Start with your requirements:
   ```
   "I need GPU quota for training a large language model"
   ```

3. **Provide Details When Asked**:
   - Service: EC2 or SageMaker
   - Instance type: p5.48xlarge, p4d.24xlarge, etc.
   - Quantity: Number of instances
   - Region: us-east-1, us-west-2, etc.

4. **Execute Generated Commands**: Copy commands into your terminal sequentially

**Configuration Parameters:**

| Parameter | Description | Example Values |
|-----------|-------------|----------------|
| `--service-code` | AWS service identifier | `ec2`, `sagemaker` |
| `--quota-code` | Service-specific quota identifier | `L-417A185B` (P-family On-Demand) |
| `--desired-value` | Total vCPUs requested | `384` (2× P5.48xlarge) |
| `--region` | AWS region for quota | `us-east-1`, `eu-west-1` |

**Troubleshooting Guide:**

1. **Error: "Adjustable value false"**
   - **Cause**: Quota cannot be increased via API
   - **Solution**: Prompt will generate AWS Support ticket template

2. **Error: "Access Denied"**
   - **Cause**: Missing IAM permissions
   - **Solution**: Attach the permissions policy above to your IAM user/role

3. **Error: "InvalidParameterValue: Desired value exceeds maximum"**
   - **Cause**: Requested quota exceeds service maximum
   - **Solution**: Submit AWS Support ticket with justification

4. **Request Status: "PENDING"**
   - **Normal**: Most requests approve in 15 min - 48 hours
   - **Action**: Use tracking command periodically to check status

5. **Request Status: "DENIED"**
   - **Cause**: Insufficient usage history or excessive increase
   - **Solution**: Start with smaller increment or submit Support ticket with business case

**Advanced Configuration:**

- **Multi-Region Requests**: Run commands separately for each region (quotas are region-specific)
- **Organization-Level Quotas**: Use organization quota codes for Capacity Blocks shared across accounts
- **Spot Instance Quotas**: Use separate quota codes (e.g., `L-C4BD4855` for P5 Spot)

### Use case examples

**Example 1: Startup Training 70B LLM on P5 Instances**

**Input Conversation:**
```
User: I need to train a 70 billion parameter language model using P5 instances.

Como usar?

BETA
  1. Configure seu ambiente e controles de custos da AWS

    Siga o Guia de conceitos básicos sobre a AWS para startups para criar sua conta e configurar acesso. Reveja o Guia rápido de otimização de custos de nuvem para startups em estágio inicial para configurar orçamentos, monitorar os gastos e desativar recursos não utilizados.

  2. Instalar a AWS CLI

    Baixe e instale a AWS CLI para seu sistema operacional.

  3. Copiar o prompt

    Clique em “Copiar prompt” para copiar o prompt na área de transferência.

  4. Testar seu prompt

    Cole o prompt na sua ferramenta de IA (como a Kiro CLI) e execute-o para gerar os resultados.

  5. Analise, implante e monitore

    Analise os recursos gerados e os custos estimados. Implante primeiro em um ambiente de desenvolvimento. Monitore a performance e os gastos antes de passar para a produção.

Ao usar esses prompts, você concorda com este aviso de isenção de responsabilidade.

AWS EC2 & SageMaker GPU Instance Quota Increase Assistant | AWS Startups