Skip to content

Commit 707ddb2

Browse files
Aditi2424adishaamaheshxbjiayelamazon
authored
Documentation BugBash Feedback Addressed(#156)
* Update telemetry status to be Integer for parity (#130) Co-authored-by: adishaa <[email protected]> * Release new version for Health Monitoring Agent (1.0.643.0_1.0.192.0) with minor improvements and bug fixes (#137) * Release new version for Health Monitoring Agent (1.0.674.0_1.0.199.0) with minor improvements and bug fixes. (#139) * documentation working setup * training inference documentation changes * Add more inference examples * UI changes for documentation * Change to tabbed view for CLI and SDK * Change to tabbed view getting started page * clean up custom css * fix inference sdk create commands * Fix sdk and cli commands --------- Co-authored-by: adishaa <[email protected]> Co-authored-by: maheshxb <[email protected]> Co-authored-by: jiayelamazon <[email protected]>
1 parent 2ccd95a commit 707ddb2

File tree

5 files changed

+177
-157
lines changed

5 files changed

+177
-157
lines changed

doc/_static/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ h3 {
4848
}
4949

5050
p {
51-
font-size: 0.875rem;
51+
font-size: 1.0rem;
5252
color: #4b5563;
5353
}

doc/getting_started.md

Lines changed: 9 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
This guide will help you get started with the SageMaker HyperPod CLI and SDK to perform basic operations.
66

7-
## Cluster Management
8-
9-
### List Available Clusters
7+
## List Available Clusters
108

119
List all available SageMaker HyperPod clusters in your account:
1210

@@ -19,20 +17,14 @@ hyp list-cluster [--region <region>] [--namespace <namespace>] [--output <json|t
1917
2018
````{tab-item} SDK
2119
```python
22-
from sagemaker.hyperpod.hyperpod_manager import HyperPodManager
20+
from sagemaker.hyperpod import list_clusters
2321
24-
clusters = HyperPodManager.list_clusters(region='us-east-2')
25-
print(clusters)
22+
list_clusters(region='us-east-2')
2623
```
2724
````
2825
`````
2926

30-
**Parameters:**
31-
- `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.
32-
- `namespace` (string) - Optional. The namespace to check quota with. Only SageMaker managed namespaces are supported.
33-
- `output` (enum) - Optional. The output format: `table` or `json` (default).
34-
35-
### Connect to a Cluster
27+
## Connect to a Cluster
3628

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

@@ -45,18 +37,14 @@ hyp set-cluster-context --cluster-name <cluster-name> [--namespace <namespace>]
4537
4638
````{tab-item} SDK
4739
```python
48-
from sagemaker.hyperpod.hyperpod_manager import HyperPodManager
40+
from sagemaker.hyperpod import set_cluster_context
4941
50-
HyperPodManager.set_context('<hyperpod-cluster-name>', region='us-east-2')
42+
set_cluster_context('<my-cluster>', region='us-east-2')
5143
```
5244
````
5345
`````
5446

55-
**Parameters:**
56-
- `cluster-name` (string) - Required. The SageMaker HyperPod cluster name to configure with.
57-
- `namespace` (string) - Optional. The namespace to connect to. If not specified, the CLI will automatically discover accessible namespaces.
58-
59-
### Get Current Cluster Context
47+
## Get Current Cluster Context
6048

6149
View information about the currently configured cluster context:
6250

@@ -69,61 +57,13 @@ hyp get-cluster-context
6957
7058
````{tab-item} SDK
7159
```python
72-
from sagemaker.hyperpod.hyperpod_manager import HyperPodManager
73-
74-
# Get current context information
75-
context = HyperPodManager.get_context()
76-
print(context)
77-
```
78-
````
79-
`````
80-
81-
## Job Management
82-
83-
### List Pods for a Training Job
60+
from sagemaker.hyperpod import get_cluster_context
8461
85-
View all pods associated with a specific training job:
86-
87-
`````{tab-set}
88-
````{tab-item} CLI
89-
```bash
90-
hyp list-pods hyp-pytorch-job --job-name <job-name>
91-
```
92-
````
93-
94-
````{tab-item} SDK
95-
```python
96-
# List all pods created for this job
97-
pytorch_job.list_pods()
98-
```
99-
````
100-
`````
101-
102-
**Parameters:**
103-
- `job-name` (string) - Required. The name of the job to list pods for.
104-
105-
### Access Pod Logs
106-
107-
View logs for a specific pod within a training job:
108-
109-
`````{tab-set}
110-
````{tab-item} CLI
111-
```bash
112-
hyp get-logs hyp-pytorch-job --pod-name <pod-name> --job-name <job-name>
113-
```
114-
````
115-
116-
````{tab-item} SDK
117-
```python
118-
# Check the logs from pod0
119-
pytorch_job.get_logs_from_pod("demo-pod-0")
62+
get_cluster_context()
12063
```
12164
````
12265
`````
12366

124-
**Parameters:**
125-
- `job-name` (string) - Required. The name of the job to get logs for.
126-
- `pod-name` (string) - Required. The name of the pod to get logs from.
12767

12868
## Next Steps
12969

doc/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ Example Notebooks <examples>
1414
API reference <_apidoc/modules>
1515
```
1616

17-
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.
17+
SageMaker HyperPod Command Line Interface (CLI) and Software Development Kit (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.
18+
19+
## Start Here
1820

1921
## Start Here
2022

doc/inference.md

Lines changed: 89 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ You can create inference endpoints using either JumpStart models or custom model
2525
````{tab-item} CLI
2626
```bash
2727
hyp create hyp-jumpstart-endpoint \
28-
--version 1.0 \
29-
--model-id jumpstart-model-id \
30-
--instance-type ml.g5.8xlarge \
31-
--endpoint-name endpoint-jumpstart \
32-
--tls-output-s3-uri s3://sample-bucket
28+
--model-id jumpstart-model-id \
29+
--instance-type ml.g5.8xlarge \
30+
--endpoint-name endpoint-jumpstart
3331
```
3432
````
3533
@@ -69,19 +67,21 @@ js_endpoint.create()
6967
````{tab-item} CLI
7068
```bash
7169
hyp create hyp-custom-endpoint \
72-
--version 1.0 \
73-
--endpoint-name endpoint-custom \
74-
--model-uri s3://my-bucket/model-artifacts \
75-
--image 123456789012.dkr.ecr.us-west-2.amazonaws.com/my-inference-image:latest \
76-
--instance-type ml.g5.8xlarge \
77-
--tls-output-s3-uri s3://sample-bucket
70+
--version 1.0 \
71+
--endpoint-name endpoint-s3 \
72+
--model-name <model-name> \
73+
--model-source-type s3 \
74+
--instance-type <instance-type> \
75+
--image-uri <image-uri> \
76+
--container-port 8080 \
77+
--model-volume-mount-name model-weights
7878
```
7979
````
8080
8181
````{tab-item} SDK
8282
```python
8383
from sagemaker.hyperpod.inference.config.hp_custom_endpoint_config import Model, Server, SageMakerEndpoint, TlsConfig, EnvironmentVariables
84-
from sagemaker.hyperpod.inference.hp_custom_endpoint import HPCustomEndpoint
84+
from sagemaker.hyperpod.inference.hp_custom_endpoint import HPEndpoint
8585
8686
model = Model(
8787
model_source_type="s3",
@@ -115,7 +115,7 @@ endpoint_name = SageMakerEndpoint(name="endpoint-custom-pytorch")
115115
116116
tls_config = TlsConfig(tls_certificate_output_s3_uri="s3://sample-bucket")
117117
118-
custom_endpoint = HPCustomEndpoint(
118+
custom_endpoint = HPEndpoint(
119119
model=model,
120120
server=server,
121121
resources=resources,
@@ -129,16 +129,18 @@ custom_endpoint.create()
129129
````
130130
`````
131131

132-
## Key Parameters
132+
### Key Parameters
133133

134134
When creating an inference endpoint, you'll need to specify:
135135

136136
- **endpoint-name**: Unique identifier for your endpoint
137-
- **model-id** (JumpStart): ID of the pre-trained JumpStart model
138-
- **model-uri** (Custom): S3 location of your model artifacts
139-
- **image** (Custom): Docker image containing your inference code
140137
- **instance-type**: The EC2 instance type to use
141-
- **tls-output-s3-uri**: S3 location to store TLS certificates
138+
- **model-id** (JumpStart): ID of the pre-trained JumpStart model
139+
- **image-uri** (Custom): Docker image containing your inference code
140+
- **model-name** (Custom): Name of model to create on SageMaker
141+
- **model-source-type** (Custom): Source type: fsx or s3
142+
- **model-volume-mount-name** (Custom): Name of the model volume mount
143+
- **container-port** (Custom): Port on which the model server listens
142144

143145
## Managing Inference Endpoints
144146

@@ -158,14 +160,14 @@ hyp list hyp-custom-endpoint
158160
````{tab-item} SDK
159161
```python
160162
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
161-
from sagemaker.hyperpod.inference.hp_custom_endpoint import HPCustomEndpoint
163+
from sagemaker.hyperpod.inference.hp_custom_endpoint import HPEndpoint
162164
163165
# List JumpStart endpoints
164166
jumpstart_endpoints = HPJumpStartEndpoint.list()
165167
print(jumpstart_endpoints)
166168
167169
# List custom endpoints
168-
custom_endpoints = HPCustomEndpoint.list()
170+
custom_endpoints = HPEndpoint.list()
169171
print(custom_endpoints)
170172
```
171173
````
@@ -177,24 +179,24 @@ print(custom_endpoints)
177179
````{tab-item} CLI
178180
```bash
179181
# Describe JumpStart endpoint
180-
hyp describe hyp-jumpstart-endpoint --endpoint-name <endpoint-name>
182+
hyp describe hyp-jumpstart-endpoint --name <endpoint-name>
181183
182184
# Describe custom endpoint
183-
hyp describe hyp-custom-endpoint --endpoint-name <endpoint-name>
185+
hyp describe hyp-custom-endpoint --name <endpoint-name>
184186
```
185187
````
186188
187189
````{tab-item} SDK
188190
```python
189-
from sagemaker.hyperpod.inference import HyperPodJumpstartEndpoint, HyperPodCustomEndpoint
191+
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
192+
from sagemaker.hyperpod.inference.hp_custom_endpoint import HPEndpoint
190193
191194
# Get JumpStart endpoint details
192-
jumpstart_endpoint = HyperPodJumpstartEndpoint.load(endpoint_name="endpoint-jumpstart")
193-
jumpstart_details = jumpstart_endpoint.describe()
194-
print(jumpstart_details)
195+
jumpstart_endpoint = HPJumpStartEndpoint.get(name="js-endpoint-name", namespace="test")
196+
print(jumpstart_endpoint)
195197
196198
# Get custom endpoint details
197-
custom_endpoint = HyperPodCustomEndpoint.load(endpoint_name="endpoint-custom")
199+
custom_endpoint = HPEndpoint.get(endpoint_name="endpoint-custom")
198200
custom_details = custom_endpoint.describe()
199201
print(custom_details)
200202
```
@@ -206,11 +208,15 @@ print(custom_details)
206208
`````{tab-set}
207209
````{tab-item} CLI
208210
```bash
211+
# Invoke Jumpstart endpoint
212+
hyp invoke hyp-jumpstart-endpoint \
213+
--endpoint-name <endpoint-name> \
214+
--body '{"inputs":"What is the capital of USA?"}'
215+
209216
# Invoke custom endpoint
210217
hyp invoke hyp-custom-endpoint \
211218
--endpoint-name <endpoint-name> \
212-
--content-type "application/json" \
213-
--payload '{"inputs": "What is machine learning?"}'
219+
--body '{"inputs": "What is machine learning?"}'
214220
```
215221
````
216222
@@ -223,29 +229,78 @@ print(response)
223229
````
224230
`````
225231

232+
### List Pods
233+
234+
`````{tab-set}
235+
````{tab-item} CLI
236+
```bash
237+
# JumpStart endpoint
238+
hyp list-pods hyp-jumpstart-endpoint
239+
240+
# Custom endpoint
241+
hyp list-pods hyp-custom-endpoint
242+
```
243+
````
244+
`````
245+
246+
### Get Logs
247+
248+
`````{tab-set}
249+
````{tab-item} CLI
250+
```bash
251+
# JumpStart endpoint
252+
hyp get-logs hyp-jumpstart-endpoint --pod-name <pod-name>
253+
254+
# Custom endpoint
255+
hyp get-logs hyp-custom-endpoint --pod-name <pod-name>
256+
```
257+
````
258+
`````
259+
260+
### Get Operator Logs
261+
262+
`````{tab-set}
263+
````{tab-item} CLI
264+
```bash
265+
# JumpStart endpoint
266+
hyp get-operator-logs hyp-jumpstart-endpoint --since-hours 0.5
267+
268+
# Custom endpoint
269+
hyp get-operator-logs hyp-custom-endpoint --since-hours 0.5
270+
```
271+
````
272+
273+
````{tab-item} SDK
274+
```python
275+
print(endpoint.get_operator_logs(since_hours=0.1))
276+
```
277+
````
278+
`````
279+
226280
### Delete an Endpoint
227281

228282
`````{tab-set}
229283
````{tab-item} CLI
230284
```bash
231285
# Delete JumpStart endpoint
232-
hyp delete hyp-jumpstart-endpoint --endpoint-name <endpoint-name>
286+
hyp delete hyp-jumpstart-endpoint --name <endpoint-name>
233287
234288
# Delete custom endpoint
235-
hyp delete hyp-custom-endpoint --endpoint-name <endpoint-name>
289+
hyp delete hyp-custom-endpoint --name <endpoint-name>
236290
```
237291
````
238292
239293
````{tab-item} SDK
240294
```python
241-
from sagemaker.hyperpod.inference import HyperPodJumpstartEndpoint, HyperPodCustomEndpoint
295+
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
296+
from sagemaker.hyperpod.inference.hp_custom_endpoint import HPEndpoint
242297
243298
# Delete JumpStart endpoint
244-
jumpstart_endpoint = HyperPodJumpstartEndpoint.load(endpoint_name="endpoint-jumpstart")
299+
jumpstart_endpoint = HPJumpStartEndpoint.get(endpoint_name="endpoint-jumpstart")
245300
jumpstart_endpoint.delete()
246301
247302
# Delete custom endpoint
248-
custom_endpoint = HyperPodCustomEndpoint.load(endpoint_name="endpoint-custom")
303+
custom_endpoint = HPEndpoint.get(endpoint_name="endpoint-custom")
249304
custom_endpoint.delete()
250305
```
251306
````

0 commit comments

Comments
 (0)