sagemaker-hyperpod 3.2.2__tar.gz → 3.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sagemaker_hyperpod-3.2.2/src/sagemaker_hyperpod.egg-info → sagemaker_hyperpod-3.3.0}/PKG-INFO +505 -83
- sagemaker_hyperpod-3.3.0/README.md +1041 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/pyproject.toml +1 -1
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/setup.cfg +2 -1
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/setup.py +1 -1
- sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/cli/__init__.py +9 -0
- sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/cli/cluster_stack_utils.py +498 -0
- sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/cli/cluster_utils.py +145 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/commands/cluster.py +31 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/commands/cluster_stack.py +64 -69
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/commands/inference.py +9 -21
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/commands/init.py +55 -101
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/commands/training.py +1 -31
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/common_utils.py +52 -2
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/constants/init_constants.py +57 -29
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/hyp_cli.py +2 -2
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/inference_utils.py +3 -4
- sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/cli/init_utils.py +536 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/training_utils.py +2 -2
- sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/cli/type_handler_utils.py +174 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cluster_management/hp_cluster_stack.py +225 -31
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/common/telemetry/telemetry_logging.py +20 -1
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/common/utils.py +6 -1
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/inference/hp_endpoint.py +7 -5
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/inference/hp_jumpstart_endpoint.py +7 -5
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0/src/sagemaker_hyperpod.egg-info}/PKG-INFO +505 -83
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker_hyperpod.egg-info/SOURCES.txt +3 -4
- sagemaker_hyperpod-3.2.2/README.md +0 -619
- sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/cli/init_utils.py +0 -949
- sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/cli/templates/cfn_cluster_creation.py +0 -948
- sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/cli/templates/k8s_custom_endpoint_template.py +0 -68
- sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/cli/templates/k8s_js_endpoint_template.py +0 -17
- sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/cli/templates/k8s_pytorch_job_template.py +0 -68
- sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/observability/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/LICENSE +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/NOTICE +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/clients/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/clients/kubernetes_client.py +0 -0
- {sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/cli → sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/cli/commands}/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/cli/commands → sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/cli/constants}/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/constants/command_constants.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/constants/exception_constants.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/constants/hyperpod_instance_types.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/constants/kueue_constants.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/constants/pytorch_constants.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/service/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/service/cancel_training_job.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/service/discover_namespaces.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/service/exec_command.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/service/get_logs.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/service/get_namespaces.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/service/get_training_job.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/service/list_pods.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/service/list_training_jobs.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/service/self_subject_access_review.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/templates/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/utils.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/validators/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/validators/cluster_validator.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/validators/job_validator.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cli/validators/validator.py +0 -0
- {sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/cli/constants → sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/cluster_management}/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/cluster_management → sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/cluster_management/config}/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/cluster_management/config/hp_cluster_stack_config.py +0 -0
- {sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/cluster_management/config → sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/common}/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/common/cli_decorators.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/common/config/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/common/config/metadata.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/common/exceptions/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/common/telemetry/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/common/telemetry/constants.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/common/telemetry/user_agent.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/inference/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/common → sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/inference/config}/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/inference/config/constants.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/inference/config/hp_endpoint_config.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/inference/config/hp_jumpstart_endpoint_config.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/inference/hp_endpoint_base.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/inference/jumpstart_public_hub_visualization_utils.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/observability/MonitoringConfig.py +0 -0
- {sagemaker_hyperpod-3.2.2/src/sagemaker/hyperpod/inference/config → sagemaker_hyperpod-3.3.0/src/sagemaker/hyperpod/observability}/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/observability/constants.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/observability/utils.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/training/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/training/config/__init__.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/training/config/hyperpod_pytorch_job_unified_config.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/training/hyperpod_pytorch_job.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker/hyperpod/training/quota_allocation_util.py +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker_hyperpod.egg-info/dependency_links.txt +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker_hyperpod.egg-info/entry_points.txt +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker_hyperpod.egg-info/requires.txt +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker_hyperpod.egg-info/top_level.txt +0 -0
- {sagemaker_hyperpod-3.2.2 → sagemaker_hyperpod-3.3.0}/src/sagemaker_hyperpod.egg-info/zip-safe +0 -0
{sagemaker_hyperpod-3.2.2/src/sagemaker_hyperpod.egg-info → sagemaker_hyperpod-3.3.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sagemaker-hyperpod
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
4
4
|
Summary: Amazon SageMaker HyperPod SDK and CLI
|
|
5
5
|
Home-page: https://github.com/aws/sagemaker-hyperpod-cli
|
|
6
6
|
Author: Amazon Web Services
|
|
@@ -56,7 +56,7 @@ Dynamic: requires-python
|
|
|
56
56
|
|
|
57
57
|
# SageMaker HyperPod command-line interface
|
|
58
58
|
|
|
59
|
-
The Amazon SageMaker HyperPod command-line interface (HyperPod CLI) is a tool that helps manage training jobs on the SageMaker HyperPod clusters orchestrated by Amazon EKS.
|
|
59
|
+
The Amazon SageMaker HyperPod command-line interface (HyperPod CLI) is a tool that helps manage clusters, training jobs, and inference endpoints on the SageMaker HyperPod clusters orchestrated by Amazon EKS.
|
|
60
60
|
|
|
61
61
|
This documentation serves as a reference for the available HyperPod CLI commands. For a comprehensive user guide, see [Orchestrating SageMaker HyperPod clusters with Amazon EKS](https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-hyperpod-eks.html) in the *Amazon SageMaker Developer Guide*.
|
|
62
62
|
|
|
@@ -69,19 +69,17 @@ Note: Old `hyperpod`CLI V2 has been moved to `release_v2` branch. Please refer [
|
|
|
69
69
|
- [ML Framework Support](#ml-framework-support)
|
|
70
70
|
- [Installation](#installation)
|
|
71
71
|
- [Usage](#usage)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- [Training](#training-sdk)
|
|
84
|
-
- [Inference](#inference-sdk)
|
|
72
|
+
- [Getting Started](#getting-started)
|
|
73
|
+
- [CLI](#cli)
|
|
74
|
+
- [Cluster Management](#cluster-management)
|
|
75
|
+
- [Training](#training)
|
|
76
|
+
- [Inference](#inference)
|
|
77
|
+
- [Jumpstart Endpoint](#jumpstart-endpoint-creation)
|
|
78
|
+
- [Custom Endpoint](#custom-endpoint-creation)
|
|
79
|
+
- [SDK](#sdk)
|
|
80
|
+
- [Cluster Management](#cluster-management-sdk)
|
|
81
|
+
- [Training](#training-sdk)
|
|
82
|
+
- [Inference](#inference-sdk)
|
|
85
83
|
- [Examples](#examples)
|
|
86
84
|
|
|
87
85
|
|
|
@@ -134,22 +132,22 @@ SageMaker HyperPod CLI currently supports start training job with:
|
|
|
134
132
|
|
|
135
133
|
The HyperPod CLI provides the following commands:
|
|
136
134
|
|
|
137
|
-
- [Getting
|
|
138
|
-
- [Connecting to a Cluster](#connecting-to-a-cluster)
|
|
139
|
-
- [Getting Cluster Context](#getting-cluster-context)
|
|
140
|
-
- [Listing Pods](#listing-pods)
|
|
141
|
-
- [Accessing Logs](#accessing-logs)
|
|
135
|
+
- [Getting Started](#getting-started)
|
|
142
136
|
- [CLI](#cli)
|
|
143
137
|
- [Cluster Management](#cluster-management)
|
|
144
138
|
- [Training](#training)
|
|
145
139
|
- [Inference](#inference)
|
|
140
|
+
- [Jumpstart Endpoint](#jumpstart-endpoint-creation)
|
|
141
|
+
- [Custom Endpoint](#custom-endpoint-creation)
|
|
146
142
|
- [SDK](#sdk)
|
|
147
143
|
- [Cluster Management](#cluster-management-sdk)
|
|
148
144
|
- [Training](#training-sdk)
|
|
149
145
|
- [Inference](#inference-sdk)
|
|
150
146
|
|
|
151
147
|
|
|
152
|
-
### Getting
|
|
148
|
+
### Getting Started
|
|
149
|
+
|
|
150
|
+
#### Getting Cluster information
|
|
153
151
|
|
|
154
152
|
This command lists the available SageMaker HyperPod clusters and their capacity information.
|
|
155
153
|
|
|
@@ -161,10 +159,10 @@ hyp list-cluster
|
|
|
161
159
|
|--------|------|-------------|
|
|
162
160
|
| `--region <region>` | Optional | The region that the SageMaker HyperPod and EKS clusters are located. If not specified, it will be set to the region from the current AWS account credentials. |
|
|
163
161
|
| `--namespace <namespace>` | Optional | The namespace that users want to check the quota with. Only the SageMaker managed namespaces are supported. |
|
|
164
|
-
| `--output <json
|
|
162
|
+
| `--output <json\|table>` | Optional | The output format. Available values are `table` and `json`. The default value is `json`. |
|
|
165
163
|
| `--debug` | Optional | Enable debug mode for detailed logging. |
|
|
166
164
|
|
|
167
|
-
|
|
165
|
+
#### Connecting to a Cluster
|
|
168
166
|
|
|
169
167
|
This command configures the local Kubectl environment to interact with the specified SageMaker HyperPod cluster and namespace.
|
|
170
168
|
|
|
@@ -179,7 +177,7 @@ hyp set-cluster-context --cluster-name <cluster-name>
|
|
|
179
177
|
| `--region <region>` | Optional | The AWS region where the HyperPod cluster resides. |
|
|
180
178
|
| `--debug` | Optional | Enable debug mode for detailed logging. |
|
|
181
179
|
|
|
182
|
-
|
|
180
|
+
#### Getting Cluster Context
|
|
183
181
|
|
|
184
182
|
Get all the context related to the current set Cluster
|
|
185
183
|
|
|
@@ -191,31 +189,6 @@ hyp get-cluster-context
|
|
|
191
189
|
|--------|------|-------------|
|
|
192
190
|
| `--debug` | Optional | Enable debug mode for detailed logging. |
|
|
193
191
|
|
|
194
|
-
### Listing Pods
|
|
195
|
-
|
|
196
|
-
This command lists all the pods associated with a specific training job.
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
hyp list-pods hyp-pytorch-job --job-name <job-name>
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
* `job-name` (string) - Required. The name of the job to list pods for.
|
|
203
|
-
|
|
204
|
-
### Accessing Logs
|
|
205
|
-
|
|
206
|
-
This command retrieves the logs for a specific pod within a training job.
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
hyp get-logs hyp-pytorch-job --pod-name <pod-name> --job-name <job-name>
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
| Option | Type | Description |
|
|
213
|
-
|--------|------|-------------|
|
|
214
|
-
| `--job-name <job-name>` | Required | The name of the job to get the log for. |
|
|
215
|
-
| `--pod-name <pod-name>` | Required | The name of the pod to get the log from. |
|
|
216
|
-
| `--namespace <namespace>` | Optional | The namespace of the job. Defaults to 'default'. |
|
|
217
|
-
| `--container <container>` | Optional | The container name to get logs from. |
|
|
218
|
-
|
|
219
192
|
|
|
220
193
|
## CLI
|
|
221
194
|
|
|
@@ -256,10 +229,10 @@ hyp validate
|
|
|
256
229
|
Create the cluster stack using the configured parameters:
|
|
257
230
|
|
|
258
231
|
```bash
|
|
259
|
-
hyp create
|
|
232
|
+
hyp create --region <region>
|
|
260
233
|
```
|
|
261
234
|
|
|
262
|
-
**Note**: The region is
|
|
235
|
+
**Note**: The region flag is optional. If not provided, the command will use the default region from your AWS credentials configuration.
|
|
263
236
|
|
|
264
237
|
#### List Cluster Stacks
|
|
265
238
|
|
|
@@ -284,6 +257,21 @@ hyp describe cluster-stack <stack-name>
|
|
|
284
257
|
| `--region <region>` | Optional | The AWS region where the stack exists. |
|
|
285
258
|
| `--debug` | Optional | Enable debug mode for detailed logging. |
|
|
286
259
|
|
|
260
|
+
#### Delete Cluster Stack
|
|
261
|
+
|
|
262
|
+
Delete a HyperPod cluster stack. Removes the specified CloudFormation stack and all associated AWS resources. This operation cannot be undone.
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
hyp delete cluster-stack <stack-name>
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
| Option | Type | Description |
|
|
269
|
+
|--------|------|-------------|
|
|
270
|
+
| `--region <region>` | Required | The AWS region where the stack exists. |
|
|
271
|
+
| `--retain-resources S3Bucket-TrainingData,EFSFileSystem-Models` | Optional | Comma-separated list of logical resource IDs to retain during deletion (only works on DELETE_FAILED stacks). Resource names are shown in failed deletion output, or use AWS CLI: `aws cloudformation list-stack-resources STACK_NAME --region REGION`. |
|
|
272
|
+
| `--debug` | Optional | Enable debug mode for detailed logging. |
|
|
273
|
+
|
|
274
|
+
|
|
287
275
|
#### Update Existing Cluster
|
|
288
276
|
|
|
289
277
|
```bash
|
|
@@ -302,7 +290,42 @@ hyp reset
|
|
|
302
290
|
|
|
303
291
|
### Training
|
|
304
292
|
|
|
305
|
-
####
|
|
293
|
+
#### **Option 1**: Create Pytorch job through init experience
|
|
294
|
+
|
|
295
|
+
#### Initialize Pytorch Job Configuration
|
|
296
|
+
|
|
297
|
+
Initialize a new pytorch job configuration in the current directory:
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
hyp init hyp-pytorch-job
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
#### Configure Pytorch Job Parameters
|
|
304
|
+
|
|
305
|
+
Configure pytorch job parameters interactively or via command line:
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
hyp configure --job-name my-pytorch-job
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
#### Validate Configuration
|
|
312
|
+
|
|
313
|
+
Validate the configuration file syntax:
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
hyp validate
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
#### Create Pytorch Job
|
|
320
|
+
|
|
321
|
+
Create the pytorch job using the configured parameters:
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
hyp create
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
#### **Option 2**: Create Pytorch job through create command
|
|
306
329
|
|
|
307
330
|
```bash
|
|
308
331
|
hyp create hyp-pytorch-job \
|
|
@@ -332,16 +355,125 @@ hyp create hyp-pytorch-job \
|
|
|
332
355
|
--volume name=training-output,type=pvc,mount_path=/data2,claim_name=my-pvc,read_only=false
|
|
333
356
|
```
|
|
334
357
|
|
|
335
|
-
|
|
358
|
+
| Parameter | Type | Required | Description |
|
|
359
|
+
|-----------|------|----------|-------------|
|
|
360
|
+
| `--job-name` | TEXT | Yes | Unique name for the training job (1-63 characters, alphanumeric with hyphens) |
|
|
361
|
+
| `--image` | TEXT | Yes | Docker image URI containing your training code |
|
|
362
|
+
| `--namespace` | TEXT | No | Kubernetes namespace |
|
|
363
|
+
| `--command` | ARRAY | No | Command to run in the container (array of strings) |
|
|
364
|
+
| `--args` | ARRAY | No | Arguments for the entry script (array of strings) |
|
|
365
|
+
| `--environment` | OBJECT | No | Environment variables as key-value pairs |
|
|
366
|
+
| `--pull-policy` | TEXT | No | Image pull policy (Always, Never, IfNotPresent) |
|
|
367
|
+
| `--instance-type` | TEXT | No | Instance type for training |
|
|
368
|
+
| `--node-count` | INTEGER | No | Number of nodes (minimum: 1) |
|
|
369
|
+
| `--tasks-per-node` | INTEGER | No | Number of tasks per node (minimum: 1) |
|
|
370
|
+
| `--label-selector` | OBJECT | No | Node label selector as key-value pairs |
|
|
371
|
+
| `--deep-health-check-passed-nodes-only` | BOOLEAN | No | Schedule pods only on nodes that passed deep health check (default: false) |
|
|
372
|
+
| `--scheduler-type` | TEXT | No | Scheduler type |
|
|
373
|
+
| `--queue-name` | TEXT | No | Queue name for job scheduling (1-63 characters, alphanumeric with hyphens) |
|
|
374
|
+
| `--priority` | TEXT | No | Priority class for job scheduling |
|
|
375
|
+
| `--max-retry` | INTEGER | No | Maximum number of job retries (minimum: 0) |
|
|
376
|
+
| `--volume` | ARRAY | No | List of volume configurations (Refer [Volume Configuration](#volume-configuration) for detailed parameter info) |
|
|
377
|
+
| `--service-account-name` | TEXT | No | Service account name |
|
|
378
|
+
| `--accelerators` | INTEGER | No | Number of accelerators a.k.a GPUs or Trainium Chips |
|
|
379
|
+
| `--vcpu` | FLOAT | No | Number of vCPUs |
|
|
380
|
+
| `--memory` | FLOAT | No | Amount of memory in GiB |
|
|
381
|
+
| `--accelerators-limit` | INTEGER | No | Limit for the number of accelerators a.k.a GPUs or Trainium Chips |
|
|
382
|
+
| `--vcpu-limit` | FLOAT | No | Limit for the number of vCPUs |
|
|
383
|
+
| `--memory-limit` | FLOAT | No | Limit for the amount of memory in GiB |
|
|
384
|
+
| `--preferred-topology` | TEXT | No | Preferred topology annotation for scheduling |
|
|
385
|
+
| `--required-topology` | TEXT | No | Required topology annotation for scheduling |
|
|
386
|
+
| `--debug` | FLAG | No | Enable debug mode (default: false) |
|
|
387
|
+
|
|
388
|
+
#### List Training Jobs
|
|
336
389
|
|
|
337
|
-
|
|
390
|
+
```bash
|
|
391
|
+
hyp list hyp-pytorch-job
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
#### Describe a Training Job
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
hyp describe hyp-pytorch-job --job-name <job-name>
|
|
398
|
+
````
|
|
338
399
|
|
|
339
|
-
|
|
400
|
+
#### Listing Pods
|
|
401
|
+
|
|
402
|
+
This command lists all the pods associated with a specific training job.
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
hyp list-pods hyp-pytorch-job --job-name <job-name>
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
* `job-name` (string) - Required. The name of the job to list pods for.
|
|
409
|
+
|
|
410
|
+
#### Accessing Logs
|
|
411
|
+
|
|
412
|
+
This command retrieves the logs for a specific pod within a training job.
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
hyp get-logs hyp-pytorch-job --pod-name <pod-name> --job-name <job-name>
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
| Parameter | Required | Description |
|
|
419
|
+
|--------|------|-------------|
|
|
420
|
+
| `--job-name` | Yes | The name of the job to get the log for. |
|
|
421
|
+
| `--pod-name` | Yes | The name of the pod to get the log from. |
|
|
422
|
+
| `--namespace` | No | The namespace of the job. Defaults to 'default'. |
|
|
423
|
+
| `--container` | No | The container name to get logs from. |
|
|
424
|
+
|
|
425
|
+
#### Get Operator Logs
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
hyp get-operator-logs hyp-pytorch-job --since-hours 0.5
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
#### Delete a Training Job
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
hyp delete hyp-pytorch-job --job-name <job-name>
|
|
435
|
+
```
|
|
340
436
|
|
|
341
437
|
### Inference
|
|
342
438
|
|
|
343
|
-
|
|
439
|
+
### Jumpstart Endpoint Creation
|
|
440
|
+
|
|
441
|
+
#### **Option 1**: Create jumpstart endpoint through init experience
|
|
442
|
+
|
|
443
|
+
#### Initialize Jumpstart Endpoint Configuration
|
|
444
|
+
|
|
445
|
+
Initialize a new jumpstart endpoint configuration in the current directory:
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
hyp init hyp-jumpstart-endpoint
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
#### Configure Jumpstart Endpoint Parameters
|
|
452
|
+
|
|
453
|
+
Configure jumpstart endpoint parameters interactively or via command line:
|
|
454
|
+
|
|
455
|
+
```bash
|
|
456
|
+
hyp configure --endpoint-name my-jumpstart-endpoint
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
#### Validate Configuration
|
|
460
|
+
|
|
461
|
+
Validate the configuration file syntax:
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
hyp validate
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
#### Create Jumpstart Endpoint
|
|
468
|
+
|
|
469
|
+
Create the jumpstart endpoint using the configured parameters:
|
|
470
|
+
|
|
471
|
+
```bash
|
|
472
|
+
hyp create
|
|
473
|
+
```
|
|
474
|
+
|
|
344
475
|
|
|
476
|
+
#### **Option 2**: Create jumpstart endpoint through create command
|
|
345
477
|
Pre-trained Jumpstart models can be gotten from https://sagemaker.readthedocs.io/en/v2.82.0/doc_utils/jumpstart.html and fed into the call for creating the endpoint
|
|
346
478
|
|
|
347
479
|
```bash
|
|
@@ -352,16 +484,27 @@ hyp create hyp-jumpstart-endpoint \
|
|
|
352
484
|
--endpoint-name endpoint-jumpstart
|
|
353
485
|
```
|
|
354
486
|
|
|
487
|
+
| Parameter | Type | Required | Description |
|
|
488
|
+
|-----------|------|----------|-------------|
|
|
489
|
+
| `--model-id` | TEXT | Yes | JumpStart model identifier (1-63 characters, alphanumeric with hyphens) |
|
|
490
|
+
| `--instance-type` | TEXT | Yes | EC2 instance type for inference (must start with "ml.") |
|
|
491
|
+
| `--namespace` | TEXT | No | Kubernetes namespace |
|
|
492
|
+
| `--metadata-name` | TEXT | No | Name of the jumpstart endpoint object |
|
|
493
|
+
| `--accept-eula` | BOOLEAN | No | Whether model terms of use have been accepted (default: false) |
|
|
494
|
+
| `--model-version` | TEXT | No | Semantic version of the model (e.g., "1.0.0", 5-14 characters) |
|
|
495
|
+
| `--endpoint-name` | TEXT | No | Name of SageMaker endpoint (1-63 characters, alphanumeric with hyphens) |
|
|
496
|
+
| `--tls-certificate-output-s3-uri` | TEXT | No | S3 URI to write the TLS certificate (optional) |
|
|
497
|
+
| `--debug` | FLAG | No | Enable debug mode (default: false) |
|
|
498
|
+
|
|
355
499
|
|
|
356
500
|
#### Invoke a JumpstartModel Endpoint
|
|
357
501
|
|
|
358
502
|
```bash
|
|
359
|
-
hyp invoke hyp-
|
|
503
|
+
hyp invoke hyp-jumpstart-endpoint \
|
|
360
504
|
--endpoint-name endpoint-jumpstart \
|
|
361
505
|
--body '{"inputs":"What is the capital of USA?"}'
|
|
362
506
|
```
|
|
363
507
|
|
|
364
|
-
**Note**: Both JumpStart and custom endpoints use the same invoke command.
|
|
365
508
|
|
|
366
509
|
#### Managing an Endpoint
|
|
367
510
|
|
|
@@ -370,12 +513,72 @@ hyp list hyp-jumpstart-endpoint
|
|
|
370
513
|
hyp describe hyp-jumpstart-endpoint --name endpoint-jumpstart
|
|
371
514
|
```
|
|
372
515
|
|
|
373
|
-
####
|
|
516
|
+
#### List Pods
|
|
374
517
|
|
|
518
|
+
```bash
|
|
519
|
+
hyp list-pods hyp-jumpstart-endpoint
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
#### Get Logs
|
|
523
|
+
|
|
524
|
+
```bash
|
|
525
|
+
hyp get-logs hyp-jumpstart-endpoint --pod-name <pod-name>
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
#### Get Operator Logs
|
|
529
|
+
|
|
530
|
+
```bash
|
|
531
|
+
hyp get-operator-logs hyp-jumpstart-endpoint --since-hours 0.5
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
#### Deleting an Endpoint
|
|
535
|
+
|
|
536
|
+
```bash
|
|
537
|
+
hyp delete hyp-jumpstart-endpoint --name endpoint-jumpstart
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
### Custom Endpoint Creation
|
|
542
|
+
#### **Option 1**: Create custom endpoint through init experience
|
|
543
|
+
|
|
544
|
+
#### Initialize Custom Endpoint Configuration
|
|
545
|
+
|
|
546
|
+
Initialize a new custom endpoint configuration in the current directory:
|
|
547
|
+
|
|
548
|
+
```bash
|
|
549
|
+
hyp init hyp-custom-endpoint
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
#### Configure Custom Endpoint Parameters
|
|
553
|
+
|
|
554
|
+
Configure custom endpoint parameters interactively or via command line:
|
|
555
|
+
|
|
556
|
+
```bash
|
|
557
|
+
hyp configure --endpoint-name my-custom-endpoint
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
#### Validate Configuration
|
|
561
|
+
|
|
562
|
+
Validate the configuration file syntax:
|
|
563
|
+
|
|
564
|
+
```bash
|
|
565
|
+
hyp validate
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
#### Create Custom Endpoint
|
|
569
|
+
|
|
570
|
+
Create the custom endpoint using the configured parameters:
|
|
571
|
+
|
|
572
|
+
```bash
|
|
573
|
+
hyp create
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
#### **Option 2**: Create custom endpoint through create command
|
|
375
578
|
```bash
|
|
376
579
|
hyp create hyp-custom-endpoint \
|
|
377
580
|
--version 1.0 \
|
|
378
|
-
--endpoint-name
|
|
581
|
+
--endpoint-name endpoint-custom \
|
|
379
582
|
--model-name my-pytorch-model \
|
|
380
583
|
--model-source-type s3 \
|
|
381
584
|
--model-location my-pytorch-training \
|
|
@@ -387,6 +590,46 @@ hyp create hyp-custom-endpoint \
|
|
|
387
590
|
--container-port 8080
|
|
388
591
|
```
|
|
389
592
|
|
|
593
|
+
| Parameter | Type | Required | Description |
|
|
594
|
+
|-----------|------|----------|-------------|
|
|
595
|
+
| `--instance-type` | TEXT | Yes | EC2 instance type for inference (must start with "ml.") |
|
|
596
|
+
| `--model-name` | TEXT | Yes | Name of model to create on SageMaker (1-63 characters, alphanumeric with hyphens) |
|
|
597
|
+
| `--model-source-type` | TEXT | Yes | Model source type ("s3" or "fsx") |
|
|
598
|
+
| `--image-uri` | TEXT | Yes | Docker image URI for inference |
|
|
599
|
+
| `--container-port` | INTEGER | Yes | Port on which model server listens (1-65535) |
|
|
600
|
+
| `--model-volume-mount-name` | TEXT | Yes | Name of the model volume mount |
|
|
601
|
+
| `--namespace` | TEXT | No | Kubernetes namespace |
|
|
602
|
+
| `--metadata-name` | TEXT | No | Name of the custom endpoint object |
|
|
603
|
+
| `--endpoint-name` | TEXT | No | Name of SageMaker endpoint (1-63 characters, alphanumeric with hyphens) |
|
|
604
|
+
| `--env` | OBJECT | No | Environment variables as key-value pairs |
|
|
605
|
+
| `--metrics-enabled` | BOOLEAN | No | Enable metrics collection (default: false) |
|
|
606
|
+
| `--model-version` | TEXT | No | Version of the model (semantic version format) |
|
|
607
|
+
| `--model-location` | TEXT | No | Specific model data location |
|
|
608
|
+
| `--prefetch-enabled` | BOOLEAN | No | Whether to pre-fetch model data (default: false) |
|
|
609
|
+
| `--tls-certificate-output-s3-uri` | TEXT | No | S3 URI for TLS certificate output |
|
|
610
|
+
| `--fsx-dns-name` | TEXT | No | FSx File System DNS Name |
|
|
611
|
+
| `--fsx-file-system-id` | TEXT | No | FSx File System ID |
|
|
612
|
+
| `--fsx-mount-name` | TEXT | No | FSx File System Mount Name |
|
|
613
|
+
| `--s3-bucket-name` | TEXT | No | S3 bucket location |
|
|
614
|
+
| `--s3-region` | TEXT | No | S3 bucket region |
|
|
615
|
+
| `--model-volume-mount-path` | TEXT | No | Path inside container for model volume (default: "/opt/ml/model") |
|
|
616
|
+
| `--resources-limits` | OBJECT | No | Resource limits for the worker |
|
|
617
|
+
| `--resources-requests` | OBJECT | No | Resource requests for the worker |
|
|
618
|
+
| `--dimensions` | OBJECT | No | CloudWatch Metric dimensions as key-value pairs |
|
|
619
|
+
| `--metric-collection-period` | INTEGER | No | Period for CloudWatch query (default: 300) |
|
|
620
|
+
| `--metric-collection-start-time` | INTEGER | No | StartTime for CloudWatch query (default: 300) |
|
|
621
|
+
| `--metric-name` | TEXT | No | Metric name to query for CloudWatch trigger |
|
|
622
|
+
| `--metric-stat` | TEXT | No | Statistics metric for CloudWatch (default: "Average") |
|
|
623
|
+
| `--metric-type` | TEXT | No | Type of metric for HPA ("Value" or "Average", default: "Average") |
|
|
624
|
+
| `--min-value` | NUMBER | No | Minimum metric value for empty CloudWatch response (default: 0) |
|
|
625
|
+
| `--cloud-watch-trigger-name` | TEXT | No | Name for the CloudWatch trigger |
|
|
626
|
+
| `--cloud-watch-trigger-namespace` | TEXT | No | AWS CloudWatch namespace for the metric |
|
|
627
|
+
| `--target-value` | NUMBER | No | Target value for the CloudWatch metric |
|
|
628
|
+
| `--use-cached-metrics` | BOOLEAN | No | Enable caching of metric values (default: true) |
|
|
629
|
+
| `--invocation-endpoint` | TEXT | No | Invocation endpoint path (default: "invocations") |
|
|
630
|
+
| `--debug` | FLAG | No | Enable debug mode (default: false) |
|
|
631
|
+
|
|
632
|
+
|
|
390
633
|
#### Invoke a Custom Inference Endpoint
|
|
391
634
|
|
|
392
635
|
```bash
|
|
@@ -395,12 +638,36 @@ hyp invoke hyp-custom-endpoint \
|
|
|
395
638
|
--body '{"inputs":"What is the capital of USA?"}'
|
|
396
639
|
```
|
|
397
640
|
|
|
398
|
-
####
|
|
641
|
+
#### Managing an Endpoint
|
|
399
642
|
|
|
400
643
|
```bash
|
|
401
|
-
hyp
|
|
644
|
+
hyp list hyp-custom-endpoint
|
|
645
|
+
hyp describe hyp-custom-endpoint --name endpoint-custom
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
#### List Pods
|
|
649
|
+
|
|
650
|
+
```bash
|
|
651
|
+
hyp list-pods hyp-custom-endpoint
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
#### Get Logs
|
|
655
|
+
|
|
656
|
+
```bash
|
|
657
|
+
hyp get-logs hyp-custom-endpoint --pod-name <pod-name>
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
#### Get Operator Logs
|
|
661
|
+
|
|
662
|
+
```bash
|
|
663
|
+
hyp get-operator-logs hyp-custom-endpoint --since-hours 0.5
|
|
402
664
|
```
|
|
403
665
|
|
|
666
|
+
#### Deleting an Endpoint
|
|
667
|
+
|
|
668
|
+
```bash
|
|
669
|
+
hyp delete hyp-custom-endpoint --name endpoint-custom
|
|
670
|
+
```
|
|
404
671
|
|
|
405
672
|
## SDK
|
|
406
673
|
|
|
@@ -539,11 +806,65 @@ pytorch_job = HyperPodPytorchJob
|
|
|
539
806
|
)
|
|
540
807
|
# Launch the job
|
|
541
808
|
pytorch_job.create()
|
|
542
|
-
|
|
543
|
-
|
|
544
809
|
```
|
|
545
810
|
|
|
811
|
+
#### List Training Jobs
|
|
812
|
+
```python
|
|
813
|
+
from sagemaker.hyperpod.training import HyperPodPytorchJob
|
|
814
|
+
import yaml
|
|
815
|
+
|
|
816
|
+
# List all PyTorch jobs
|
|
817
|
+
jobs = HyperPodPytorchJob.list()
|
|
818
|
+
print(yaml.dump(jobs))
|
|
819
|
+
```
|
|
820
|
+
|
|
821
|
+
#### Describe a Training Job
|
|
822
|
+
```python
|
|
823
|
+
from sagemaker.hyperpod.training import HyperPodPytorchJob
|
|
546
824
|
|
|
825
|
+
# Get an existing job
|
|
826
|
+
job = HyperPodPytorchJob.get(name="my-pytorch-job")
|
|
827
|
+
|
|
828
|
+
print(job)
|
|
829
|
+
```
|
|
830
|
+
|
|
831
|
+
#### List Pods for a Training Job
|
|
832
|
+
```python
|
|
833
|
+
from sagemaker.hyperpod.training import HyperPodPytorchJob
|
|
834
|
+
|
|
835
|
+
# List Pods for an existing job
|
|
836
|
+
job = HyperPodPytorchJob.get(name="my-pytorch-job")
|
|
837
|
+
print(job.list_pods())
|
|
838
|
+
```
|
|
839
|
+
|
|
840
|
+
#### Get Logs from a Pod
|
|
841
|
+
```python
|
|
842
|
+
from sagemaker.hyperpod.training import HyperPodPytorchJob
|
|
843
|
+
|
|
844
|
+
# Get pod logs for a job
|
|
845
|
+
job = HyperPodPytorchJob.get(name="my-pytorch-job")
|
|
846
|
+
print(job.get_logs_from_pod("pod-name"))
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
#### Get Training Operator Logs
|
|
850
|
+
```python
|
|
851
|
+
from sagemaker.hyperpod.training import HyperPodPytorchJob
|
|
852
|
+
|
|
853
|
+
# Get training operator logs
|
|
854
|
+
job = HyperPodPytorchJob.get(name="my-pytorch-job")
|
|
855
|
+
print(job.get_operator_logs(since_hours=0.1))
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
#### Delete a Training Job
|
|
859
|
+
```python
|
|
860
|
+
from sagemaker.hyperpod.training import HyperPodPytorchJob
|
|
861
|
+
|
|
862
|
+
# Get an existing job
|
|
863
|
+
job = HyperPodPytorchJob.get(name="my-pytorch-job")
|
|
864
|
+
|
|
865
|
+
# Delete the job
|
|
866
|
+
job.delete()
|
|
867
|
+
```
|
|
547
868
|
|
|
548
869
|
### Inference SDK
|
|
549
870
|
|
|
@@ -551,7 +872,7 @@ pytorch_job.create()
|
|
|
551
872
|
|
|
552
873
|
Pre-trained Jumpstart models can be gotten from https://sagemaker.readthedocs.io/en/v2.82.0/doc_utils/jumpstart.html and fed into the call for creating the endpoint
|
|
553
874
|
|
|
554
|
-
```
|
|
875
|
+
```python
|
|
555
876
|
from sagemaker.hyperpod.inference.config.hp_jumpstart_endpoint_config import Model, Server, SageMakerEndpoint, TlsConfig
|
|
556
877
|
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
|
|
557
878
|
|
|
@@ -572,19 +893,9 @@ js_endpoint=HPJumpStartEndpoint(
|
|
|
572
893
|
js_endpoint.create()
|
|
573
894
|
```
|
|
574
895
|
|
|
575
|
-
|
|
576
|
-
#### Invoke a JumpstartModel Endpoint
|
|
577
|
-
|
|
578
|
-
```
|
|
579
|
-
data = '{"inputs":"What is the capital of USA?"}'
|
|
580
|
-
response = js_endpoint.invoke(body=data).body.read()
|
|
581
|
-
print(response)
|
|
582
|
-
```
|
|
583
|
-
|
|
584
|
-
|
|
585
896
|
#### Creating a Custom Inference Endpoint (with S3)
|
|
586
897
|
|
|
587
|
-
```
|
|
898
|
+
```python
|
|
588
899
|
from sagemaker.hyperpod.inference.config.hp_endpoint_config import CloudWatchTrigger, Dimensions, AutoScalingSpec, Metrics, S3Storage, ModelSourceConfig, TlsConfig, EnvironmentVariables, ModelInvocationPort, ModelVolumeMount, Resources, Worker
|
|
589
900
|
from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint
|
|
590
901
|
|
|
@@ -632,37 +943,148 @@ custom_endpoint = HPEndpoint(
|
|
|
632
943
|
custom_endpoint.create()
|
|
633
944
|
```
|
|
634
945
|
|
|
635
|
-
#### Invoke a Custom Inference Endpoint
|
|
636
946
|
|
|
947
|
+
#### List Endpoints
|
|
948
|
+
|
|
949
|
+
```python
|
|
950
|
+
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
|
|
951
|
+
from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint
|
|
952
|
+
|
|
953
|
+
# List JumpStart endpoints
|
|
954
|
+
jumpstart_endpoints = HPJumpStartEndpoint.list()
|
|
955
|
+
print(jumpstart_endpoints)
|
|
956
|
+
|
|
957
|
+
# List custom endpoints
|
|
958
|
+
custom_endpoints = HPEndpoint.list()
|
|
959
|
+
print(custom_endpoints)
|
|
637
960
|
```
|
|
961
|
+
|
|
962
|
+
#### Describe an Endpoint
|
|
963
|
+
```python
|
|
964
|
+
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
|
|
965
|
+
from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint
|
|
966
|
+
|
|
967
|
+
# Get JumpStart endpoint details
|
|
968
|
+
jumpstart_endpoint = HPJumpStartEndpoint.get(name="js-endpoint-name", namespace="test")
|
|
969
|
+
print(jumpstart_endpoint)
|
|
970
|
+
|
|
971
|
+
# Get custom endpoint details
|
|
972
|
+
custom_endpoint = HPEndpoint.get(name="endpoint-custom")
|
|
973
|
+
print(custom_endpoint)
|
|
974
|
+
|
|
975
|
+
```
|
|
976
|
+
|
|
977
|
+
#### Invoke an Endpoint
|
|
978
|
+
```python
|
|
979
|
+
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
|
|
980
|
+
from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint
|
|
981
|
+
|
|
638
982
|
data = '{"inputs":"What is the capital of USA?"}'
|
|
983
|
+
jumpstart_endpoint = HPJumpStartEndpoint.get(name="endpoint-jumpstart")
|
|
984
|
+
response = jumpstart_endpoint.invoke(body=data).body.read()
|
|
985
|
+
print(response)
|
|
986
|
+
|
|
987
|
+
custom_endpoint = HPEndpoint.get(name="endpoint-custom")
|
|
639
988
|
response = custom_endpoint.invoke(body=data).body.read()
|
|
640
989
|
print(response)
|
|
641
990
|
```
|
|
642
991
|
|
|
643
|
-
####
|
|
992
|
+
#### List Pods
|
|
993
|
+
```python
|
|
994
|
+
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
|
|
995
|
+
from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint
|
|
644
996
|
|
|
997
|
+
# List pods
|
|
998
|
+
js_pods = HPJumpStartEndpoint.list_pods()
|
|
999
|
+
print(js_pods)
|
|
1000
|
+
|
|
1001
|
+
c_pods = HPEndpoint.list_pods()
|
|
1002
|
+
print(c_pods)
|
|
645
1003
|
```
|
|
646
|
-
endpoint_list = HPEndpoint.list()
|
|
647
|
-
print(endpoint_list[0])
|
|
648
1004
|
|
|
649
|
-
|
|
1005
|
+
#### Get Logs
|
|
1006
|
+
```python
|
|
1007
|
+
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
|
|
1008
|
+
from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint
|
|
1009
|
+
|
|
1010
|
+
# Get logs from pod
|
|
1011
|
+
js_logs = HPJumpStartEndpoint.get_logs(pod=<pod-name>)
|
|
1012
|
+
print(js_logs)
|
|
650
1013
|
|
|
1014
|
+
c_logs = HPEndpoint.get_logs(pod=<pod-name>)
|
|
1015
|
+
print(c_logs)
|
|
651
1016
|
```
|
|
652
1017
|
|
|
653
|
-
####
|
|
1018
|
+
#### Get Operator Logs
|
|
1019
|
+
```python
|
|
1020
|
+
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
|
|
1021
|
+
from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint
|
|
1022
|
+
|
|
1023
|
+
# Invoke JumpStart endpoint
|
|
1024
|
+
print(HPJumpStartEndpoint.get_operator_logs(since_hours=0.1))
|
|
654
1025
|
|
|
1026
|
+
# Invoke custom endpoint
|
|
1027
|
+
print(HPEndpoint.get_operator_logs(since_hours=0.1))
|
|
655
1028
|
```
|
|
656
|
-
custom_endpoint.delete()
|
|
657
1029
|
|
|
1030
|
+
#### Delete an Endpoint
|
|
1031
|
+
```python
|
|
1032
|
+
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
|
|
1033
|
+
from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint
|
|
1034
|
+
|
|
1035
|
+
# Delete JumpStart endpoint
|
|
1036
|
+
jumpstart_endpoint = HPJumpStartEndpoint.get(name="endpoint-jumpstart")
|
|
1037
|
+
jumpstart_endpoint.delete()
|
|
1038
|
+
|
|
1039
|
+
# Delete custom endpoint
|
|
1040
|
+
custom_endpoint = HPEndpoint.get(name="endpoint-custom")
|
|
1041
|
+
custom_endpoint.delete()
|
|
658
1042
|
```
|
|
659
1043
|
|
|
1044
|
+
|
|
660
1045
|
#### Observability - Getting Monitoring Information
|
|
661
1046
|
```python
|
|
662
1047
|
from sagemaker.hyperpod.observability.utils import get_monitoring_config
|
|
663
1048
|
monitor_config = get_monitoring_config()
|
|
664
1049
|
```
|
|
665
1050
|
|
|
1051
|
+
## Examples
|
|
1052
|
+
#### Cluster Management Example Notebooks
|
|
1053
|
+
|
|
1054
|
+
[CLI Cluster Management Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/cluster_management/cluster_creation_init_experience.ipynb)
|
|
1055
|
+
|
|
1056
|
+
[SDK Cluster Management Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/cluster_management/cluster_creation_sdk_experience.ipynb)
|
|
1057
|
+
|
|
1058
|
+
#### Training Example Notebooks
|
|
1059
|
+
|
|
1060
|
+
[CLI Training Init Experience Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/training/CLI/training-init-experience.ipynb)
|
|
1061
|
+
|
|
1062
|
+
[CLI Training Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/training/CLI/training-e2e-cli.ipynb)
|
|
1063
|
+
|
|
1064
|
+
[SDK Training Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/training/SDK/training_sdk_example.ipynb)
|
|
1065
|
+
|
|
1066
|
+
#### Inference Example Notebooks
|
|
1067
|
+
|
|
1068
|
+
##### CLI
|
|
1069
|
+
[CLI Inference Jumpstart Model Init Experience Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/CLI/inference-jumpstart-init-experience.ipynb)
|
|
1070
|
+
|
|
1071
|
+
[CLI Inference JumpStart Model Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/CLI/inference-jumpstart-e2e-cli.ipynb)
|
|
1072
|
+
|
|
1073
|
+
[CLI Inference FSX Model Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/CLI/inference-fsx-model-e2e-cli.ipynb)
|
|
1074
|
+
|
|
1075
|
+
[CLI Inference S3 Model Init Experience Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/CLI/inference-s3-model-init-experience.ipynb)
|
|
1076
|
+
|
|
1077
|
+
[CLI Inference S3 Model Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/CLI/inference-s3-model-e2e-cli.ipynb)
|
|
1078
|
+
|
|
1079
|
+
##### SDK
|
|
1080
|
+
|
|
1081
|
+
[SDK Inference JumpStart Model Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/SDK/inference-jumpstart-e2e.ipynb)
|
|
1082
|
+
|
|
1083
|
+
[SDK Inference FSX Model Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/SDK/inference-fsx-model-e2e.ipynb)
|
|
1084
|
+
|
|
1085
|
+
[SDK Inference S3 Model Example](https://github.com/aws/sagemaker-hyperpod-cli/blob/main/examples/inference/SDK/inference-s3-model-e2e.ipynb)
|
|
1086
|
+
|
|
1087
|
+
|
|
666
1088
|
## Disclaimer
|
|
667
1089
|
|
|
668
1090
|
* This CLI and SDK requires access to the user's file system to set and get context and function properly.
|