Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@
/* Header styling */
header {
background-color: white;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* shadow-sm */

box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
position: sticky;
top: 0;
z-index: 50;
}

/* Preserving your existing typography */
h1 {
font-size: 1.875rem; /* text-3xl */
font-weight: 700; /* font-bold */
color: #111827; /* text-gray-900 */
font-size: 1.875rem;
font-weight: 700;
color: #111827;
}

h2 {
font-size: 1.5rem; /* text-2xl */
font-weight: 700; /* font-bold */
font-size: 1.5rem;
font-weight: 700;
color: #111827;
}

Expand All @@ -48,6 +48,6 @@ h3 {
}

p {
font-size: 0.875rem; /* Tailwind's text-sm */
color: #4b5563; /* Tailwind's gray-600 */
font-size: 0.875rem;
color: #4b5563;
}
40 changes: 30 additions & 10 deletions doc/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@ This guide will help you get started with the SageMaker HyperPod CLI and SDK to

List all available SageMaker HyperPod clusters in your account:

**CLI**
`````{tab-set}
````{tab-item} CLI
```bash
hyp list-cluster [--region <region>] [--namespace <namespace>] [--output <json|table>]
```
````

**SDK**
````{tab-item} SDK
```python
from sagemaker.hyperpod.hyperpod_manager import HyperPodManager

clusters = HyperPodManager.list_clusters(region='us-east-2')
print(clusters)
```
````
`````

**Parameters:**
- `region` (string) - Optional. The AWS region where the SageMaker HyperPod and EKS clusters are located. If not specified, uses the region from your current AWS account credentials.
Expand All @@ -32,17 +36,21 @@ print(clusters)

Configure your local kubectl environment to interact with a specific SageMaker HyperPod cluster and namespace:

**CLI**
`````{tab-set}
````{tab-item} CLI
```bash
hyp set-cluster-context --cluster-name <cluster-name> [--namespace <namespace>]
```
````

**SDK**
````{tab-item} SDK
```python
from sagemaker.hyperpod.hyperpod_manager import HyperPodManager

HyperPodManager.set_context('<hyperpod-cluster-name>', region='us-east-2')
```
````
`````

**Parameters:**
- `cluster-name` (string) - Required. The SageMaker HyperPod cluster name to configure with.
Expand All @@ -52,36 +60,44 @@ HyperPodManager.set_context('<hyperpod-cluster-name>', region='us-east-2')

View information about the currently configured cluster context:

**CLI**
`````{tab-set}
````{tab-item} CLI
```bash
hyp get-cluster-context
```
````

**SDK**
````{tab-item} SDK
```python
from sagemaker.hyperpod.hyperpod_manager import HyperPodManager

# Get current context information
context = HyperPodManager.get_context()
print(context)
```
````
`````

## Job Management

### List Pods for a Training Job

View all pods associated with a specific training job:

**CLI**
`````{tab-set}
````{tab-item} CLI
```bash
hyp list-pods hyp-pytorch-job --job-name <job-name>
```
````

**SDK**
````{tab-item} SDK
```python
# List all pods created for this job
pytorch_job.list_pods()
```
````
`````

**Parameters:**
- `job-name` (string) - Required. The name of the job to list pods for.
Expand All @@ -90,16 +106,20 @@ pytorch_job.list_pods()

View logs for a specific pod within a training job:

**CLI**
`````{tab-set}
````{tab-item} CLI
```bash
hyp get-logs hyp-pytorch-job --pod-name <pod-name> --job-name <job-name>
```
````

**SDK**
````{tab-item} SDK
```python
# Check the logs from pod0
pytorch_job.get_logs_from_pod("demo-pod-0")
```
````
`````

**Parameters:**
- `job-name` (string) - Required. The name of the job to get logs for.
Expand Down
2 changes: 2 additions & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ API reference <_apidoc/modules>

SageMaker HyperPod CLI and SDK provide a seamless way to manage distributed training and inference workloads on EKS-hosted SageMaker HyperPod clusters—without needing Kubernetes expertise. Use the powerful CLI to launch and monitor training jobs and endpoints, or leverage the Python SDK to do the same programmatically with minimal code, including support for JumpStart models, custom endpoints, and built-in monitoring.

## Start Here

::::{container}
::::{grid} 1 2 4 4
:gutter: 3
Expand Down
48 changes: 36 additions & 12 deletions doc/inference.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ You can create inference endpoints using either JumpStart models or custom model

### JumpStart Model Endpoints

**CLI**
`````{tab-set}
````{tab-item} CLI
```bash
hyp create hyp-jumpstart-endpoint \
--version 1.0 \
Expand All @@ -30,8 +31,9 @@ hyp create hyp-jumpstart-endpoint \
--endpoint-name endpoint-jumpstart \
--tls-output-s3-uri s3://sample-bucket
```
````

**SDK**
````{tab-item} SDK
```python
from sagemaker.hyperpod.inference import HyperPodJumpstartEndpoint

Expand All @@ -46,10 +48,13 @@ endpoint = HyperPodJumpstartEndpoint(
# Deploy the endpoint
endpoint.create()
```
````
`````

### Custom Model Endpoints

**CLI**
`````{tab-set}
````{tab-item} CLI
```bash
hyp create hyp-custom-endpoint \
--version 1.0 \
Expand All @@ -59,8 +64,9 @@ hyp create hyp-custom-endpoint \
--instance-type ml.g5.8xlarge \
--tls-output-s3-uri s3://sample-bucket
```
````

**SDK**
````{tab-item} SDK
```python
from sagemaker.hyperpod.inference import HyperPodCustomEndpoint

Expand All @@ -76,6 +82,8 @@ endpoint = HyperPodCustomEndpoint(
# Deploy the endpoint
endpoint.create()
```
````
`````

## Key Parameters

Expand All @@ -92,16 +100,18 @@ When creating an inference endpoint, you'll need to specify:

### List Endpoints

**CLI**
`````{tab-set}
````{tab-item} CLI
```bash
# List JumpStart endpoints
hyp list hyp-jumpstart-endpoint

# List custom endpoints
hyp list hyp-custom-endpoint
```
````

**SDK**
````{tab-item} SDK
```python
from sagemaker.hyperpod.inference import HyperPodJumpstartEndpoint, HyperPodCustomEndpoint

Expand All @@ -113,19 +123,23 @@ print(jumpstart_endpoints)
custom_endpoints = HyperPodCustomEndpoint.list()
print(custom_endpoints)
```
````
`````

### Describe an Endpoint

**CLI**
`````{tab-set}
````{tab-item} CLI
```bash
# Describe JumpStart endpoint
hyp describe hyp-jumpstart-endpoint --endpoint-name <endpoint-name>

# Describe custom endpoint
hyp describe hyp-custom-endpoint --endpoint-name <endpoint-name>
```
````

**SDK**
````{tab-item} SDK
```python
from sagemaker.hyperpod.inference import HyperPodJumpstartEndpoint, HyperPodCustomEndpoint

Expand All @@ -139,19 +153,23 @@ custom_endpoint = HyperPodCustomEndpoint.load(endpoint_name="endpoint-custom")
custom_details = custom_endpoint.describe()
print(custom_details)
```
````
`````

### Invoke an Endpoint

**CLI**
`````{tab-set}
````{tab-item} CLI
```bash
# Invoke custom endpoint
hyp invoke hyp-custom-endpoint \
--endpoint-name <endpoint-name> \
--content-type "application/json" \
--payload '{"inputs": "What is machine learning?"}'
```
````

**SDK**
````{tab-item} SDK
```python
from sagemaker.hyperpod.inference import HyperPodCustomEndpoint

Expand All @@ -165,19 +183,23 @@ response = endpoint.invoke(
)
print(response)
```
````
`````

### Delete an Endpoint

**CLI**
`````{tab-set}
````{tab-item} CLI
```bash
# Delete JumpStart endpoint
hyp delete hyp-jumpstart-endpoint --endpoint-name <endpoint-name>

# Delete custom endpoint
hyp delete hyp-custom-endpoint --endpoint-name <endpoint-name>
```
````

**SDK**
````{tab-item} SDK
```python
from sagemaker.hyperpod.inference import HyperPodJumpstartEndpoint, HyperPodCustomEndpoint

Expand All @@ -189,6 +211,8 @@ jumpstart_endpoint.delete()
custom_endpoint = HyperPodCustomEndpoint.load(endpoint_name="endpoint-custom")
custom_endpoint.delete()
```
````
`````

## Inference Example Notebooks

Expand Down
Loading